1 year ago
#276894
fm2ahmed
Ansible default value not picking up 'localhost'
I have a conditional for Hosts but it's not picking up 'localhost' as the default value. Can you please help?
---
- hosts: "{{ pod + '_SE_Cluster_' + cl | default(localhost) }}"
'pod' and 'cl' are 2 Variables that are passed and works fine when passed. The issue is only the localhost.
Output:
[WARNING]: Could not match supplied host pattern, ignoring: RDG1_SE_Cluster_1
I did not pass pod_SE_CLUSTER_cl
and it should pickup localhost by default but it didn't as u can see above
ansible
ansible-inventory
hosts
0 Answers
Your Answer