Updated code to use identifier variable

This commit is contained in:
Michael Hollister
2023-07-13 21:16:07 -05:00
parent c043463ee1
commit d120b0c153
4 changed files with 24 additions and 19 deletions

View File

@ -1,19 +1,19 @@
---
- name: Check existence of matrix-media-repo service
- name: Check existence of media-repo service
ansible.builtin.stat:
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-media-repo.service"
path: "{{ devture_systemd_docker_base_systemd_path }}/{{ matrix_media_repo_identifier }}.service"
register: matrix_media_repo_service_stat
- when: matrix_media_repo_service_stat.stat.exists | bool
block:
- name: Ensure matrix-media-repo is stopped
- name: Ensure media-repo is stopped
ansible.builtin.systemd:
name: matrix-media-repo
name: "{{ matrix_media_repo_identifier }}"
state: stopped
daemon_reload: true
- name: Ensure matrix-media-repo.service doesn't exist
- name: Ensure media-repo service doesn't exist
ansible.builtin.file:
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-media-repo.service"
path: "{{ devture_systemd_docker_base_systemd_path }}/{{ matrix_media_repo_identifier }}.service"
state: absent