mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-06 22:24:23 -07:00
[PR #9180/a9449ccc backport][stable-10] pipx/pipx_info: add return value version (#9183)
pipx/pipx_info: add return value version (#9180)
* pipx/pipx_info: add return value version
* add changelog frag
(cherry picked from commit a9449ccc2e
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
0b64fc1ee4
commit
74cd18b682
5 changed files with 46 additions and 18 deletions
|
@ -190,6 +190,15 @@ EXAMPLES = """
|
|||
with_items: "{{ pipx_packages }}"
|
||||
"""
|
||||
|
||||
RETURN = """
|
||||
version:
|
||||
description: Version of pipx.
|
||||
type: str
|
||||
returned: always
|
||||
sample: "1.7.1"
|
||||
version_added: 10.1.0
|
||||
"""
|
||||
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.module_helper import StateModuleHelper
|
||||
from ansible_collections.community.general.plugins.module_utils.pipx import pipx_runner, pipx_common_argspec, make_process_list
|
||||
|
@ -272,6 +281,10 @@ class PipX(StateModuleHelper):
|
|||
|
||||
self.vars.set('application', self._retrieve_installed(), change=True, diff=True)
|
||||
|
||||
with self.runner("version") as ctx:
|
||||
rc, out, err = ctx.run()
|
||||
self.vars.version = out.strip()
|
||||
|
||||
def __quit_module__(self):
|
||||
self.vars.application = self._retrieve_installed()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue