From 24f1cf80bda26e157d55a3fc1c95717acf69c207 Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Tue, 3 Mar 2015 23:32:15 -0600 Subject: [PATCH] Add pid mode support to docker module This allows setting the pid namespace for a container. Currently only the 'host' pid namespace is supported. This requires Docker 1.4.1 and docker-py 1.0.0 --- lib/ansible/modules/cloud/docker/docker.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/ansible/modules/cloud/docker/docker.py b/lib/ansible/modules/cloud/docker/docker.py index 4a4078b52e..007018e45b 100644 --- a/lib/ansible/modules/cloud/docker/docker.py +++ b/lib/ansible/modules/cloud/docker/docker.py @@ -201,6 +201,13 @@ options: - or host. Requires docker >= 0.11. default: false version_added: "1.8" + pid: + description: + - Set the PID namespace mode for the container (currently only supports 'host'). Requires docker-py >= 1.0.0 and docker >= 1.4.1. + required: false + default: false + aliases: [] + version_added: "1.8" registry: description: - Remote registry URL to pull images from. @@ -1149,6 +1156,7 @@ class DockerManager(object): 'privileged': self.module.params.get('privileged'), 'links': self.links, 'network_mode': self.module.params.get('net'), + 'pid_mode': self.module.params.get('pid'), } optionals = {} @@ -1358,6 +1366,7 @@ def main(): lxc_conf = dict(default=None, type='list'), name = dict(default=None), net = dict(default=None), + pid = dict(default=None), insecure_registry = dict(default=False, type='bool'), ) )