From 3d79d96a1b68af217d68309675a6cfad685016bd Mon Sep 17 00:00:00 2001 From: Lars Kellogg-Stedman Date: Tue, 21 Jul 2015 11:52:48 -0400 Subject: [PATCH] restore mem_limit mem_limit got lost in the #1744; this restores it. Thanks to @dgromov for the report. --- lib/ansible/modules/cloud/docker/docker.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ansible/modules/cloud/docker/docker.py b/lib/ansible/modules/cloud/docker/docker.py index 30b2d441201..a732a8782b2 100644 --- a/lib/ansible/modules/cloud/docker/docker.py +++ b/lib/ansible/modules/cloud/docker/docker.py @@ -1396,10 +1396,16 @@ class DockerManager(object): return docker.utils.create_host_config(**params) def create_containers(self, count=1): + try: + mem_limit = _human_to_bytes(self.module.params.get('memory_limit')) + except ValueError as e: + self.module.fail_json(msg=str(e)) + params = {'image': self.module.params.get('image'), 'command': self.module.params.get('command'), 'ports': self.exposed_ports, 'volumes': self.volumes, + 'mem_limit': mem_limit, 'environment': self.env, 'hostname': self.module.params.get('hostname'), 'domainname': self.module.params.get('domainname'),