Skip to content

Commit

Permalink
docker_container: fix container creation with networks_cli_compatible…
Browse files Browse the repository at this point in the history
…=yes (ansible#56687)

* Fix behavior.

* Add changelog.

* Add simple test to prevent ansible#56620.

(cherry picked from commit d8dcd20)
  • Loading branch information
felixfontein committed May 28, 2019
1 parent 5a1985c commit 76d338f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "docker_container - fix network creation when ``networks_cli_compatible`` is enabled."
2 changes: 1 addition & 1 deletion lib/ansible/modules/cloud/docker/docker_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ def create_parameters(self):
if network.get(para):
params[para] = network[para]
network_config = dict()
network_config[network['name']] = self.client.create_endpoint_config(params)
network_config[network['name']] = self.client.create_endpoint_config(**params)
result['networking_config'] = self.client.create_networking_config(network_config)
return result

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@
state: started
networks:
- name: "{{ nname_1 }}"
aliases:
- alias1
- alias2
- name: "{{ nname_2 }}"
networks_cli_compatible: yes
register: networks_1
Expand Down

0 comments on commit 76d338f

Please sign in to comment.