Added support for user-specified log file in win_package (#51104)

* Added support for user-specified log file in win_package - feature (#38353)

* added integration tests for win_package log_path support feature (#38353), and applied review feedback

* win_package log_path support feature (#38353) - fixed typo in win-package.py documentation

* win_package log_path support feature (#38353) - improved an integration test and better doc in win-package.py
This commit is contained in:
Straff
2019-02-13 22:08:07 +13:00
committed by Jordan Borean
parent 467d2ebecd
commit d4a07f9573
4 changed files with 47 additions and 10 deletions

View File

@@ -2,6 +2,8 @@
# spaces are tricky, let's have one by default
test_win_package_path_safe: C:\ansible\win_package
test_win_package_path: C:\ansible\win package
test_win_package_log_path_install: C:\ansible\win package\test-install.log
test_win_package_log_path_uninstall: C:\ansible\win package\test-uninstall.log
test_win_package_good_url: https://s3.amazonaws.com/ansible-ci-files/test/integration/roles/test_win_package/good.msi
test_win_package_reboot_url: https://s3.amazonaws.com/ansible-ci-files/test/integration/roles/test_win_package/reboot.msi
test_win_package_bad_url: https://s3.amazonaws.com/ansible-ci-files/test/integration/roles/test_win_package/bad.msi

View File

@@ -25,10 +25,11 @@
- install_local_msi_check.reboot_required == False
- install_local_msi_actual_check.exists == False
- name: install local msi
- name: install local msi with log
win_package:
path: '{{test_win_package_path}}\good.msi'
state: present
log_path: "{{test_win_package_log_path_install}}"
register: install_local_msi
- name: get result of install local msi
@@ -44,6 +45,16 @@
- install_local_msi.rc == 0
- install_local_msi_actual.exists == True
- name: get result of install local msi log_path
win_stat:
path: "{{test_win_package_log_path_install}}"
register: install_local_msi_actual_log_path
- name: assert install local msi log path
assert:
that:
- install_local_msi_actual_log_path.stat.exists == True
- name: install local msi (idempotent)
win_package:
path: '{{test_win_package_path}}\good.msi'
@@ -78,6 +89,7 @@
win_package:
path: '{{test_win_package_path}}\good.msi'
state: absent
log_path: "{{test_win_package_log_path_uninstall}}"
register: uninstall_path_local_msi
- name: get result of uninstall local msi with path
@@ -93,6 +105,16 @@
- uninstall_path_local_msi.rc == 0
- uninstall_path_local_msi_actual.exists == False
- name: get result of uninstall local msi with path
win_stat:
path: "{{test_win_package_log_path_uninstall}}"
register: uninstall_path_local_msi_actual_log_path
- name: assert uninstall local msi with path
assert:
that:
- uninstall_path_local_msi_actual_log_path.stat.exists == True # we expect log to remain
- name: uninstall local msi with path (idempotent)
win_package:
path: '{{test_win_package_path}}\good.msi'