3 ms·
I believe those variables were not handled by the shell but rather in an Ansible "playbook" - see http://docs.ansible.com/ansible/playbooks_variables.html http:
by harryf 11y ago
I believe those variables were not handled by the shell but rather in an Ansible "playbook" - see http://docs.ansible.com/ansible/playbooks_variables.html http://docs.ansible.com/ansible/playbooks_variables.html
i.e. the variables where happening in a Jinja template and because undefined, rm -rf {foo}/{bar} was transformed by the template engine into rm -rf /
- Torgo 11y agothe playbook will fail if there are undefined variables, I find the story suspect.
- rrauenza 11y agoBy default, ansible errors out for undefined variables. http://docs.ansible.com/ansible/playbooks_filters.html#defaulting-undefined-variables http://docs.ansible.com/ansible/playbooks_filters.html#defau...
- draetheus 11y agoAnother lesson to be learned is that it's exceptionally bad practice to use Ansible to push out shell scripts that can be handled by native Ansible modules: http://docs.ansible.com/ansible/file_module.html http://docs.ansible.com/ansible/file_module.html