From d1da454da6b69c2fec891ef855d26f9a1be1d444 Mon Sep 17 00:00:00 2001 From: Stephen Paul Suarez Date: Tue, 27 May 2014 11:20:15 +0800 Subject: [PATCH] support rw bind mode in docker module --- library/cloud/docker | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/library/cloud/docker b/library/cloud/docker index 509e5eb9559..d6abe69ff3e 100644 --- a/library/cloud/docker +++ b/library/cloud/docker @@ -358,6 +358,13 @@ class DockerManager: if len(parts) == 2: self.volumes[parts[1]] = {} self.binds[parts[0]] = parts[1] + # with bind mode + elif len(parts) == 3: + if parts[2] not in ['ro', 'rw']: + module.fail_json(msg='bind mode needs to either be "ro" or "rw"') + ro = parts[2] == 'ro' + self.volumes[parts[1]] = {} + self.binds[parts[0]] = {'bind': parts[1], 'ro': ro} # docker mount (e.g. /www, mounts a docker volume /www on the container at the same location) else: self.volumes[parts[0]] = {}