diff options
| author | Will Szumski <will@stackhpc.com> | 2024-02-23 17:06:51 +0000 |
|---|---|---|
| committer | Will Szumski <will@stackhpc.com> | 2024-02-27 17:10:30 +0000 |
| commit | 9b3428c5046ec5032585bd6ea9baa50da3d82a4b (patch) | |
| tree | 6375dbf9d1334608aaff526c60f5929d0cfccbc5 /ansible/module_utils | |
| parent | ce3a6aff09f1880d77bdd70d9f029b0780d93dd9 (diff) | |
| download | kolla-ansible-9b3428c5046ec5032585bd6ea9baa50da3d82a4b.tar.gz kolla-ansible-9b3428c5046ec5032585bd6ea9baa50da3d82a4b.zip | |
Support mode in named volumes when using podman
Volumes with a mode specifier were causing the container to fail to
start with the error: "Wrong format of volume". ironic-dnsmasq was one
services affected by this issue, but you could also hit this issue when
using the volume customisation variables.
Closes-Bug: #2054834
Change-Id: I848bd2838a17756f1c71b07befe1e3d966f5b6c2
Diffstat (limited to 'ansible/module_utils')
| -rw-r--r-- | ansible/module_utils/kolla_podman_worker.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ansible/module_utils/kolla_podman_worker.py b/ansible/module_utils/kolla_podman_worker.py index dd215174e..e0aee7bd5 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): |
