1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

pipx: add required_if fo upgrade and reinstall (#5100)

* pipx: add required_if for upgrade and reinstall

* add changelog fragment
This commit is contained in:
Alexei Znamensky 2022-08-09 20:15:51 +12:00 committed by GitHub
parent aab22e7f32
commit 83317419d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 2 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- pipx - module fails faster when ``name`` is missing for states ``upgrade`` and ``reinstall`` (https://github.com/ansible-collections/community.general/pull/5100).

View file

@ -164,7 +164,8 @@ class PipX(StateModuleHelper):
('state', 'install', ['name']), ('state', 'install', ['name']),
('state', 'absent', ['name']), ('state', 'absent', ['name']),
('state', 'uninstall', ['name']), ('state', 'uninstall', ['name']),
# missing upgrade and reinstall requiring 'name' ('state', 'upgrade', ['name']),
('state', 'reinstall', ['name']),
('state', 'inject', ['name', 'inject_packages']), ('state', 'inject', ['name', 'inject_packages']),
], ],
supports_check_mode=True, supports_check_mode=True,

View file

@ -24,7 +24,6 @@
community.general.pipx: community.general.pipx:
name: tox name: tox
register: install_tox_again register: install_tox_again
ignore_errors: yes
- name: install application tox again force - name: install application tox again force
community.general.pipx: community.general.pipx:
@ -61,12 +60,24 @@
state: reinstall state: reinstall
register: reinstall_tox_324 register: reinstall_tox_324
- name: reinstall without name
community.general.pipx:
state: reinstall
register: reinstall_noname
ignore_errors: yes
- name: upgrade tox 3.24.0 - name: upgrade tox 3.24.0
community.general.pipx: community.general.pipx:
name: tox name: tox
state: upgrade state: upgrade
register: upgrade_tox_324 register: upgrade_tox_324
- name: upgrade without name
community.general.pipx:
state: upgrade
register: upgrade_noname
ignore_errors: yes
- name: downgrade tox 3.24.0 - name: downgrade tox 3.24.0
community.general.pipx: community.general.pipx:
name: tox name: tox
@ -94,6 +105,8 @@
- downgrade_tox_324.application.tox.version == '3.24.0' - downgrade_tox_324.application.tox.version == '3.24.0'
- uninstall_tox_324 is changed - uninstall_tox_324 is changed
- "'tox' not in uninstall_tox_324.application" - "'tox' not in uninstall_tox_324.application"
- upgrade_noname is failed
- reinstall_noname is failed
############################################################################## ##############################################################################
- name: ensure application ansible-lint is uninstalled - name: ensure application ansible-lint is uninstalled