Hello,
when configuring a load balancer for example, with a templated
configuration file, how would I go about inserting IP addresses from my
inventory file?
I realize that I might not be understanding completely how roles,
playbooks, and the inventory file (and variable files) are supposed to
divide responsibilities among them, because I generally have a
one-to-one-to-many mapping of hosts to playbooks to roles.
For example:
File 'hosts' -----
[db-machine]
<IP #1>
[webserver]
<IP #2>
-------------------
File 'setup-webserver.yml' (playbook) ------
---
- name: Setup webserver
hosts: webserver
user: root
roles:
- infrastructure
- staff-accessible
- webserver
--------------------------------------------------------
And then there is a directory for the 'webserver' role, which contains
tasks to install stuff.
So my question is, if I now wanted to configure a loadbalancer, how would I
go about not duplicating the IP address of the webserver in both the
template and the hosts file?
Also how could it work out if there were more than one hosts in the
'webserver' group in my hosts file?
Thanks,
Thomas
--
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/df0192b4-48d7-47ce-9a29-b6b788b3f1da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.