diff --git a/ansible/module_utils/kolla_podman_worker.py b/ansible/module_utils/kolla_podman_worker.py index dd215174e9..e0aee7bd52 100644 --- a/ansible/module_utils/kolla_podman_worker.py +++ b/ansible/module_utils/kolla_podman_worker.py @@ -176,7 +176,11 @@ class PodmanWorker(ContainerWorker): mounts.append(mount_item) else: try: - src, dest = item.split(':') + mode = 'rw' + if item.count(':') == 2: + src, dest, mode = item.split(':') + else: + src, dest = item.split(':') except ValueError: self.module.fail_json( msg="Wrong format of volume: {}".format(item), @@ -191,7 +195,7 @@ class PodmanWorker(ContainerWorker): else: filtered_volumes[src] = dict( bind=dest, - mode='rw' + mode=mode ) def parse_dimensions(self, dimensions): diff --git a/releasenotes/notes/fixes-podman-named-volume-issues-when-using-mode-36b9862321eb9e68.yaml b/releasenotes/notes/fixes-podman-named-volume-issues-when-using-mode-36b9862321eb9e68.yaml new file mode 100644 index 0000000000..06821859ee --- /dev/null +++ b/releasenotes/notes/fixes-podman-named-volume-issues-when-using-mode-36b9862321eb9e68.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes an issue, when using podman, with named volumes that use a mode + specifier. See `LP#2054834 + `_ for more details.