diff --git a/changelogs/fragments/71343_yum_repository.yml b/changelogs/fragments/71343_yum_repository.yml new file mode 100644 index 00000000000..459cf2d5722 --- /dev/null +++ b/changelogs/fragments/71343_yum_repository.yml @@ -0,0 +1,2 @@ +bugfixes: +- basic - skip over module parameters which are used in ``journal.send`` API call (https://github.com/ansible/ansible/issues/71343). diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 84d6081e5cf..a3948833f6e 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -1338,7 +1338,16 @@ class AnsibleModule(object): if has_journal: journal_args = [("MODULE", os.path.basename(__file__))] for arg in log_args: - journal_args.append((arg.upper(), str(log_args[arg]))) + name, value = (arg.upper(), str(log_args[arg])) + if name in ( + 'PRIORITY', 'MESSAGE', 'MESSAGE_ID', + 'CODE_FILE', 'CODE_LINE', 'CODE_FUNC', + 'SYSLOG_FACILITY', 'SYSLOG_IDENTIFIER', + 'SYSLOG_PID', + ): + name = "_%s" % name + journal_args.append((name, value)) + try: if HAS_SYSLOG: # If syslog_facility specified, it needs to convert