Update paths and vars for mautrix-slack to roles/custom

development
Cody Wyatt Neiman 2 years ago
parent d6022d851e
commit 97c45676de
No known key found for this signature in database
GPG Key ID: 94475C8B94E4698D

@ -31,7 +31,7 @@
pgloader_options: ['--with "quote identifiers"'] pgloader_options: ['--with "quote identifiers"']
- ansible.builtin.import_role: - ansible.builtin.import_role:
name: matrix-postgres name: custom/matrix-postgres
tasks_from: migrate_db_to_postgres tasks_from: migrate_db_to_postgres
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
@ -59,8 +59,8 @@
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_slack_docker_image_force_pull }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_slack_docker_image_force_pull }}"
when: not matrix_mautrix_slack_container_image_self_build when: not matrix_mautrix_slack_container_image_self_build
register: result register: result
retries: "{{ matrix_container_retries_count }}" retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ matrix_container_retries_delay }}" delay: "{{ devture_playbook_help_container_retries_delay }}"
until: result is not failed until: result is not failed
- name: Ensure Mautrix slack repository is present on self-build - name: Ensure Mautrix slack repository is present on self-build
@ -105,7 +105,7 @@
- name: Ensure matrix-mautrix-slack.service installed - name: Ensure matrix-mautrix-slack.service installed
ansible.builtin.template: ansible.builtin.template:
src: "{{ role_path }}/templates/systemd/matrix-mautrix-slack.service.j2" src: "{{ role_path }}/templates/systemd/matrix-mautrix-slack.service.j2"
dest: "{{ matrix_systemd_path }}/matrix-mautrix-slack.service" dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-slack.service"
mode: 0644 mode: 0644
register: matrix_mautrix_slack_systemd_service_result register: matrix_mautrix_slack_systemd_service_result

@ -2,7 +2,7 @@
- name: Check existence of matrix-mautrix-slack service - name: Check existence of matrix-mautrix-slack service
ansible.builtin.stat: ansible.builtin.stat:
path: "{{ matrix_systemd_path }}/matrix-mautrix-slack.service" path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-slack.service"
register: matrix_mautrix_slack_service_stat register: matrix_mautrix_slack_service_stat
- name: Ensure matrix-mautrix-slack is stopped - name: Ensure matrix-mautrix-slack is stopped
@ -15,7 +15,7 @@
- name: Ensure matrix-mautrix-slack.service doesn't exist - name: Ensure matrix-mautrix-slack.service doesn't exist
ansible.builtin.file: ansible.builtin.file:
path: "{{ matrix_systemd_path }}/matrix-mautrix-slack.service" path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-slack.service"
state: absent state: absent
when: "matrix_mautrix_slack_service_stat.stat.exists" when: "matrix_mautrix_slack_service_stat.stat.exists"

@ -12,14 +12,14 @@ DefaultDependencies=no
[Service] [Service]
Type=simple Type=simple
Environment="HOME={{ matrix_systemd_unit_home_path }}" Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-mautrix-slack 2>/dev/null || true' ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} kill matrix-mautrix-slack 2>/dev/null || true'
ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-mautrix-slack 2>/dev/null || true' ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mautrix-slack 2>/dev/null || true'
# Intentional delay, so that the homeserver (we likely depend on) can manage to start. # Intentional delay, so that the homeserver (we likely depend on) can manage to start.
ExecStartPre={{ matrix_host_command_sleep }} 5 ExecStartPre={{ matrix_host_command_sleep }} 5
ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-mautrix-slack \ ExecStart={{ devture_systemd_docker_base_host_command_docker }} run --rm --name matrix-mautrix-slack \
--log-driver=none \ --log-driver=none \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \ --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \ --cap-drop=ALL \
@ -33,8 +33,8 @@ ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-mautrix-slack
{{ matrix_mautrix_slack_docker_image }} \ {{ matrix_mautrix_slack_docker_image }} \
/usr/bin/mautrix-slack -c /config/config.yaml -r /config/registration.yaml --no-update /usr/bin/mautrix-slack -c /config/config.yaml -r /config/registration.yaml --no-update
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-mautrix-slack 2>/dev/null || true' ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} kill matrix-mautrix-slack 2>/dev/null || true'
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-mautrix-slack 2>/dev/null || true' ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mautrix-slack 2>/dev/null || true'
Restart=always Restart=always
RestartSec=30 RestartSec=30
SyslogIdentifier=matrix-mautrix-slack SyslogIdentifier=matrix-mautrix-slack

Loading…
Cancel
Save