Fix advertise addr (#47608)

* Fix issue #46326

* Update example to create a default swarm
This commit is contained in:
Thierry Bouvet 2018-11-01 09:10:03 +01:00 committed by John R Barker
parent 65768b996d
commit 87de2dde9f
2 changed files with 0 additions and 17 deletions

View file

@ -151,7 +151,6 @@ EXAMPLES = '''
- name: Init a new swarm with default parameters
docker_swarm:
state: present
advertise_addr: 192.168.1.1
- name: Update swarm configuration
docker_swarm:
@ -330,9 +329,6 @@ class SwarmManager(DockerBaseClass):
return
try:
if self.parameters.advertise_addr is None:
self.client.fail(msg="advertise_addr is required to initialize a swarm cluster.")
self.client.init_swarm(
advertise_addr=self.parameters.advertise_addr, listen_addr=self.parameters.listen_addr,
force_new_cluster=self.parameters.force_new_cluster, swarm_spec=self.parameters.spec)

View file

@ -3,18 +3,6 @@
state: absent
force: true
- name: Test parameters with state=present
docker_swarm:
state: present
ignore_errors: yes
register: output
- name: assert failure when called with state=init and no advertise_addr
assert:
that:
- 'output.failed'
- 'output.msg == "advertise_addr is required to initialize a swarm cluster."'
- name: Test parameters with state=join
docker_swarm:
state: join
@ -42,7 +30,6 @@
- name: Create a Swarm cluster
docker_swarm:
state: present
advertise_addr: "{{ansible_default_ipv4.address}}"
register: output
- name: assert changed when create a new swarm cluster