Hi
I started my RH294 training, and I am a little bit confused about the interpretation of single- double quoted value in Ansible.
When should I use :
What is the difference between :
How ansible interprets each case.
Thank you so much.
Hello @Hamdi_Gabsi !
Thanks for reaching out!
Refer it here : https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html#yaml-syntax
https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html
**************************************************************
Regarding second part :
hosts: 'datacenter*' --> * is interpreted as literal * --> host pattern matching for any host that starts with datacenter.
hosts: "datacenter*" --> wildcard expansion is allowed here --> which will match any string that contains the word "datacenter".
Hello @Hamdi_Gabsi !
Thanks for reaching out!
Refer it here : https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html#yaml-syntax
https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html
**************************************************************
Regarding second part :
hosts: 'datacenter*' --> * is interpreted as literal * --> host pattern matching for any host that starts with datacenter.
hosts: "datacenter*" --> wildcard expansion is allowed here --> which will match any string that contains the word "datacenter".
Thank you so much @Chetan_Tiwary_ for these details.
I think it is clear now.
I appreciate your response.
Glad it helped @Hamdi_Gabsi ! All the best !
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.