Initial commit
This commit is contained in:
commit
9ec34e7661
12 changed files with 603 additions and 0 deletions
79
tasks/main.yml
Normal file
79
tasks/main.yml
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
---
|
||||
# tasks file for jotbe.cryptpad-docker
|
||||
- name: Ensure Docker Compose project directory exists
|
||||
file:
|
||||
path: /home/{{ docker_user }}/cryptpad
|
||||
state: directory
|
||||
owner: '{{ docker_user }}'
|
||||
group: '{{ docker_user }}'
|
||||
|
||||
- name: Provide docker-compose.yml
|
||||
template:
|
||||
src: templates/docker-compose.cryptpad.yml.j2
|
||||
dest: /home/{{ docker_user }}/cryptpad/docker-compose.yml
|
||||
owner: "{{ docker_user }}"
|
||||
group: "{{ docker_user }}"
|
||||
mode: '0644'
|
||||
|
||||
- name: Output docker-compose.yml
|
||||
shell: cat /home/{{ docker_user }}/cryptpad/docker-compose.yml
|
||||
register: output
|
||||
|
||||
- debug:
|
||||
var: output
|
||||
|
||||
- name: Provide env vars
|
||||
copy:
|
||||
dest: /home/{{ docker_user }}/cryptpad/.env
|
||||
owner: "{{ docker_user }}"
|
||||
group: "{{ docker_user }}"
|
||||
mode: '0640'
|
||||
content: |
|
||||
VERSION=version-3.15.0
|
||||
USE_SSL=false
|
||||
STORAGE='./storage/file'
|
||||
LOG_TO_STDOUT=true
|
||||
|
||||
- name: Ensure cryptpad config directory exists
|
||||
file:
|
||||
path: /home/{{ docker_user }}/cryptpad/data/config
|
||||
state: directory
|
||||
owner: '{{ docker_user }}'
|
||||
group: '{{ docker_user }}'
|
||||
|
||||
- name: Provide cryptpad config
|
||||
template:
|
||||
src: templates/config.js.j2
|
||||
dest: /home/{{ docker_user }}/cryptpad/data/config/config.js
|
||||
owner: "{{ docker_user }}"
|
||||
group: "{{ docker_user }}"
|
||||
mode: '0644'
|
||||
|
||||
- name: "docker-compose: Teardown existing cryptpad service"
|
||||
docker_compose:
|
||||
project_src: "/home/{{ docker_user }}/cryptpad/"
|
||||
state: absent
|
||||
tags: ['never', 'teardown']
|
||||
|
||||
- name: "docker-compose: Start cryptpad service"
|
||||
docker_compose:
|
||||
project_src: "/home/{{ docker_user }}/cryptpad/"
|
||||
pull: yes
|
||||
register: output
|
||||
tags: service_start
|
||||
|
||||
- debug:
|
||||
var: output
|
||||
|
||||
# - assert:
|
||||
# that:
|
||||
# - "output.ansible_facts['cryptpad-app']['cryptpad-app'].state.running"
|
||||
|
||||
- name: "Test whether cryptpad is healthy from the outside"
|
||||
become: false
|
||||
uri:
|
||||
url: "{{ cryptpad_http_unsafe_origin_url }}"
|
||||
timeout: 300
|
||||
validate_certs: no
|
||||
delegate_to: localhost
|
||||
tags: health
|
||||
Loading…
Add table
Add a link
Reference in a new issue