diff --git a/changelogs/fragments/53039-docker_swarm-ca_force_rotate.yml b/changelogs/fragments/53039-docker_swarm-ca_force_rotate.yml new file mode 100644 index 0000000000..050be458f5 --- /dev/null +++ b/changelogs/fragments/53039-docker_swarm-ca_force_rotate.yml @@ -0,0 +1,2 @@ +bugfixes: +- "docker_swarm - fixes idempotency for the ``ca_force_rotate`` option." diff --git a/lib/ansible/modules/cloud/docker/docker_swarm.py b/lib/ansible/modules/cloud/docker/docker_swarm.py index 6687aa86bb..12638269cc 100644 --- a/lib/ansible/modules/cloud/docker/docker_swarm.py +++ b/lib/ansible/modules/cloud/docker/docker_swarm.py @@ -297,6 +297,8 @@ class TaskParameters(DockerBaseClass): ca_config = spec.get('CAConfig') or dict() if self.node_cert_expiry is None: self.node_cert_expiry = ca_config.get('NodeCertExpiry') + if self.ca_force_rotate is None: + self.ca_force_rotate = ca_config.get('ForceRotate') dispatcher = spec.get('Dispatcher') or dict() if self.dispatcher_heartbeat_period is None: