mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[make] Provide built command in the module output (#6160)
It may happen operator wants to get the built command instead of all the parameters. This change injects a new entry in the dict output, showing what command way actually launched. This patch also takes the opportunity to add missing dots to some documentation lines.
This commit is contained in:
parent
3862de3f15
commit
a49ad340af
2 changed files with 13 additions and 3 deletions
2
changelogs/fragments/6160-add-command-make-output.yml
Normal file
2
changelogs/fragments/6160-add-command-make-output.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- make - add ``command`` return value to the module output (https://github.com/ansible-collections/community.general/pull/6160).
|
|
@ -89,6 +89,12 @@ chdir:
|
|||
- The value of the module parameter I(chdir).
|
||||
type: str
|
||||
returned: success
|
||||
command:
|
||||
description:
|
||||
- The command built and executed by the module.
|
||||
type: str
|
||||
returned: success
|
||||
version_added: 6.5.0
|
||||
file:
|
||||
description:
|
||||
- The value of the module parameter I(file).
|
||||
|
@ -96,22 +102,23 @@ file:
|
|||
returned: success
|
||||
jobs:
|
||||
description:
|
||||
- The value of the module parameter I(jobs)
|
||||
- The value of the module parameter I(jobs).
|
||||
type: int
|
||||
returned: success
|
||||
params:
|
||||
description:
|
||||
- The value of the module parameter I(params)
|
||||
- The value of the module parameter I(params).
|
||||
type: dict
|
||||
returned: success
|
||||
target:
|
||||
description:
|
||||
- The value of the module parameter I(target)
|
||||
- The value of the module parameter I(target).
|
||||
type: str
|
||||
returned: success
|
||||
'''
|
||||
|
||||
from ansible.module_utils.six import iteritems
|
||||
from ansible.module_utils.six.moves import shlex_quote
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
|
@ -218,6 +225,7 @@ def main():
|
|||
chdir=module.params['chdir'],
|
||||
file=module.params['file'],
|
||||
jobs=module.params['jobs'],
|
||||
command=' '.join([shlex_quote(part) for part in base_command]),
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue