Debian Codegraph @

ansible_collections/community/windows/tests/integration/targets/win_psscript_info/tasks/main.yml

raw
1 # This file is part of Ansible
2
3 # Copyright: (c) 2020, Brian Scholer <@briantist>
4 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
5 ---
6 - name: Reset repositories
7 ansible.windows.win_shell: |
8 Get-PSRepository | Unregister-PSRepository
9 Register-PSRepository -Default
10
11 - name: Set up directory repository
12 ansible.windows.win_copy:
13 src: "{{ role_path }}/files/"
14 dest: "{{ repo_path }}"
15 force: no
16
17 - name: Register repository
18 community.windows.win_psrepository:
19 name: "{{ repository_name }}"
20 source_location: "{{ repo_path }}"
21 installation_policy: trusted
22
23 - block:
24 - name: Install Scripts
25 community.windows.win_psscript:
26 name: "{{ item }}"
27 state: latest
28 repository: "{{ repository_name }}"
29 loop: "{{ sample_scripts }}"
30
31 - name: Run Tests
32 import_tasks: tests.yml
33
34 - name: Run Tests (check mode)
35 import_tasks: tests.yml
36 vars:
37 run_check_mode: True
38
39 always:
40 - name: Remove Scripts
41 community.windows.win_psscript:
42 name: "{{ item }}"
43 state: absent
44 loop: "{{ sample_scripts }}"
45
46 - name: Reset repositories
47 ansible.windows.win_shell: |
48 Get-PSRepository | Unregister-PSRepository
49 Register-PSRepository -Default