From 9a8ebf3d8c5e96d9703abb7b681e5852196eebbe Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sat, 25 Feb 2023 13:01:11 +0200 Subject: [PATCH] matrix_rageshake_docker_ -> matrix_rageshake_container_ --- .../custom/matrix-rageshake/defaults/main.yml | 12 ++++++------ .../custom/matrix-rageshake/tasks/install.yml | 18 +++++++++--------- .../systemd/matrix-rageshake.service.j2 | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/roles/custom/matrix-rageshake/defaults/main.yml b/roles/custom/matrix-rageshake/defaults/main.yml index 85a3e50e3..e29ca62fb 100644 --- a/roles/custom/matrix-rageshake/defaults/main.yml +++ b/roles/custom/matrix-rageshake/defaults/main.yml @@ -7,18 +7,18 @@ matrix_rageshake_enabled: true # There are no stable container image tags yet. # See: https://github.com/matrix-org/rageshake/issues/69 matrix_rageshake_version: "master" -matrix_rageshake_docker_image: "{{ matrix_rageshake_docker_image_name_prefix }}matrix-org/rageshake:{{ matrix_rageshake_version }}" -matrix_rageshake_docker_image_name_prefix: "{{ 'localhost/' if matrix_rageshake_container_image_self_build else 'ghcr.io/' }}" -matrix_rageshake_docker_image_force_pull: "{{ matrix_rageshake_docker_image.endswith(':master') }}" +matrix_rageshake_container_image: "{{ matrix_rageshake_container_image_name_prefix }}matrix-org/rageshake:{{ matrix_rageshake_version }}" +matrix_rageshake_container_image_name_prefix: "{{ 'localhost/' if matrix_rageshake_container_image_self_build else 'ghcr.io/' }}" +matrix_rageshake_container_image_force_pull: "{{ matrix_rageshake_container_image.endswith(':master') }}" matrix_rageshake_base_path: "{{ matrix_base_data_path }}/rageshake" matrix_rageshake_config_path: "{{ matrix_rageshake_base_path }}/config" matrix_rageshake_data_path: "{{ matrix_rageshake_base_path }}/data" matrix_rageshake_container_image_self_build: false -matrix_rageshake_docker_repo: "https://github.com/matrix-org/rageshake/" -matrix_rageshake_docker_repo_version: "{{ 'master' if matrix_rageshake_version == 'master' else matrix_rageshake_version }}" -matrix_rageshake_docker_src_files_path: "{{ matrix_base_data_path }}/Dockerfile" +matrix_rageshake_container_repo: "https://github.com/matrix-org/rageshake/" +matrix_rageshake_container_repo_version: "{{ 'master' if matrix_rageshake_version == 'master' else matrix_rageshake_version }}" +matrix_rageshake_container_src_files_path: "{{ matrix_base_data_path }}/Dockerfile" # A list of extra arguments to pass to the container matrix_rageshake_container_extra_arguments: [] diff --git a/roles/custom/matrix-rageshake/tasks/install.yml b/roles/custom/matrix-rageshake/tasks/install.yml index 3f4d64c5d..6b75b969e 100644 --- a/roles/custom/matrix-rageshake/tasks/install.yml +++ b/roles/custom/matrix-rageshake/tasks/install.yml @@ -10,7 +10,7 @@ - { path: "{{ matrix_rageshake_config_path }}", when: true } - { path: "{{ matrix_rageshake_data_path }}", when: true } - { - path: "{{ matrix_rageshake_docker_src_files_path }}", + path: "{{ matrix_rageshake_container_src_files_path }}", when: matrix_rageshake_container_image_self_build, } when: "item.when | bool" @@ -25,10 +25,10 @@ - name: Ensure rageshake image is pulled community.docker.docker_image: - name: "{{ matrix_rageshake_docker_image }}" + name: "{{ matrix_rageshake_container_image }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" - force_source: "{{ matrix_rageshake_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" - force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_rageshake_docker_image_force_pull }}" + force_source: "{{ matrix_rageshake_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" + force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_rageshake_container_image_force_pull }}" when: "not matrix_rageshake_container_image_self_build | bool" register: result retries: "{{ devture_playbook_help_container_retries_count }}" @@ -37,9 +37,9 @@ - name: Ensure rageshake repository is present on self-build ansible.builtin.git: - repo: "{{ matrix_rageshake_docker_repo }}" - version: "{{ matrix_rageshake_docker_repo_version }}" - dest: "{{ matrix_rageshake_docker_src_files_path }}" + repo: "{{ matrix_rageshake_container_repo }}" + version: "{{ matrix_rageshake_container_repo_version }}" + dest: "{{ matrix_rageshake_container_src_files_path }}" force: "yes" become: true become_user: "{{ matrix_user_username }}" @@ -48,13 +48,13 @@ - name: Ensure rageshake image is built community.docker.docker_image: - name: "{{ matrix_rageshake_docker_image }}" + name: "{{ matrix_rageshake_container_image }}" source: build force_source: "{{ matrix_rageshake_git_pull_results.changed if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mailer_git_pull_results.changed }}" build: dockerfile: Dockerfile - path: "{{ matrix_rageshake_docker_src_files_path }}" + path: "{{ matrix_rageshake_container_src_files_path }}" pull: true when: "matrix_rageshake_container_image_self_build | bool" diff --git a/roles/custom/matrix-rageshake/templates/systemd/matrix-rageshake.service.j2 b/roles/custom/matrix-rageshake/templates/systemd/matrix-rageshake.service.j2 index 6e818e0f3..5e6cfecee 100644 --- a/roles/custom/matrix-rageshake/templates/systemd/matrix-rageshake.service.j2 +++ b/roles/custom/matrix-rageshake/templates/systemd/matrix-rageshake.service.j2 @@ -28,7 +28,7 @@ ExecStart={{ devture_systemd_docker_base_host_command_docker }} run --rm --name {% for arg in matrix_rageshake_container_extra_arguments %} {{ arg }} \ {% endfor %} - {{ matrix_rageshake_docker_image }} \ + {{ matrix_rageshake_container_image }} \ --config /config/config.yml ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} kill matrix-rageshake 2>/dev/null || true'