Merge "Allow bind mount of types other than directory"
This commit is contained in:
commit
1cf102dca5
@ -42,6 +42,8 @@
|
|||||||
with_items:
|
with_items:
|
||||||
- "{{ lxc_default_bind_mounts | default([]) }}"
|
- "{{ lxc_default_bind_mounts | default([]) }}"
|
||||||
- "{{ list_of_bind_mounts | default([]) }}"
|
- "{{ list_of_bind_mounts | default([]) }}"
|
||||||
|
when:
|
||||||
|
- item.create | default('dir') == 'dir'
|
||||||
delegate_to: "{{ physical_host }}"
|
delegate_to: "{{ physical_host }}"
|
||||||
tags:
|
tags:
|
||||||
- common-lxc
|
- common-lxc
|
||||||
@ -49,7 +51,7 @@
|
|||||||
- name: Add bind mount configuration to container
|
- name: Add bind mount configuration to container
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: "/var/lib/lxc/{{ inventory_hostname }}/config"
|
dest: "/var/lib/lxc/{{ inventory_hostname }}/config"
|
||||||
line: "lxc.mount.entry = {{ item['mount_path'] }} {{ item['bind_dir_path'].lstrip('/') }} none bind,create=dir 0 0"
|
line: "lxc.mount.entry = {{ item['mount_path'] }} {{ item['bind_dir_path'].lstrip('/') }} none bind,create={{ item.create | default('dir') }} 0 0"
|
||||||
insertbefore: "^lxc.mount.entry = .*\\s{{ item['bind_dir_path'].lstrip('/') | regex_replace('/', '\/') }}.*"
|
insertbefore: "^lxc.mount.entry = .*\\s{{ item['bind_dir_path'].lstrip('/') | regex_replace('/', '\/') }}.*"
|
||||||
backup: "true"
|
backup: "true"
|
||||||
with_items:
|
with_items:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user