Ansible does not run the role locally after the remote roles finished

25 views
Skip to first unread message

Busra Koken

unread,
Feb 27, 2016, 11:25:18 AM2/27/16
to Ansible Project

I am using ansible 2.0. I have different roles which run on local or remote hosts. My site.yml is following:


- name: Droplets
  hosts: localhost
  connection: local
  roles:
    - create_cluster
  tags:
  - create

- name: Hadoop
  hosts:
    - master
    - slaves
  become: true
  roles:
    - install_hadoop
  tags:
    - hadoop

- name: Destroy
  hosts: localhost
  connection: local
  roles:
    - destroy
  tags:
    - destroy
 

When I run, ansible-playbook --tags destroy, I only see the role name as starting output but no setup, no task executed. It just skipped.

What could be the problem?

Busra Koken

unread,
Feb 27, 2016, 11:28:42 AM2/27/16
to Ansible Project
Strangely, If I put destroy_cluster play after create_cluster one, 2 local connected play works perfectly. But if I put one remote between them as it seems in my site.yml, last local one does not work. It is called but the tasks are not executed.

I only see: PLAY [Droplets] *************************************************************
Reply all
Reply to author
Forward
0 new messages