Hi all,
From the Ansible documentation examples I have setup my lamp deployment in an Amazon EC2 environment as bellow :
hosts.txt :
Hi all,
From the Ansible documentation examples I have setup my lamp deployment in an Amazon EC2 environment as bellow :
hosts.txt :
Take a look at setting up delegation:
http://www.ansibleworks.com/docs/playbooks2.html#delegation
What you’ll want to do is use delegate_to to your proxy.
Sure, what you can do is simply have a play at the top that includes the tag.
And that will force fact gathering on all machines.
We’re looking to cache facts in 1.3 or early 1.4, hopefully 1.3.
Hello, I also have the same situation. I can’t use roles at the moment because every server has special configurations. And I need gather facts of some hosts to fill the configuration.
My hosts file.
[server1-app]
10.10.10.1
[server2-app]
10.10.10.2
[server3-app]
10.10.10.3
[server-app:children]
server1-app
server2-app
server3-app
[server-ha]
10.10.10.254
Then I have a playbook only for server-ha to configure haproxy:
Finally, I’ve got it working adding at the top in the ha-server.yml playbook
hosts: server-app
tasks:
gather_facts: True
hosts: server-ha
user: root
… rest stuff of playbook.
Thanks for all!
Manuel.
@OP:
On the no attribute thing, I’m not sure what the answer is directly but you might try running the setup module with ansible on those machines to see what attributes your machines are providing. (ansible proxies -m setup)
On the second, I just separate each individual type of server into it’s own playbook, and then also have a playbook that runs them all (the big one pretty much never actually gets used right now because it just takes too long). Since all the code is in the roles anyway, it still leaves a very manageable root dir.
Of course when you do the proxies playbook, you will have to add a section that gathers facts from the other groups, but doesn’t run any tasks, like what Manuel has done. Otherwise the information for your webservers won’t be available to haproxy.