Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/pipx/tasks/testcase-8809-pin.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: pycowsay
14
15 # latest is 0.0.0.2
16 - name: Install pycowsay 0.0.0.1
17 community.general.pipx:
18 state: install
19 name: pycowsay
20 source: pycowsay==0.0.0.1
21
22 - name: Pin cowsay
23 community.general.pipx:
24 state: pin
25 name: pycowsay
26 register: pin_cow
27
28 - name: Upgrade pycowsay
29 community.general.pipx:
30 state: upgrade
31 name: pycowsay
32
33 - name: Get pycowsay version
34 community.general.pipx_info:
35 name: pycowsay
36 register: cow_info_1
37
38 - name: Unpin cowsay
39 community.general.pipx:
40 state: unpin
41 name: pycowsay
42 register: unpin_cow
43
44 - name: Upgrade pycowsay
45 community.general.pipx:
46 state: upgrade
47 name: pycowsay
48
49 - name: Get pycowsay version
50 community.general.pipx_info:
51 name: pycowsay
52 register: cow_info_2
53
54 - name: Uninstall pycowsay and black (again)
55 community.general.pipx:
56 state: uninstall
57 name: pycowsay
58
59 - name: Assert pin/unpin
60 ansible.builtin.assert:
61 that:
62 - pin_cow is changed
63 - cow_info_1.application.0.version == "0.0.0.1"
64 - unpin_cow is changed
65 - cow_info_2.application.0.version != "0.0.0.1"