chore(timetracking_bot): fix lints

This commit is contained in:
Jan Christian Grünhage 2023-07-07 00:51:23 +02:00
parent 5b2d02b802
commit a6af40ef94
No known key found for this signature in database
GPG key ID: EEC1170CE56FA2ED
7 changed files with 28 additions and 19 deletions

View file

@ -1,7 +0,0 @@
---
# handlers file for timetracking-bot
- name: restart timetracking-bot
docker_container:
name: "timetracking-bot"
state: started
restart: yes

View file

@ -14,7 +14,12 @@ timetracking_bot_pg_db: "matrix-timetracking"
timetracking_bot_version: "0.4.4"
timetracking_bot_container_image_tag: ~
timetracking_bot_container_image: "registry.gitlab.com/famedly/bots/timetracking"
timetracking_bot_container_image_ref: '{{ timetracking_bot_container_image }}:{{ timetracking_bot_container_image_tag | default("v" + timetracking_bot_version, true) }}'
timetracking_bot_container_image_ref: >-
{{
timetracking_bot_container_image
~ ':'
~ timetracking_bot_container_image_tag | default("v" + timetracking_bot_version, true)
}}
timetracking_bot_docker_ports: []
timetracking_bot_docker_env: {}

View file

@ -0,0 +1,8 @@
---
# handlers file for timetracking-bot
- name: Restart timetracking-bot
community.docker.docker_container:
name: "timetracking-bot"
state: started
restart: true
listen: restart-timetracking-bot

View file

@ -1,7 +1,9 @@
---
galaxy_info:
author: Jan Christian Grünhage
description: deploys a dockerized matrix timetracking bot
company: Famedly GmbH
min_ansible_version: 2.9
license: AGPL-3.0-only
min_ansible_version: "6"
galaxy_tags: []
dependencies: []

View file

@ -1,16 +1,16 @@
---
# tasks file for timetracking-bot
- name: create timetracking bot user
- name: Create timetracking bot user
user:
name: matrix-timetracking
state: present
system: yes
system: true
register: timetracking_bot_user_res
- name: create application directories
- name: Create application directories
file:
path: "{{ item }}"
mode: 0750
mode: "0755"
owner: "{{ timetracking_bot_user_res.uid }}"
group: "{{ timetracking_bot_user_res.group }}"
state: directory
@ -19,20 +19,21 @@
- "{{ timetracking_bot_store_path }}"
- "{{ timetracking_bot_session_path }}"
- name: template config
- name: Template config
copy:
# default required to make linter happy
content: |
{{ 'Managed by ansible' | comment('plain', prefix='#####', postfix='#####') }}
{{ timetracking_bot_config | to_nice_yaml }}
{{ timetracking_bot_config | default({}) | to_nice_yaml }}
dest: "{{ timetracking_bot_config_path }}"
mode: 0640
mode: "0640"
owner: "{{ timetracking_bot_user_res.uid }}"
group: "{{ timetracking_bot_user_res.group }}"
notify:
- restart timetracking-bot
- restart-timetracking-bot
- name: start container
docker_container:
- name: Start container
community.docker.docker_container:
name: "timetracking-bot"
image: "{{ timetracking_bot_container_image_ref }}"
restart_policy: "unless-stopped"