From 711dfc3ff6bbfb5dc6874b798883028d15d1dba8 Mon Sep 17 00:00:00 2001 From: s3lph Date: Wed, 8 Feb 2023 01:40:16 +0100 Subject: [PATCH] feat(config): implement diff mode support --- plugins/modules/config.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/modules/config.py b/plugins/modules/config.py index 4304c4f..9b9bbf9 100644 --- a/plugins/modules/config.py +++ b/plugins/modules/config.py @@ -128,9 +128,9 @@ def iter_system(module, result, tree=None, value=None): result['changed'] = True stjoined = ' => '.join(subtree) if old_value is not None: - result['diff'][0]['before'] += 'system => {} => {}'.format(app, stjoined, old_value) + result['diff'][0]['before'] += 'system => {} => {}\n'.format(app, stjoined, old_value) if v is not None: - result['diff'][0]['after'] += 'system => {} => {}'.format(app, stjoined, v) + result['diff'][0]['after'] += 'system => {} => {}\n'.format(app, stjoined, v) if not module.check_mode: # Remove key if the new value is none @@ -226,9 +226,9 @@ def run_module(): continue result['changed'] = True if old_value is not None: - result['diff'][0]['before'] += 'apps => {} => {} => {}'.format(app, k, old_value) + result['diff'][0]['before'] += 'apps => {} => {} => {}\n'.format(app, k, old_value) if v is not None: - result['diff'][0]['after'] += 'apps => {} => {} => {}'.format(app, k, v) + result['diff'][0]['after'] += 'apps => {} => {} => {}\n'.format(app, k, v) if not module.check_mode: # Delete key if value is None