From 74e922449b457b39bf23ac38316e03c21bd96e2c Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Tue, 3 Mar 2015 23:32:15 -0600 Subject: [PATCH 1/2] 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 --- cloud/docker/docker.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cloud/docker/docker.py b/cloud/docker/docker.py index da4fbc123fb..f79f5a2d5d4 100644 --- a/cloud/docker/docker.py +++ b/cloud/docker/docker.py @@ -209,6 +209,13 @@ options: default: false aliases: [] 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: - The remote registry URL to use for pulling images. @@ -790,6 +797,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 = {} @@ -872,6 +880,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'), ) ) From e1e74bdf335904a5e94812db85eb41b279cfc884 Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Fri, 6 Mar 2015 03:13:32 -0600 Subject: [PATCH 2/2] Updated version and fixed default --- cloud/docker/docker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/docker/docker.py b/cloud/docker/docker.py index f79f5a2d5d4..ef71df017ab 100644 --- a/cloud/docker/docker.py +++ b/cloud/docker/docker.py @@ -213,9 +213,9 @@ options: 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 + default: None aliases: [] - version_added: "1.8" + version_added: "1.9" registry: description: - The remote registry URL to use for pulling images.