--- - name: "๐Ÿงน Clear the bootstrap marker of an earlier play" ansible.builtin.set_fact: DISCOURSE_REBUILT: false - name: โฌ‡๏ธ Pull Discourse docker repository git: repo: "{{ DISCOURSE_REPOSITORY_URL }}" dest: "{{ DISCOURSE_REPOSITORY_DIR }}" version: "{{ DISCOURSE_REF }}" update: true depth: 1 register: discourse_repo_pull retries: 12 delay: 30 until: discourse_repo_pull is succeeded notify: rebuild-discourse become: true - name: ๐Ÿ”ง set chmod 700 for '{{ DISCOURSE_CONTAINERS_DIR }}' ansible.builtin.file: path: "{{ DISCOURSE_CONTAINERS_DIR }}" mode: "700" state: directory - name: "๐Ÿ“‹ copy configuration to '{{ DISCOURSE_APPLICATION_YML_DEST }}'" stack_host_template: src: config.yml.j2 dest: "{{ DISCOURSE_APPLICATION_YML_DEST }}" mode: "0640" notify: recreate-discourse - name: "๐Ÿ”‘ Record the digest of everything the bootstrap consumes" stack_host_copy: content: "{{ lookup('template', 'config.yml.j2') | from_yaml | dict2items | rejectattr('key', 'eq', 'env') | items2dict | to_json | hash('sha256') }}" dest: "{{ DISCOURSE_BOOTSTRAP_DIGEST_DEST }}" mode: "0640" notify: rebuild-discourse - name: "โœ… Verify that '{{ DISCOURSE_CONTAINER }}' is running" ansible.builtin.command: argv: - container - ps - --filter - "name=^{{ DISCOURSE_CONTAINER }}$" - --filter - status=running - --format - "{{ '{{.Names}}' }}" register: docker_ps changed_when: docker_ps.stdout.strip() == "" failed_when: docker_ps.rc != 0 notify: rebuild-discourse - name: ๐Ÿ“‚ Load discourse handlers explicitly include_tasks: utils/load/handlers.yml vars: handler_role_name: "web-app-discourse" - name: ๐Ÿšฟ flush, to recreate discourse app meta: flush_handlers