Quantcast
Channel: sleeplessbeastie's notes
Viewing all articles
Browse latest Browse all 770

How to execute multiple Ansible tasks once per group

$
0
0
Execute multiple Ansible tasks once per group and use a dedicated variable to store custom data. Define hosts that will contain multiple application clusters. $ cat hosts [application:children] application_cluster_development application_cluster_production [application_cluster_development] dev_server_1 ansible_host=127.0.0.1 dev_server_2 ansible_host=127.0.0.1 dev_server_3 ansible_host=127.0.0.1 [application_cluster_production] prod_server1 ansible_host=127.0.0.1 prod_server2 ansible_host=127.0.0.1 prod_server3 ansible_host=127.0.0.1 Define per cluster configuration. $ cat group_vars/application_cluster_production/application_cluster.yml --- cluster_items: - name: […]

Viewing all articles
Browse latest Browse all 770

Trending Articles