From 3c8b47ad814bff7f94d17ae786a04112e3de91c1 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 19 Feb 2014 15:10:04 -0500 Subject: [PATCH] Verify mode for template module --- .../integration/roles/test_template/tasks/main.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests_new/integration/roles/test_template/tasks/main.yml b/tests_new/integration/roles/test_template/tasks/main.yml index a7f1066cb0d..9db6eccb588 100644 --- a/tests_new/integration/roles/test_template/tasks/main.yml +++ b/tests_new/integration/roles/test_template/tasks/main.yml @@ -17,7 +17,7 @@ # along with Ansible. If not, see . - name: fill in a basic template - template: src=foo.j2 dest={{output_dir}}/foo.templated + template: src=foo.j2 dest={{output_dir}}/foo.templated mode=0644 register: template_result - assert: @@ -36,6 +36,8 @@ - name: verify that the file was marked as changed assert: { that: "template_result.changed == true" } +# VERIFY CONTENTS + - name: copy known good into place copy: src=foo.txt dest={{output_dir}}/foo.txt @@ -48,3 +50,13 @@ that: - 'diff_result.stdout == ""' - "diff_result.rc == 0" + +# VERIFY MODE + +- name: set file mode + file: path={{output_dir}}/foo.templated mode=0644 + register: file_result + +- name: ensure file mode did not change + assert: { that: "file_result.changed != True" } +