docker_container: fix idempotency problem with empty published_ports list (#979)

* Distinguish between [] and None.

* Add changelog fragment.

* Fix typo.
This commit is contained in:
Felix Fontein 2020-09-28 20:40:57 +02:00 committed by GitHub
commit 4e1f6683d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View file

@ -2873,6 +2873,18 @@ avoid such warnings, please quote the value.' in log_options_2.warnings"
force_kill: yes
register: published_ports_5
- name: published_ports (no published ports)
docker_container:
image: alpine:3.8
command: '/bin/sh -c "sleep 10m"'
name: "{{ cname }}"
state: started
published_ports: []
comparisons:
published_ports: strict
force_kill: yes
register: published_ports_6
- name: cleanup
docker_container:
name: "{{ cname }}"
@ -2887,6 +2899,7 @@ avoid such warnings, please quote the value.' in log_options_2.warnings"
- published_ports_3 is not changed
- published_ports_4 is changed
- published_ports_5 is changed
- published_ports_6 is changed
####################################################################
## pull ############################################################