Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/pipx/tasks/testcase-8809-installall.yml

raw
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 - name: Set up environment
7 environment:
8 PATH: /usr/local/bin:{{ ansible_facts.env.PATH }}
9 block:
10 - name: Uninstall pycowsay and black
11 community.general.pipx:
12 state: uninstall
13 name: "{{ item }}"
14 loop:
15 - black
16 - pycowsay
17
18 - name: Uninstall pycowsay and black (again)
19 community.general.pipx:
20 state: uninstall
21 name: "{{ item }}"
22 loop:
23 - black
24 - pycowsay
25 register: uninstall_all_1
26
27 - name: Install pycowsay and black
28 community.general.pipx:
29 state: install
30 name: "{{ item }}"
31 loop:
32 - black
33 - pycowsay
34 register: install_all_1
35
36 - name: Generate JSON spec
37 community.general.pipx_info:
38 include_raw: true
39 register: pipx_list
40
41 - name: Copy content
42 ansible.builtin.copy:
43 content: "{{ pipx_list.raw_output }}"
44 dest: "{{ remote_tmp_dir }}/spec.json"
45 mode: "0644"
46
47 - name: Uninstall pycowsay and black (again)
48 community.general.pipx:
49 state: uninstall
50 name: "{{ item }}"
51 loop:
52 - black
53 - pycowsay
54 register: uninstall_all_2
55
56 - name: Use install-all
57 community.general.pipx:
58 state: install_all
59 spec_metadata: "{{ remote_tmp_dir }}/spec.json"
60 register: install_all
61
62 - name: Run pycowsay (should succeed)
63 ansible.builtin.command: pycowsay Moooooooo!
64 changed_when: false
65 register: what_the_cow_said
66
67 - name: Which cow?
68 ansible.builtin.command: which pycowsay
69 changed_when: false
70 register: which_cow
71
72 - name: Uninstall pycowsay and black (again)
73 community.general.pipx:
74 state: uninstall
75 name: "{{ item }}"
76 loop:
77 - black
78 - pycowsay
79 register: uninstall_all_3
80
81 - name: Assert uninstall-all
82 ansible.builtin.assert:
83 that:
84 - uninstall_all_1 is not changed
85 - install_all_1 is changed
86 - uninstall_all_2 is changed
87 - install_all is changed
88 - "'Moooooooo!' in what_the_cow_said.stdout"
89 - uninstall_all_3 is changed