From 8ef994fbc5e0c5f996fbb5d95a9ce7c1d8658490 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 23 Oct 2018 08:48:09 +0200 Subject: [PATCH] Fix option change detection / force support for docker_volume. (#47390) --- changelogs/fragments/docker_volume-force-change-detection.yaml | 2 ++ lib/ansible/modules/cloud/docker/docker_volume.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/docker_volume-force-change-detection.yaml diff --git a/changelogs/fragments/docker_volume-force-change-detection.yaml b/changelogs/fragments/docker_volume-force-change-detection.yaml new file mode 100644 index 0000000000..968ddc3103 --- /dev/null +++ b/changelogs/fragments/docker_volume-force-change-detection.yaml @@ -0,0 +1,2 @@ +bugfixes: +- "docker_volume - fix ``force`` and change detection logic. If not both evaluated to ``True``, the volume was not recreated." diff --git a/lib/ansible/modules/cloud/docker/docker_volume.py b/lib/ansible/modules/cloud/docker/docker_volume.py index 3403ec085e..f1f480e7e8 100644 --- a/lib/ansible/modules/cloud/docker/docker_volume.py +++ b/lib/ansible/modules/cloud/docker/docker_volume.py @@ -223,7 +223,7 @@ class DockerVolumeManager(object): if self.existing_volume: differences = self.has_different_config() - if differences and self.parameters.force: + if differences or self.parameters.force: self.remove_volume() self.existing_volume = None