1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge branch 'fixes/docker-volumes' of https://github.com/devpopol/ansible into devpopol-fixes/docker-volumes

This commit is contained in:
James Cammarata 2014-08-08 12:24:21 -05:00
commit f5021f7289

View file

@ -358,6 +358,13 @@ class DockerManager:
if len(parts) == 2: if len(parts) == 2:
self.volumes[parts[1]] = {} self.volumes[parts[1]] = {}
self.binds[parts[0]] = parts[1] self.binds[parts[0]] = parts[1]
# with bind mode
elif len(parts) == 3:
if parts[2] not in ['ro', 'rw']:
self.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) # docker mount (e.g. /www, mounts a docker volume /www on the container at the same location)
else: else:
self.volumes[parts[0]] = {} self.volumes[parts[0]] = {}