From 9630972c2c730670f5cc73ecdb06522a263ad60a Mon Sep 17 00:00:00 2001 From: Ryan Walls Date: Mon, 1 Jun 2015 09:48:24 -0600 Subject: [PATCH] Update docker module to avoid false positives when containers are first created. Also have the module check for api compatibility before trying to set a "--log-driver" option. --- lib/ansible/modules/cloud/docker/docker.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/ansible/modules/cloud/docker/docker.py b/lib/ansible/modules/cloud/docker/docker.py index c5a187046db..8495ba7433c 100644 --- a/lib/ansible/modules/cloud/docker/docker.py +++ b/lib/ansible/modules/cloud/docker/docker.py @@ -1138,12 +1138,13 @@ class DockerManager(object): # LOG_DRIVER - expected_log_driver = set(self.module.params.get('log_driver') or []) - actual_log_driver = set(container['HostConfig']['LogConfig']['Type'] or []) - if actual_log_driver != expected_log_driver: - self.reload_reasons.append('log_driver ({0} => {1})'.format(actual_log_driver, expected_log_driver)) - differing.append(container) - continue + if self.ensure_capability('log_driver', false) : + expected_log_driver = self.module.params.get('log_driver') or 'json-file' + actual_log_driver = container['HostConfig']['LogConfig']['Type'] + if actual_log_driver != expected_log_driver: + self.reload_reasons.append('log_driver ({0} => {1})'.format(actual_log_driver, expected_log_driver)) + differing.append(container) + continue return differing