--- # tasks file for jotbe.cryptpad-docker - name: Ensure Docker Compose project directory exists file: path: "{{ cryptpad_install_path }}/cryptpad" state: directory owner: '{{ cryptpad_install_user }}' group: '{{ cryptpad_install_user }}' - name: Provide docker-compose.yml template: src: templates/docker-compose.cryptpad.yml.j2 dest: "{{ cryptpad_install_path }}/cryptpad/docker-compose.yml" owner: "{{ cryptpad_install_user }}" group: "{{ cryptpad_install_user }}" mode: '0644' - name: Output docker-compose.yml shell: cat {{ cryptpad_install_path }}/cryptpad/docker-compose.yml register: output - debug: var: output - name: Provide env vars copy: dest: "{{ cryptpad_install_path }}/cryptpad/.env" owner: "{{ cryptpad_install_user }}" group: "{{ cryptpad_install_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: "{{ cryptpad_install_path }}/cryptpad/data/config" state: directory owner: '{{ cryptpad_install_user }}' group: '{{ cryptpad_install_user }}' - name: Provide cryptpad config template: src: templates/config.js.j2 dest: "{{ cryptpad_install_path }}/cryptpad/data/config/config.js" owner: "{{ cryptpad_install_user }}" group: "{{ cryptpad_install_user }}" mode: '0644' - name: "docker-compose: Teardown existing cryptpad service" docker_compose: project_src: "{{ cryptpad_install_path }}/cryptpad/" state: absent tags: ['never', 'teardown'] - name: "docker-compose: Start cryptpad service" docker_compose: project_src: "{{ cryptpad_install_path }}/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" when: not ansible_check_mode become: false uri: url: "{{ cryptpad_http_unsafe_origin_url }}" return_content: yes timeout: 300 validate_certs: no register: url_check delegate_to: localhost until: "'CryptPad: Zero Knowledge' in url_check.content" retries: 5 delay: 10 tags: health