Hello!
On Mon, 2014-03-24 at 08:26 -0400, Michael DeHaan wrote:
> The "add host" module is currently coded as something called a "bypass
> host group" module, which means it only runs once.
Thank you for your reply. You're right: This is a little confusing when
you come across this for the first time. I would have 'debugged' this
endlessly without coming to a solution.
> A better way to talk to all servers that function is thus:
> - hosts: group1
> tasks:
> - ....
> Because what happens here is as soon as a host fails, it will be
> pulled *OUT* of the group.
Unfortunately, that doesn't always seem to apply. I just now observed a
playbook being processed in which one host failed due to some
intermittent SSH error, nothing to worry about. And indeed, I saw that
as the playbook processing continued, this host was skipped in whatever
tasks came up next. However, finally a template was being processed (to
create the load balancer config file) in which I iterated over the
members of that group. Suddenly, even the failed host was back in.
Not sure if this is specific to templates, or maybe it has to do with
the fact that the failure and the template processing took place in
different playbooks?
In site.yml:
- include: appservers.yml
- include: frontend.yml
In appservers.yml:
- hosts: applayer-hosts
tasks:
...
... <==== some failure here for one of the hosts
...
In frontend.yml:
- hosts: frontend-hosts
tasks:
...
... <==== template processing
...
In the template:
{% for host in groups['applayer-hosts'] %}
....
{% endfor %}
Does this explain why the failed host was included in the template
processing? How could I avoid that?
Thank you very much...
Juergen
--
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/1395692619.29368.14.camel%40localhost.
For more options, visit https://groups.google.com/d/optout.