336 lines
10 KiB
YAML
336 lines
10 KiB
YAML
|
---
|
||
|
# this test just makes sure the task doesn't fail when we set out expected rc
|
||
|
- name: install broken msi override expected rc
|
||
|
win_package:
|
||
|
path: '{{test_win_package_path}}\bad.msi'
|
||
|
state: present
|
||
|
expected_return_code: 0,1603
|
||
|
|
||
|
- name: install local msi (check mode)
|
||
|
win_package:
|
||
|
path: '{{test_win_package_path}}\good.msi'
|
||
|
state: present
|
||
|
register: install_local_msi_check
|
||
|
check_mode: yes
|
||
|
|
||
|
- name: get result of install local msi (check mode)
|
||
|
win_reg_stat:
|
||
|
path: HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{{test_win_package_good_id}}
|
||
|
register: install_local_msi_actual_check
|
||
|
|
||
|
- name: assert install local msi (check mode)
|
||
|
assert:
|
||
|
that:
|
||
|
- install_local_msi_check|changed
|
||
|
- install_local_msi_check.reboot_required == False
|
||
|
- install_local_msi_actual_check.exists == False
|
||
|
|
||
|
- name: install local msi
|
||
|
win_package:
|
||
|
path: '{{test_win_package_path}}\good.msi'
|
||
|
state: present
|
||
|
expected_return_code: "" # historical, an empty string means 0, 3010
|
||
|
register: install_local_msi
|
||
|
|
||
|
- name: get result of install local msi
|
||
|
win_reg_stat:
|
||
|
path: HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{{test_win_package_good_id}}
|
||
|
register: install_local_msi_actual
|
||
|
|
||
|
- name: assert install local msi
|
||
|
assert:
|
||
|
that:
|
||
|
- install_local_msi|changed
|
||
|
- install_local_msi.reboot_required == False
|
||
|
- install_local_msi.exit_code == 0
|
||
|
- install_local_msi_actual.exists == True
|
||
|
|
||
|
- name: install local msi (idempotent)
|
||
|
win_package:
|
||
|
path: '{{test_win_package_path}}\good.msi'
|
||
|
state: present
|
||
|
register: install_local_msi_idempotent
|
||
|
|
||
|
- name: assert install local msi (idempotent)
|
||
|
assert:
|
||
|
that:
|
||
|
- not install_local_msi_idempotent|changed
|
||
|
|
||
|
- name: uninstall local msi with path (check mode)
|
||
|
win_package:
|
||
|
path: '{{test_win_package_path}}\good.msi'
|
||
|
state: absent
|
||
|
register: uninstall_path_local_msi_check
|
||
|
check_mode: yes
|
||
|
|
||
|
- name: get result of uninstall local msi with path (check mode)
|
||
|
win_reg_stat:
|
||
|
path: HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{{test_win_package_good_id}}
|
||
|
register: uninstall_path_local_msi_actual_check
|
||
|
|
||
|
- name: assert uninstall local msi with path (check mode)
|
||
|
assert:
|
||
|
that:
|
||
|
- uninstall_path_local_msi_check|changed
|
||
|
- uninstall_path_local_msi_check.reboot_required == False
|
||
|
- uninstall_path_local_msi_actual_check.exists == True
|
||
|
|
||
|
- name: uninstall local msi with path
|
||
|
win_package:
|
||
|
path: '{{test_win_package_path}}\good.msi'
|
||
|
state: absent
|
||
|
register: uninstall_path_local_msi
|
||
|
|
||
|
- name: get result of uninstall local msi with path
|
||
|
win_reg_stat:
|
||
|
path: HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{{test_win_package_good_id}}
|
||
|
register: uninstall_path_local_msi_actual
|
||
|
|
||
|
- name: assert uninstall local msi with path
|
||
|
assert:
|
||
|
that:
|
||
|
- uninstall_path_local_msi|changed
|
||
|
- uninstall_path_local_msi.reboot_required == False
|
||
|
- uninstall_path_local_msi.exit_code == 0
|
||
|
- uninstall_path_local_msi_actual.exists == False
|
||
|
|
||
|
- name: uninstall local msi with path (idempotent)
|
||
|
win_package:
|
||
|
path: '{{test_win_package_path}}\good.msi'
|
||
|
state: absent
|
||
|
register: uninstall_path_local_msi_idempotent
|
||
|
|
||
|
- name: assert uninstall local msi with path (idempotent)
|
||
|
assert:
|
||
|
that:
|
||
|
- not uninstall_path_local_msi_idempotent|changed
|
||
|
|
||
|
- name: install url msi (check mode)
|
||
|
win_package:
|
||
|
path: '{{test_win_package_good_url}}'
|
||
|
product_id: '{{test_win_package_good_id}}'
|
||
|
state: present
|
||
|
register: install_url_msi_check
|
||
|
check_mode: yes
|
||
|
|
||
|
- name: get result of install url msi (check mode)
|
||
|
win_reg_stat:
|
||
|
path: HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{{test_win_package_good_id}}
|
||
|
register: install_url_msi_actual_check
|
||
|
|
||
|
- name: assert install url msi (check mode)
|
||
|
assert:
|
||
|
that:
|
||
|
- install_url_msi_check|changed
|
||
|
- install_url_msi_check.reboot_required == False
|
||
|
- install_url_msi_actual_check.exists == False
|
||
|
|
||
|
- name: install url msi
|
||
|
win_package:
|
||
|
path: '{{test_win_package_good_url}}'
|
||
|
product_id: '{{test_win_package_good_id}}'
|
||
|
state: present
|
||
|
register: install_url_msi
|
||
|
|
||
|
- name: get result of install url msi
|
||
|
win_reg_stat:
|
||
|
path: HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{{test_win_package_good_id}}
|
||
|
register: install_url_msi_actual
|
||
|
|
||
|
- name: assert install url msi
|
||
|
assert:
|
||
|
that:
|
||
|
- install_url_msi|changed
|
||
|
- install_url_msi.reboot_required == False
|
||
|
- install_url_msi.exit_code == 0
|
||
|
- install_url_msi_actual.exists == True
|
||
|
|
||
|
- name: install url msi (idempotent)
|
||
|
win_package:
|
||
|
path: '{{test_win_package_good_url}}'
|
||
|
product_id: '{{test_win_package_good_id}}'
|
||
|
state: present
|
||
|
register: install_url_msi_again
|
||
|
|
||
|
- name: assert install url msi (idempotent)
|
||
|
assert:
|
||
|
that:
|
||
|
- not install_url_msi_again|changed
|
||
|
|
||
|
- name: uninstall local msi with product_id (check mode)
|
||
|
win_package:
|
||
|
product_id: '{{test_win_package_good_id}}'
|
||
|
state: absent
|
||
|
register: uninstall_id_local_msi_check
|
||
|
check_mode: yes
|
||
|
|
||
|
- name: get result of uninstall local msi with product_id (check mode)
|
||
|
win_reg_stat:
|
||
|
path: HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{{test_win_package_good_id}}
|
||
|
register: uninstall_id_local_msi_actual_check
|
||
|
|
||
|
- name: assert uninstall local msi with product_id (check mode)
|
||
|
assert:
|
||
|
that:
|
||
|
- uninstall_id_local_msi_check|changed
|
||
|
- uninstall_id_local_msi_check.reboot_required == False
|
||
|
- uninstall_id_local_msi_actual_check.exists == True
|
||
|
|
||
|
- name: uninstall local msi with product_id
|
||
|
win_package:
|
||
|
product_id: '{{test_win_package_good_id}}'
|
||
|
state: absent
|
||
|
register: uninstall_id_local_msi
|
||
|
|
||
|
- name: get result of uninstall local msi with product_id
|
||
|
win_reg_stat:
|
||
|
path: HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{{test_win_package_good_id}}
|
||
|
register: uninstall_id_local_msi_actual
|
||
|
|
||
|
- name: assert uninstall local msi with product_id
|
||
|
assert:
|
||
|
that:
|
||
|
- uninstall_id_local_msi|changed
|
||
|
- uninstall_id_local_msi.reboot_required == False
|
||
|
- uninstall_id_local_msi.exit_code == 0
|
||
|
- uninstall_id_local_msi_actual.exists == False
|
||
|
|
||
|
- name: uninstall local msi with product_id (idempotent)
|
||
|
win_package:
|
||
|
product_id: '{{test_win_package_good_id}}'
|
||
|
state: absent
|
||
|
register: uninstall_id_local_msi_idempotent
|
||
|
|
||
|
- name: assert uninstall local msi with product_id (idempotent)
|
||
|
assert:
|
||
|
that:
|
||
|
- not uninstall_id_local_msi_idempotent|changed
|
||
|
|
||
|
- name: install local reboot msi (check mode)
|
||
|
win_package:
|
||
|
path: '{{test_win_package_path}}\reboot.msi'
|
||
|
state: present
|
||
|
register: install_local_reboot_msi_check
|
||
|
check_mode: yes
|
||
|
|
||
|
- name: get result of install local reboot msi (check mode)
|
||
|
win_reg_stat:
|
||
|
path: HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{{test_win_package_reboot_id}}
|
||
|
register: install_local_reboot_msi_actual_check
|
||
|
|
||
|
- name: assert install local reboot msi (check mode)
|
||
|
assert:
|
||
|
that:
|
||
|
- install_local_reboot_msi_check|changed
|
||
|
- install_local_reboot_msi_check.reboot_required == False
|
||
|
- install_local_reboot_msi_actual_check.exists == False
|
||
|
|
||
|
- name: install local reboot msi
|
||
|
win_package:
|
||
|
path: '{{test_win_package_path}}\reboot.msi'
|
||
|
state: present
|
||
|
register: install_local_reboot_msi
|
||
|
|
||
|
- name: get result of install local reboot msi
|
||
|
win_reg_stat:
|
||
|
path: HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{{test_win_package_reboot_id}}
|
||
|
register: install_local_reboot_msi_actual
|
||
|
|
||
|
- name: assert install local reboot msi
|
||
|
assert:
|
||
|
that:
|
||
|
- install_local_reboot_msi|changed
|
||
|
- install_local_reboot_msi.reboot_required == True
|
||
|
- install_local_reboot_msi.exit_code == 3010
|
||
|
- install_local_reboot_msi_actual.exists == True
|
||
|
|
||
|
- name: install local reboot msi (idempotent)
|
||
|
win_package:
|
||
|
path: '{{test_win_package_path}}\reboot.msi'
|
||
|
state: present
|
||
|
register: install_local_reboot_msi_idempotent
|
||
|
|
||
|
- name: assert install local reboot msi (idempotent)
|
||
|
assert:
|
||
|
that:
|
||
|
- not install_local_reboot_msi_idempotent|changed
|
||
|
|
||
|
- name: uninstall reboot msi after test
|
||
|
win_package:
|
||
|
path: '{{test_win_package_path}}\reboot.msi'
|
||
|
state: absent
|
||
|
|
||
|
- name: ensure the install folder is cleaned in case uninstall didn't work
|
||
|
win_file:
|
||
|
path: '%ProgramFiles(x86)%\Bovine University'
|
||
|
state: absent
|
||
|
|
||
|
- name: install local msi with arguments (check mode)
|
||
|
win_package:
|
||
|
path: '{{test_win_package_path}}\good.msi'
|
||
|
state: present
|
||
|
arguments: ADDLOCAL=Cow
|
||
|
register: install_msi_argument_check
|
||
|
check_mode: yes
|
||
|
|
||
|
- name: get result of moo file after install local msi with arguments (check mode)
|
||
|
win_stat:
|
||
|
path: '%ProgramFiles(x86)%\Bovine University\moo.exe'
|
||
|
register: install_msi_argument_moo_check
|
||
|
|
||
|
- name: get result of cow file after install local msi with arguments (check mode)
|
||
|
win_stat:
|
||
|
path: '%ProgramFiles(x86)%\Bovine University\cow.exe'
|
||
|
register: install_msi_argument_cow_check
|
||
|
|
||
|
- name: assert install local msi with arguments (check mode)
|
||
|
assert:
|
||
|
that:
|
||
|
- install_msi_argument_check|changed
|
||
|
- install_msi_argument_check.reboot_required == False
|
||
|
- install_msi_argument_moo_check.stat.exists == False
|
||
|
- install_msi_argument_cow_check.stat.exists == False
|
||
|
|
||
|
- name: install local msi with arguments
|
||
|
win_package:
|
||
|
path: '{{test_win_package_path}}\good.msi'
|
||
|
state: present
|
||
|
arguments: ADDLOCAL=Cow
|
||
|
register: install_msi_argument
|
||
|
|
||
|
- name: get result of moo file after install local msi with arguments
|
||
|
win_stat:
|
||
|
path: '%ProgramFiles(x86)%\Bovine University\moo.exe'
|
||
|
register: install_msi_argument_moo
|
||
|
|
||
|
- name: get result of cow file after install local msi with arguments
|
||
|
win_stat:
|
||
|
path: '%ProgramFiles(x86)%\Bovine University\cow.exe'
|
||
|
register: install_msi_argument_cow
|
||
|
|
||
|
- name: assert install local msi with arguments
|
||
|
assert:
|
||
|
that:
|
||
|
- install_msi_argument|changed
|
||
|
- install_msi_argument.reboot_required == False
|
||
|
- install_msi_argument.exit_code == 0
|
||
|
- install_msi_argument_moo.stat.exists == False
|
||
|
- install_msi_argument_cow.stat.exists == True
|
||
|
|
||
|
- name: install local msi with arguments (idempotent)
|
||
|
win_package:
|
||
|
path: '{{test_win_package_path}}\good.msi'
|
||
|
state: present
|
||
|
arguments: ADDLOCAL=Cow
|
||
|
register: install_msi_argument_again
|
||
|
|
||
|
- name: assert install local msi with arguments (idempotent)
|
||
|
assert:
|
||
|
that:
|
||
|
- not install_msi_argument_again|changed
|
||
|
|
||
|
- name: uninstall good msi after test
|
||
|
win_package:
|
||
|
path: '{{test_win_package_path}}\good.msi'
|
||
|
state: absent
|