container: add copypath mounts for copying whole directories to mount in container
This commit is contained in:
@@ -35,6 +35,19 @@
|
||||
when: item.template is defined
|
||||
loop: "{{ docker_mounts }}"
|
||||
|
||||
- name: Copy docker copypath mounts for {{ docker_service_name }}
|
||||
copy:
|
||||
src: "files/{{ item.copypath }}"
|
||||
dest: "{{ docker_mounts_dir }}/"
|
||||
when: item.copypath is defined
|
||||
loop: "{{ docker_mounts }}"
|
||||
notify: Restart container {{ docker_service_name }}
|
||||
- name: Set docker_volume_definition for copypath mounts
|
||||
set_fact:
|
||||
docker_volume_definition: "{{ docker_volume_definition + [{'source': docker_mounts_dir + '/' + item.copypath, 'target': item.path, 'type': 'bind', 'read_only': true}] }}"
|
||||
when: item.copypath is defined
|
||||
loop: "{{ docker_mounts }}"
|
||||
|
||||
- name: Set docker_volume_definition for named volumes
|
||||
set_fact:
|
||||
docker_volume_definition: "{{ docker_volume_definition + [{'source': docker_service_name + '_' + item.name, 'target': item.path, 'type': 'volume'}] }}"
|
||||
|
||||
Reference in New Issue
Block a user