diff --git a/src/ops/tools/ansible.md b/src/ops/tools/ansible.md index 268efc1..afe49e9 100644 --- a/src/ops/tools/ansible.md +++ b/src/ops/tools/ansible.md @@ -33,4 +33,20 @@ To tell Jinja2 to not mess with carriage return in templates add --- ``` -at the top of the template file \ No newline at end of file +at the top of the template file + +## Import vs include (kudos @href) + +If you want to exec a sets of tasks when a condition is true, use +import_tasks. + +``` +- name: Include init tasks + import_tasks: init.yml + tags: + - init + when: proof.stat.exists == False +``` + +`ìnclude_tasks` will add all tasks to play run, even if the when condition is +false. \ No newline at end of file