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

[PR #6160/a49ad340 backport][stable-6] [make] Provide built command in the module output (#6186)

[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.

(cherry picked from commit a49ad340af)

Co-authored-by: Cédric Jeanneret <39397510+cjeanner@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2023-03-14 21:03:54 +01:00 committed by GitHub
parent e9bc32528e
commit 94efecaf67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View 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).

View file

@ -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]),
)