mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00: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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user