mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
8136e2e4fe
* Extend win_psmodule - rebased at 2019-01-07 * Change a way how defined parameters are added to the list * Correct registering a repository * Change way how tests for the check_mode: true are run * Post-review updates * Post-review updates -2 * Post-review updates -3 * Switch to PowerShell loop * Minor updates * Remove variants of an exception handling * Change error handling
30 lines
970 B
YAML
30 lines
970 B
YAML
# This file is part of Ansible
|
|
|
|
# test code for the win_psmodule module when using winrm connection
|
|
# Copyright: (c) 2018, Wojciech Sciesinski <wojciech[at]sciesinski[dot]net>
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
---
|
|
- name: uninstall any versions of modules used for tests
|
|
win_shell: |
|
|
$ModulesToUninstall = @('powershell-yaml', 'Pester', 'PowerShellCookbook', 'xActiveDirectory')
|
|
ForEach ( $ModuleToUninstall in $ModulesToUninstall ) {
|
|
Uninstall-Module $ModuleToUninstall -AllVersions -Force -ErrorAction Ignore
|
|
}
|
|
changed_when: false
|
|
|
|
- name: unregister the custom repo
|
|
win_psrepository:
|
|
name: "{{ item | quote }}"
|
|
state: absent
|
|
changed_when: false
|
|
with_items:
|
|
- "{{ custom_repo_name }}"
|
|
- "{{ myget_repository_name }}"
|
|
|
|
- name: remove the custom repo folder
|
|
win_file:
|
|
path: "{{ custom_repo_path }}"
|
|
state: absent
|
|
changed_when: false
|
|
ignore_errors: yes
|