Hello,
I am new to ansible. Trying to understand a piece of ansible using debug.
- name: Evaluate oo_all_hosts
add_host:
name: “{{ item }}”
groups: oo_all_hosts
ansible_ssh_user: “{{ g_ssh_user | default(omit) }}”
ansible_become: “{{ g_sudo | default(omit) }}”
with_items: “{{ g_all_hosts | default() }}”
changed_when: no
I put a debug after this
- debug:
var: oo_all_hosts
prints as undefined
no issues with g_all_hosts
Can someone help me identify the problem?
Thanks,
SN