I have a question related to random inclusion of irrelevant hosts. Below is 
a part of my playbook:

*- hosts: machine01 machine02 machine03 machine04*
*  gather_facts: no*
*  connection: docker*
*  tasks:*
*    - include: common/setup3.yml*

*- hosts: machine05 machine06*
*  gather_facts: no*
*  connection: docker*
*  tasks:*
*    - include: common/setup2.yml*

setup3.yml includes following lines:

*- name: restart sshd*
*  command: service ssh restar*t

setup2.yml:

*- name: restart sshd*
*  service: name=sshd state=restarted*

However, what sometimes happens is when I run the playbook, eventually I 
get the following output and crash:

*TASK [INCLUDE] *******************************************************
*Friday 22 July 2016 15:00:01 *
*included: /opt/info/ansible/common/setup2.yml for machine05 machine06, 
machine03*

*TASK [restart sshd] *****************************************************
*Friday 22 July 2016 15:00:02*
*changed: [machine 05]*
*fatal: [machine03]: FAILED! => {"changed": false, "failed": true, "msg": 
"no service or tool found for: sshd"}*
*changed: [machine 06]*

So what happens, is for whatever reason setup2.yml includes machine03 (or 
some other random machine) to it's hosts and crashes, because the play is 
not applicable for the machine in question.

What might be the reason for this random inclusion of irrelevant hosts? 
This seems to happen completely randomly in about 20% of cases.

Thank you in advance

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/011ff98d-a1cc-4c3f-beca-5716510151a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to