Fix ordering for --diff mode setup
Due to the ordering of the vars passed to the _get_diff_data mode, --diff mode would only work with --check activated, otherwise the file used didn't exist and you would get an error similar to: https://github.com/ceph/ceph-ansible/issues/2742 This PR allows this to work by configuring the diff data before running the copy module, so the file exists. Additionally, we should run with --diff mode enabled by default on tests for this repository to ensure any functional issues with diff mode are caught. Change-Id: I020a181731c3ee87f04933f8c62213ea12cfa3a4
This commit is contained in:
parent
a5c9d97e18
commit
4d93182786
@ -672,6 +672,9 @@ class ActionModule(ActionBase):
|
||||
# Content from config_template is converted to src
|
||||
new_module_args.pop('content', None)
|
||||
|
||||
# Set the diff data before running the copy module
|
||||
_diff = self._get_diff_data(_vars['dest'], transferred_data, task_vars)
|
||||
|
||||
# Run the copy module
|
||||
rc = self._execute_module(
|
||||
module_name='copy',
|
||||
@ -680,8 +683,7 @@ class ActionModule(ActionBase):
|
||||
)
|
||||
if self._play_context.diff:
|
||||
rc['diff'] = []
|
||||
rc['diff'].append(self._get_diff_data(_vars['dest'],
|
||||
transferred_data, task_vars))
|
||||
rc['diff'].append(_diff)
|
||||
if self._task.args.get('content'):
|
||||
os.remove(_vars['source'])
|
||||
return rc
|
||||
|
Loading…
x
Reference in New Issue
Block a user