Testing Ansible template without running playbook

Testing Ansible template without running playbook

Source: https://stackoverflow.com/questions/35407822/how-can-i-test-jinja2-templates-in-ansible.

ansible all -i "localhost," -c local -m template -a "src=mytemplate.txt.j2 dest=./test.txt" --extra-vars='{a: 1, users: [{name: "name"}]}'

Leave a Reply

Your email address will not be published. Required fields are marked *