Loading...

Groups of Groups in Ansible

:heavy_exclamation_mark: This post is older than a year. Consider some information might not be accurate anymore. :heavy_exclamation_mark:

Ansible is a free-software platform for configuring and managing computers which combines multi-node software deployment, ad hoc task execution, and configuration management by Red Hat. It is also possible to make groups of groups using the :children suffix.

A small example, which geographical distinction of Switzerland. hosts

[zurich]
alpha-z
beta-y
zeta-t
[bern]
alpha-b
omega-t
[lausanne]
chi-zeta
delta
[geneva]
alpha-kappa
gamma
[deutschschweiz:children]
zurich
bern
[romandie:children]
lausanne
geneva

You can address all servers in the french speaking swiss (romandie). This command would reload the monit daemon on all hosts in Lausanne and Geneva.

ansible romandie -i hosts -m shell -a "sudo monit reload"
Please remember the terms for blog comments.