Configure all hosts, then create a list of the config for all hosts?

Posted by AME on Server Fault See other posts from Server Fault or by AME
Published on 2014-07-17T07:36:40Z Indexed on 2014/08/18 22:23 UTC
Read the original article Hit count: 310

Filed under:
|
|

I deployed a huge number of hosts with Ansible - which did work very nice. Each host got its individual settings and configuration.

Now I'd like to generate a config file for another system that uses these hosts. For it, I need for every host a part of the generated configuration (the one that configures the database).

Here is an example of the situation with two hosts having different configuration and the other system that uses a part of the Ansible-generated configuration:

host1

ansible configured dbA

host2

ansible configured dbQ

The other system:

host1 = dbA

host2 = dbQ

The values are computed differently (dbQ instead of dbB for host2 for example) if it belongs in a different cluster and so on, making it unpractical to just read out host configuration from the host_vars. I believe I would need to iterate over the hosts and let Ansible figure out the computed values for the variables like it would when deploying, but I do not know how to put that result in one template.

Please advise :)

© Server Fault or respective owner

Related posts about linux

Related posts about configuration