From 1d60d34b8241366ff20d69b8d2538e05a1a1b0d2 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 00000000000..968ddc31036 --- /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 3403ec085ef..f1f480e7e81 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