40 lines
1.3 KiB
YAML
40 lines
1.3 KiB
YAML
- name: docker directory
|
|
file:
|
|
path: /opt/{{ docker_etherpad_service_id }}/
|
|
state: directory
|
|
|
|
- name: plugins directory
|
|
file:
|
|
path: "{{ docker_etherpad_data_dir }}/{{ docker_etherpad_service_id }}/{{ item }}"
|
|
owner: "{{ docker_etherpad_data_owner | default(omit) }}"
|
|
group: "{{ docker_etherpad_data_group | default(omit) }}"
|
|
state: directory
|
|
with_items:
|
|
- plugin_packages
|
|
- var
|
|
|
|
- name: settings.json exists
|
|
stat:
|
|
path: "{{ docker_etherpad_data_dir }}/{{ docker_etherpad_service_id }}/settings.json"
|
|
register: _settings
|
|
|
|
- name: prepare settings.json
|
|
shell: |
|
|
docker create --name temporary_etherpad {{ docker_etherpad_version }}
|
|
docker cp temporary_etherpad:/opt/etherpad-lite/settings.json {{ docker_etherpad_data_dir }}/{{ docker_etherpad_service_id }}/settings.json
|
|
docker rm temporary_etherpad
|
|
when: not _settings.stat.exists
|
|
|
|
- name: owner of settings.json
|
|
file:
|
|
path: "{{ docker_etherpad_data_dir }}/{{ docker_etherpad_service_id }}/settings.json"
|
|
owner: "{{ docker_etherpad_data_owner | default(omit) }}"
|
|
group: "{{ docker_etherpad_data_group | default(omit) }}"
|
|
|
|
- name: prepare docker-compose.yml
|
|
template:
|
|
src: "{{ item }}"
|
|
dest: /opt/{{ docker_etherpad_service_id }}/
|
|
with_items:
|
|
- docker-compose.yml
|
|
notify: docker-compose-up
|