mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-03 23:14:02 -07:00
pipx: add new states (#8809)
* ensure minimum version of pip * ensure pipx 1.7.0 is installed * pipx: add new states/params * add tests * add license to json file * Update plugins/modules/pipx.py Co-authored-by: Felix Fontein <felix@fontein.de> * fix uninject tests * add changelog frag * fix doc per review * refactor license out of pipx spec file * Update plugins/modules/pipx.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/integration/targets/pipx/files/spec.json.license Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
7e978c77b4
commit
43f8adf1a5
10 changed files with 377 additions and 11 deletions
|
@ -0,0 +1,69 @@
|
|||
---
|
||||
# Copyright (c) Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
- name: Set up environment
|
||||
environment:
|
||||
PATH: /usr/local/bin:{{ ansible_env.PATH }}
|
||||
block:
|
||||
- name: Uninstall pycowsay and black
|
||||
community.general.pipx:
|
||||
state: uninstall
|
||||
name: pycowsay
|
||||
|
||||
# latest is 0.0.0.2
|
||||
- name: Install pycowsay 0.0.0.1
|
||||
community.general.pipx:
|
||||
state: install
|
||||
name: pycowsay
|
||||
source: pycowsay==0.0.0.1
|
||||
|
||||
- name: Pin cowsay
|
||||
community.general.pipx:
|
||||
state: pin
|
||||
name: pycowsay
|
||||
register: pin_cow
|
||||
|
||||
- name: Upgrade pycowsay
|
||||
community.general.pipx:
|
||||
state: upgrade
|
||||
name: pycowsay
|
||||
|
||||
- name: Get pycowsay version
|
||||
community.general.pipx_info:
|
||||
name: pycowsay
|
||||
register: cow_info_1
|
||||
|
||||
- name: Unpin cowsay
|
||||
community.general.pipx:
|
||||
state: unpin
|
||||
name: pycowsay
|
||||
register: unpin_cow
|
||||
|
||||
- name: Upgrade pycowsay
|
||||
community.general.pipx:
|
||||
state: upgrade
|
||||
name: pycowsay
|
||||
|
||||
- name: Get pycowsay version
|
||||
community.general.pipx_info:
|
||||
name: pycowsay
|
||||
register: cow_info_2
|
||||
|
||||
- name: Uninstall pycowsay and black (again)
|
||||
community.general.pipx:
|
||||
state: uninstall
|
||||
name: "{{ item }}"
|
||||
loop:
|
||||
- black
|
||||
- pycowsay
|
||||
register: uninstall_all_2
|
||||
|
||||
- name: Assert uninstall-all
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- pin_cow is changed
|
||||
- cow_info_1 == "0.0.0.1"
|
||||
- unpin_cow is changed
|
||||
- cow_info_2 != "0.0.0.1"
|
Loading…
Add table
Add a link
Reference in a new issue