From da04b829858ae03b7ed5a7cb0c6b34d749514a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= Date: Thu, 6 Jul 2023 22:40:17 +0200 Subject: [PATCH] chore(barad_dur): fix lints --- README.md | 2 +- roles/barad-dur/handlers/main.yml | 7 ------- roles/{barad-dur => barad_dur}/README.md | 0 roles/{barad-dur => barad_dur}/defaults/main.yml | 2 +- roles/barad_dur/handlers/main.yml | 8 ++++++++ roles/{barad-dur => barad_dur}/tasks/main.yml | 15 +++++++-------- .../templates/config.yaml.j2 | 0 roles/{barad-dur => barad_dur}/vars/main.yml | 3 +-- 8 files changed, 18 insertions(+), 19 deletions(-) delete mode 100644 roles/barad-dur/handlers/main.yml rename roles/{barad-dur => barad_dur}/README.md (100%) rename roles/{barad-dur => barad_dur}/defaults/main.yml (97%) create mode 100644 roles/barad_dur/handlers/main.yml rename roles/{barad-dur => barad_dur}/tasks/main.yml (83%) rename roles/{barad-dur => barad_dur}/templates/config.yaml.j2 (100%) rename roles/{barad-dur => barad_dur}/vars/main.yml (82%) diff --git a/README.md b/README.md index 858d565..962d901 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ deploying commonly used matrix services: able to run in the browser, maintained by element. - [`hedwig`](roles/hedwig/README.md): Hedwig, a push-gateway server alternative to `sygnal`, developed by Famedly. -- [`barad-dur`](roles/barad-dur/README.md): Barad-dûr, a matrix phone-home stats collector alternative, developed by Famedly. +- [`barad_dur`](roles/barad_dur/README.md): Barad-dûr, a matrix phone-home stats collector alternative, developed by Famedly. ### Unmaintained roles diff --git a/roles/barad-dur/handlers/main.yml b/roles/barad-dur/handlers/main.yml deleted file mode 100644 index 9a109bf..0000000 --- a/roles/barad-dur/handlers/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -- name: restart-barad-dur - docker_container: - name: "{{ barad_dur_container_name }}" - state: started - restart: yes diff --git a/roles/barad-dur/README.md b/roles/barad_dur/README.md similarity index 100% rename from roles/barad-dur/README.md rename to roles/barad_dur/README.md diff --git a/roles/barad-dur/defaults/main.yml b/roles/barad_dur/defaults/main.yml similarity index 97% rename from roles/barad-dur/defaults/main.yml rename to roles/barad_dur/defaults/main.yml index e0faa5a..a38ff78 100644 --- a/roles/barad-dur/defaults/main.yml +++ b/roles/barad_dur/defaults/main.yml @@ -8,7 +8,7 @@ barad_dur_container_image_registry: "registry.gitlab.com" barad_dur_container_image_namespace: "famedly/company/backend/services/" barad_dur_container_image_name: "barad-dur" barad_dur_version: "0.1.2" -#barad_dur_container_image_tag: ~ +# barad_dur_container_image_tag: ~ barad_dur_container_force_pull: "{{ barad_dur_container_image_tag is defined }}" barad_dur_container_image_reference: >- diff --git a/roles/barad_dur/handlers/main.yml b/roles/barad_dur/handlers/main.yml new file mode 100644 index 0000000..97784e1 --- /dev/null +++ b/roles/barad_dur/handlers/main.yml @@ -0,0 +1,8 @@ +--- + +- name: Restart barad-dur container + community.docker.docker_container: + name: "{{ barad_dur_container_name }}" + state: started + restart: true + listen: restart-barad-dur diff --git a/roles/barad-dur/tasks/main.yml b/roles/barad_dur/tasks/main.yml similarity index 83% rename from roles/barad-dur/tasks/main.yml rename to roles/barad_dur/tasks/main.yml index 7bbb917..d057d5c 100644 --- a/roles/barad-dur/tasks/main.yml +++ b/roles/barad_dur/tasks/main.yml @@ -6,8 +6,7 @@ state: present system: true register: barad_dur_user_res - tags: [ 'prepare', 'prepare-barad_dur', - 'deploy', 'deploy-barad_dur' ] + tags: ['prepare', 'prepare-barad_dur', 'deploy', 'deploy-barad_dur'] - name: Create base-directory for barad-dur [{{ barad_dur_base_path }}] file: @@ -16,7 +15,7 @@ owner: "{{ barad_dur_user_res.uid }}" group: "{{ barad_dur_user_res.group }}" mode: "0755" - tags: [ 'prepare', 'prepare-barad_dur' ] + tags: ['prepare', 'prepare-barad_dur'] - name: Template configuration file for barad-dur [{{ barad_dur_config_file }}] template: @@ -26,10 +25,10 @@ group: "{{ barad_dur_user_res.group }}" mode: "0640" notify: restart-barad-dur - tags: [ 'deploy', 'deploy-barad_dur' ] + tags: ['deploy', 'deploy-barad_dur'] - name: Pull barad-dur container - docker_image: + community.docker.docker_image: name: "{{ barad_dur_container_image_reference }}" source: pull state: present @@ -38,10 +37,10 @@ until: barad_dur_container_image_pulled is success retries: 10 delay: 5 - tags: [ 'prepare', 'prepare-barad_dur' ] + tags: ['prepare', 'prepare-barad_dur'] - name: Start barad-dur container - docker_container: + community.docker.docker_container: name: "{{ barad_dur_container_name }}" image: "{{ barad_dur_container_image_reference }}" env: "{{ barad_dur_container_env }}" @@ -51,4 +50,4 @@ volumes: "{{ barad_dur_container_volumes }}" restart_policy: "{{ barad_dur_container_restart_policy }}" state: "{{ barad_dur_container_state }}" - tags: [ 'deploy', 'deploy-barad_dur' ] + tags: ['deploy', 'deploy-barad_dur'] diff --git a/roles/barad-dur/templates/config.yaml.j2 b/roles/barad_dur/templates/config.yaml.j2 similarity index 100% rename from roles/barad-dur/templates/config.yaml.j2 rename to roles/barad_dur/templates/config.yaml.j2 diff --git a/roles/barad-dur/vars/main.yml b/roles/barad_dur/vars/main.yml similarity index 82% rename from roles/barad-dur/vars/main.yml rename to roles/barad_dur/vars/main.yml index f6103af..b1c5407 100644 --- a/roles/barad-dur/vars/main.yml +++ b/roles/barad_dur/vars/main.yml @@ -1,10 +1,9 @@ --- - barad_dur_container_base_volumes: - "{{ barad_dur_config_file }}:{{ barad_dur_container_base_path }}/config.yaml:ro" barad_dur_container_volumes: "{{ barad_dur_container_base_volumes + barad_dur_container_extra_volumes }}" barad_dur_container_base_labels: - version: "{{ barad_dur_container_image_tag|default(barad_dur_version) }}" + version: "{{ barad_dur_container_image_tag | default(barad_dur_version) }}" barad_dur_container_labels_complete: "{{ barad_dur_container_base_labels | combine(barad_dur_container_labels) }}"