From 892c045679303715f25e2155c9f2c3706deaea22 Mon Sep 17 00:00:00 2001 From: Mandar Kulkarni Date: Fri, 7 Jun 2024 14:45:58 -0700 Subject: [PATCH] rebase --- plugins/modules/synchronize.py | 1 - .../targets/synchronize/tasks/main.yml | 29 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/plugins/modules/synchronize.py b/plugins/modules/synchronize.py index e651e5c365..819df22b7a 100644 --- a/plugins/modules/synchronize.py +++ b/plugins/modules/synchronize.py @@ -448,7 +448,6 @@ def main(): delay_updates=dict(type='bool', default=True), mode=dict(type='str', default='push', choices=['pull', 'push']), link_dest=dict(type='list', elements='path'), - link_dest=dict(type='list', elements='str'), quiet=dict(type='bool', default=False) ), supports_check_mode=True, diff --git a/tests/integration/targets/synchronize/tasks/main.yml b/tests/integration/targets/synchronize/tasks/main.yml index d6dcdadf74..7ffba18e18 100644 --- a/tests/integration/targets/synchronize/tasks/main.yml +++ b/tests/integration/targets/synchronize/tasks/main.yml @@ -339,6 +339,35 @@ - stat_result_b.stat.exists == True - stat_result_b.stat.checksum == '2aae6c35c94fcfb415dbe95f408b9ce91ee846ed' +- name: synchronize files with quiet option + synchronize: + src: '{{ output_dir }}/foo.txt' + dest: '{{ output_dir }}/foo.result' + quiet: true + register: sync_result + +- assert: + that: + - '''files/directories have been synchronized'' in sync_result.msg' + +- name: Cleanup + file: + state: absent + path: '{{ output_dir }}/{{ item }}' + loop: + - foo.result + - bar.result + +- name: synchronize files without quiet option + synchronize: + src: '{{ output_dir }}/foo.txt' + dest: '{{ output_dir }}/foo.result' + register: sync_result + +- assert: + that: + - '''files/directories have been synchronized'' not in sync_result.msg' + - name: Cleanup ansible.builtin.file: state: absent