Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/snap/tasks/test_dangerous.yml

raw symbols SCIP
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 # NOTE This is currently disabled for performance reasons!
7
8 - name: Make sure package is not installed (bpytop)
9 community.general.snap:
10 name: bpytop
11 state: absent
12
13 - name: Download bpytop snap
14 ansible.builtin.command:
15 cmd: snap download bpytop
16 chdir: "{{ remote_tmp_dir }}"
17 register: bpytop_download
18
19 - name: Test block
20 vars:
21 snap_file: "{{ (bpytop_download.stdout_lines[-1] | split(' '))[-1] }}"
22 snap_path: "{{ remote_tmp_dir }}/{{ snap_file }}"
23 block:
24 # Test for https://github.com/ansible-collections/community.general/issues/5715
25 - name: Install package from file (check)
26 community.general.snap:
27 name: "{{ snap_path }}"
28 dangerous: true
29 state: present
30 check_mode: true
31 register: install_dangerous_check
32
33 - name: Install package from file
34 community.general.snap:
35 name: "{{ snap_path }}"
36 dangerous: true
37 state: present
38 register: install_dangerous
39
40 - name: Install package from file (again)
41 community.general.snap:
42 name: "{{ snap_path }}"
43 dangerous: true
44 state: present
45 register: install_dangerous_idempot
46
47 - name: Remove package
48 community.general.snap:
49 name: bpytop
50 state: absent
51 register: remove_dangerous
52
53 - assert:
54 that:
55 - install_dangerous_check is changed
56 - install_dangerous is changed
57 - install_dangerous_idempot is not changed
58 - remove_dangerous is changed