From: Andy McCrae Date: Wed, 21 Mar 2018 15:57:00 +0000 (+0000) Subject: Add support for --diff in config_template X-Git-Tag: v3.1.0beta7~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8e3867516836c2b7e31175d53ed2e89421f653af;p=ceph-ansible.git Add support for --diff in config_template Add support for the Ansible --diff mode in config_template. This will show the before/after for config_template changes, in the same way as the base copy and template modules do. To utilise this run your playbooks with "--diff --check". --- diff --git a/plugins/actions/_v2_config_template.py b/plugins/actions/_v2_config_template.py index 64d57c745..5a8181766 100644 --- a/plugins/actions/_v2_config_template.py +++ b/plugins/actions/_v2_config_template.py @@ -564,8 +564,13 @@ class ActionModule(ActionBase): new_module_args.pop('list_extend', None) # Run the copy module - return self._execute_module( + rc = self._execute_module( module_name='copy', module_args=new_module_args, task_vars=task_vars ) + if self._play_context.diff: + rc['diff'] = [] + rc['diff'].append(self._get_diff_data(_vars['dest'], + transferred_data, task_vars)) + return rc