diff options
author | Dag Wieers <dag@wieers.com> | 2019-02-25 02:37:25 +0100 |
---|---|---|
committer | Jordan Borean <jborean93@gmail.com> | 2019-02-25 11:37:25 +1000 |
commit | 3d1dd0e5995e9808143debd50f1f790bceb2e6e0 (patch) | |
tree | 26737664d33d2c89906e642bf990f3db93545136 /test/integration/targets/win_template | |
parent | 76b5a9fb52585d8018fca5d333ce4470757920e9 (diff) | |
download | ansible-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_template')
-rw-r--r-- | test/integration/targets/win_template/tasks/main.yml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/integration/targets/win_template/tasks/main.yml b/test/integration/targets/win_template/tasks/main.yml index cd1829dfc4..2d34c1d05f 100644 --- a/test/integration/targets/win_template/tasks/main.yml +++ b/test/integration/targets/win_template/tasks/main.yml @@ -119,6 +119,39 @@ that: - '"FC: no differences encountered" in diff_result.stdout' +# TEST BACKUP +- name: test backup (check_mode) + win_template: + src: foo.j2 + dest: '{{ win_output_dir }}/foo.unix.templated' + backup: yes + register: cm_backup_result + check_mode: yes + +- name: verify that a backup_file was returned + assert: + that: + - cm_backup_result is changed + - cm_backup_result.backup_file is not none + +- name: test backup (normal mode) + win_template: + src: foo.j2 + dest: '{{ win_output_dir }}/foo.unix.templated' + backup: yes + register: nm_backup_result + +- name: check backup_file + win_stat: + path: '{{ nm_backup_result.backup_file }}' + register: backup_file + +- name: verify that a backup_file was returned + assert: + that: + - nm_backup_result is changed + - backup_file.stat.exists == true + - name: create template dest directory win_file: path: '{{win_output_dir}}\directory' |