Hello!

I'm deploying a cluster of app-servers behind a load balancer. When an 
appserver has been installed - and has passed some basic tests - I would 
like to add it to a dynamic group. Later, in the nginx (the load balancer) 
config file template, I'm iterating over this dynamic group in order to add 
only functioning app-servers to the nginx load balancing configuration.

So, in the playbook, which sets up the app-server, I have this here at the 
end:

- name: add new instance to functioning applayer group
  local_action:
      add_host name={{ inventory_hostname }} 
groupname=functioning-applayer-hosts

However, only one of my app servers is added to this group. In fact, when I 
watch Ansible process my playbooks, it just looks like this:

...

TASK: [appserver | running unit tests] 
**************************************** 
skipping: [54.206.225.114]
skipping: [54.206.165.147]

TASK: [appserver | add new instance to functioning applayer group] 
************ 
ok: [54.206.165.147]        <====== ONLY DONE FOR A SINGLE HOST, FOR SOME 
REASON...

TASK: [appserver | stopping django server] 
************************************ 
changed: [54.206.165.147]
changed: [54.206.225.114]

TASK: [appserver | starting django server] 
************************************ 
<job 82131229693> finished on 54.206.165.147
<job 82131229693> finished on 54.206.225.114
...

You can see that my unit tests are run on both app-servers, the Django 
process is restarted on both app-servers, but right in the middle only one 
of them is added to the "functioning-applayer-hosts" group.

Any idea why this is the case and how I could fix this?

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/f6b63fef-a444-4c9d-a6f4-23846f9e7b5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to