I have a question on how do we give multiple values to "ansible_host" magic variable.
I have my hosts.yml like below:
all:
hosts:
ansible:
host:
children:
applications:
children:
java_applications:
children:
atlassian_applications:
hosts:
confluence:
ansible_host: 53.31.54.55
i have requirement to specify multiple hosts to the ansible_host magic variable and perform all the tasks to all the hosts mentioned in my playbook file.
currently my playbook file is like below:
- hosts: confluence
gather_facts: true
become: true
remote_user: root
tasks:
- debug: var=ansible_default_ipv4.address
roles:
- ansible-preparation