mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 07:01:22 -07:00
Give a module the possibility to known its own name (#16087)
* Give a module the possibility to known its own name This is useful for logging and reporting and fixes the longstanding problem with syslog-messages: May 30 15:50:11 moria ansible-<stdin>: Invoked with ... now becomes: Jun 1 17:32:03 moria ansible-copy: Invoked with ... This fixes #15830 * Rename the internal name from module.ansible_module_name to module._name
This commit is contained in:
parent
a529a60478
commit
04ce71b4bd
2 changed files with 12 additions and 5 deletions
|
@ -574,6 +574,9 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
|||
# give the module information about the ansible version
|
||||
module_args['_ansible_version'] = __version__
|
||||
|
||||
# give the module information about its name
|
||||
module_args['_ansible_module_name'] = module_name
|
||||
|
||||
# set the syslog facility to be used in the module
|
||||
module_args['_ansible_syslog_facility'] = task_vars.get('ansible_syslog_facility', C.DEFAULT_SYSLOG_FACILITY)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue