mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.0 KiB
YAML
71 lines
2.0 KiB
YAML
11 years ago
|
# test code for the win_msi module
|
||
|
# (c) 2014, Chris Church <chris@ninemoreminutes.com>
|
||
|
|
||
|
# This file is part of Ansible
|
||
|
#
|
||
|
# Ansible is free software: you can redistribute it and/or modify
|
||
|
# it under the terms of the GNU General Public License as published by
|
||
|
# the Free Software Foundation, either version 3 of the License, or
|
||
|
# (at your option) any later version.
|
||
|
#
|
||
|
# Ansible is distributed in the hope that it will be useful,
|
||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
# GNU General Public License for more details.
|
||
|
#
|
||
|
# You should have received a copy of the GNU General Public License
|
||
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||
|
|
||
|
- name: use win_get_url module to download msi
|
||
9 years ago
|
win_get_url:
|
||
9 years ago
|
url: "{{msi_url}}"
|
||
|
dest: "{{msi_download_path}}"
|
||
11 years ago
|
register: win_get_url_result
|
||
|
|
||
9 years ago
|
- name: make sure msi is uninstalled
|
||
9 years ago
|
win_msi:
|
||
9 years ago
|
path: "{{msi_product_code|default(msi_download_path,true)}}"
|
||
9 years ago
|
state: absent
|
||
9 years ago
|
wait: true
|
||
9 years ago
|
ignore_errors: true
|
||
|
|
||
9 years ago
|
- name: install msi
|
||
9 years ago
|
win_msi:
|
||
9 years ago
|
path: "{{msi_download_path}}"
|
||
9 years ago
|
wait: true
|
||
11 years ago
|
register: win_msi_install_result
|
||
|
|
||
|
- name: check win_msi install result
|
||
9 years ago
|
assert:
|
||
11 years ago
|
that:
|
||
|
- "not win_msi_install_result|failed"
|
||
|
- "win_msi_install_result|changed"
|
||
|
|
||
9 years ago
|
- name: install msi again with creates argument
|
||
9 years ago
|
win_msi:
|
||
9 years ago
|
path: "{{msi_download_path}}"
|
||
9 years ago
|
wait: true
|
||
9 years ago
|
creates: "{{msi_install_path}}"
|
||
9 years ago
|
register: win_msi_install_again_result
|
||
|
|
||
|
- name: check win_msi install again result
|
||
8 years ago
|
# ignore errors because test/module is unreliable
|
||
|
ignore_errors: true
|
||
9 years ago
|
assert:
|
||
|
that:
|
||
|
- "not win_msi_install_again_result|failed"
|
||
|
- "not win_msi_install_again_result|changed"
|
||
|
|
||
9 years ago
|
- name: uninstall msi
|
||
9 years ago
|
win_msi:
|
||
9 years ago
|
path: "{{msi_download_path}}"
|
||
9 years ago
|
wait: true
|
||
9 years ago
|
state: absent
|
||
11 years ago
|
register: win_msi_uninstall_result
|
||
|
|
||
|
- name: check win_msi uninstall result
|
||
|
assert:
|
||
|
that:
|
||
|
- "not win_msi_uninstall_result|failed"
|
||
|
- "win_msi_uninstall_result|changed"
|