From 46000d4e05b6b7fc133114e8100da6fc64afb70e Mon Sep 17 00:00:00 2001 From: Maksim Malchuk Date: Sun, 2 Apr 2023 00:39:02 +0300 Subject: [PATCH] Fix merge action plugins verbose output This change fixes the output 'module_args' information of the plugins 'merge_configs' and 'merge_yaml' when Ansible is executed in maximum verbose mode. Now all the plugin options are displayed instead of standard 'copy' plugin options only. Change-Id: Ie2d9a0501fe29bfd854eb31258f282b197855948 Signed-off-by: Maksim Malchuk --- kayobe/plugins/action/merge_configs.py | 10 +++++++--- kayobe/plugins/action/merge_yaml.py | 6 +++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/kayobe/plugins/action/merge_configs.py b/kayobe/plugins/action/merge_configs.py index ce45bf763..3aff18d53 100644 --- a/kayobe/plugins/action/merge_configs.py +++ b/kayobe/plugins/action/merge_configs.py @@ -175,12 +175,12 @@ class ActionModule(action.ActionBase): del tmp # not used sources = self._task.args.get('sources', None) + whitespace = self._task.args.get('whitespace', True) if not isinstance(sources, list): sources = [sources] - config = OverrideConfigParser( - whitespace=self._task.args.get('whitespace', True)) + config = OverrideConfigParser(whitespace=whitespace) for source in sources: self.read_config(source, config) @@ -217,7 +217,11 @@ class ActionModule(action.ActionBase): loader=self._loader, templar=self._templar, shared_loader_obj=self._shared_loader_obj) - result.update(copy_action.run(task_vars=task_vars)) + copy_result = copy_action.run(task_vars=task_vars) + copy_result['invocation']['module_args'].update({ + 'src': result_file, 'sources': sources, + 'whitespace': whitespace}) + result.update(copy_result) finally: shutil.rmtree(local_tempdir) return result diff --git a/kayobe/plugins/action/merge_yaml.py b/kayobe/plugins/action/merge_yaml.py index 943ca0158..0655478c5 100644 --- a/kayobe/plugins/action/merge_yaml.py +++ b/kayobe/plugins/action/merge_yaml.py @@ -150,7 +150,11 @@ class ActionModule(action.ActionBase): loader=self._loader, templar=self._templar, shared_loader_obj=self._shared_loader_obj) - result.update(copy_action.run(task_vars=task_vars)) + copy_result = copy_action.run(task_vars=task_vars) + copy_result['invocation']['module_args'].update({ + 'src': result_file, 'sources': sources, + 'extend_lists': extend_lists}) + result.update(copy_result) finally: shutil.rmtree(local_tempdir) return result