Skip to content

continuum-visharad-dhavle/ansible_roles_sub_elements

 
 

Repository files navigation

How to leverage with_subelements and seperate yaml for variables

This script can be used when you are required to read values of array of array i.e. double "for" loop. This playbook contains an example where user wants to execute command on various types of instances/servers.

Script can referenced for learning

  • Ansible roles
  • Seperate config file to maintain variable
  • Host groups and their children
  • Global varibles using all file
  • Host specific variables under host_vars

Attention please

  1. Global ansible variable are defined in group_vars/all. Please amend appropriately.
  2. Host specific ansible variabled can be setup at host_vars. Example: host_vars/kafka_2. Please amend approprietly.
  3. Host Key Checking is disabled in ansible.cfg at root level
  4. Hosts are maintained in host

How to execute

ansible-playbook -i hosts master.yml -e "host=int-kafka" -e "@dynatrace_config.yaml"

About

Ansible with Roles, sub_elements, host_vars, host groups, host aliase

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published