summaryrefslogtreecommitdiff
path: root/test/integration/targets/win_lineinfile
diff options
context:
space:
mode:
authorDag Wieers <dag@wieers.com>2019-02-25 02:37:25 +0100
committerJordan Borean <jborean93@gmail.com>2019-02-25 11:37:25 +1000
commit3d1dd0e5995e9808143debd50f1f790bceb2e6e0 (patch)
tree26737664d33d2c89906e642bf990f3db93545136 /test/integration/targets/win_lineinfile
parent76b5a9fb52585d8018fca5d333ce4470757920e9 (diff)
downloadansible-3d1dd0e5995e9808143debd50f1f790bceb2e6e0.tar.gz
Windows: Add backup parameter to modules (#50033)
* Windows: Add backup parameter to modules This PR adds a backup infrastructure for modules. * Fixes based on review feedback * Various fixes to check-mode and backup * Add integration tests * Fix win_xml integration test * Add backup support to copy action plugin * Added integration tests * Improve test efficiencies and other minor impv
Diffstat (limited to 'test/integration/targets/win_lineinfile')
-rw-r--r--test/integration/targets/win_lineinfile/tasks/main.yml11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/integration/targets/win_lineinfile/tasks/main.yml b/test/integration/targets/win_lineinfile/tasks/main.yml
index a1d9622535..e5f047bec3 100644
--- a/test/integration/targets/win_lineinfile/tasks/main.yml
+++ b/test/integration/targets/win_lineinfile/tasks/main.yml
@@ -43,12 +43,17 @@
win_lineinfile: dest={{win_output_dir}}/test.txt state=present line="New line at the beginning" insertbefore="BOF" backup=yes
register: result
+- name: check backup_file
+ win_stat:
+ path: '{{ result.backup_file }}'
+ register: backup_file
+
- name: assert that the line was inserted at the head of the file
assert:
that:
- - "result.changed == true"
- - "result.msg == 'line added'"
- - "result.backup != ''"
+ - result.changed == true
+ - result.msg == 'line added'
+ - backup_file.stat.exists == true
- name: stat the backup file
win_stat: path={{result.backup}}