Hi All,
I am trying to move this code to Ansible Tower, but I am not able to figure out how to create survey for hostName variable. Can anyone help me on this
- hosts: all
gather_facts: no
become: yes
vars:
hostName:
- { servername : xxxx , esxi_ip : xxxx , ilo_ip : xxxx }
- { servername : xxxx , esxi_ip : xxxx , ilo_ip : xxxx }
- { servername : xxxx , esxi_ip : xxxx , ilo_ip : xxxx }
ansible_python_interpreter: /usr/bin/python3
tasks:
- name: Create destination directory
ansible.builtin.file:
path: "{{ file_path }}/{{ item.servername }}"
state: directory
group: root
mode: '0755'
loop: "{{ hostName }}"