From 19f35bae917f0a012bbfc89b1c4f246d0793de19 Mon Sep 17 00:00:00 2001 From: Minh Ha Date: Mon, 20 Jul 2020 12:14:16 -0400 Subject: [PATCH] removes advertise_addr from required parameters when state is "join" (#646) * removes advertise_addr from required parameters when state is "join" addressing this issue: https://github.com/ansible-collections/community.general/issues/439 * adjusts test * adds changelog --- plugins/modules/docker_swarm.py | 2 +- tests/integration/targets/docker_swarm/tasks/tests/basic.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/modules/docker_swarm.py b/plugins/modules/docker_swarm.py index 9d3888e8..738d911d 100644 --- a/plugins/modules/docker_swarm.py +++ b/plugins/modules/docker_swarm.py @@ -627,7 +627,7 @@ def main(): ) required_if = [ - ('state', 'join', ['advertise_addr', 'remote_addrs', 'join_token']), + ('state', 'join', ['remote_addrs', 'join_token']), ('state', 'remove', ['node_id']) ] diff --git a/tests/integration/targets/docker_swarm/tasks/tests/basic.yml b/tests/integration/targets/docker_swarm/tasks/tests/basic.yml index d19532d4..4e9005fc 100644 --- a/tests/integration/targets/docker_swarm/tasks/tests/basic.yml +++ b/tests/integration/targets/docker_swarm/tasks/tests/basic.yml @@ -10,11 +10,11 @@ ignore_errors: yes register: output -- name: assert failure when called with state=join and no advertise_addr,remote_addrs,join_token +- name: assert failure when called with state=join and no remote_addrs,join_token assert: that: - 'output.failed' - - 'output.msg == "state is join but all of the following are missing: advertise_addr, remote_addrs, join_token"' + - 'output.msg == "state is join but all of the following are missing: remote_addrs, join_token"' - name: Test parameters with state=remove docker_swarm: