2023-01-13 13:29:25 +00:00
|
|
|
---
|
|
|
|
- name: Ensure standupbot user is created
|
|
|
|
become: true
|
|
|
|
ansible.builtin.user:
|
|
|
|
name: standupbot
|
|
|
|
state: present
|
|
|
|
system: true
|
|
|
|
|
|
|
|
- name: Ensure base directory for standupbot is created
|
|
|
|
become: true
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ standupbot_base_path }}"
|
|
|
|
state: directory
|
|
|
|
owner: standupbot
|
|
|
|
group: standupbot
|
2023-07-06 20:58:13 +00:00
|
|
|
mode: "0755"
|
2023-01-13 13:29:25 +00:00
|
|
|
|
|
|
|
- name: Ensure config file is up to date
|
|
|
|
become: true
|
|
|
|
ansible.builtin.copy:
|
|
|
|
content: "{{ standupbot_config | to_nice_json }}"
|
|
|
|
dest: "{{ standupbot_base_path }}/config.json"
|
|
|
|
owner: standupbot
|
|
|
|
group: standupbot
|
2023-07-06 20:58:13 +00:00
|
|
|
mode: "0600"
|
2023-01-13 13:29:25 +00:00
|
|
|
notify: restart-standupbot
|
|
|
|
|
|
|
|
- name: Ensure password file is up to date
|
|
|
|
become: true
|
|
|
|
ansible.builtin.copy:
|
|
|
|
content: "{{ standupbot_password }}"
|
|
|
|
dest: "{{ standupbot_config.PasswordFile }}"
|
|
|
|
owner: standupbot
|
|
|
|
group: standupbot
|
2023-07-06 20:58:13 +00:00
|
|
|
mode: "0600"
|
2023-01-13 13:29:25 +00:00
|
|
|
notify: restart-standupbot
|
|
|
|
|
|
|
|
- name: Ensure standupbot container is running
|
|
|
|
become: true
|
|
|
|
community.docker.docker_container:
|
2023-02-23 10:23:45 +00:00
|
|
|
image: ghcr.io/beeper/standupbot:latest
|
2023-01-13 13:29:25 +00:00
|
|
|
name: standupbot
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
volumes:
|
|
|
|
- "{{ standupbot_base_path }}:{{ standupbot_base_path }}"
|
|
|
|
- "{{ standupbot_base_path }}/data:/root/.local/share/standupbot"
|
|
|
|
working_dir: "{{ standupbot_base_path }}"
|
2023-02-23 10:23:45 +00:00
|
|
|
command: "/usr/bin/standupbot"
|