wulf-ansible/playbooks/apprise.yml

46 lines
No EOL
1.1 KiB
YAML

- name: Deploy Apprise
hosts: docker_hosts
become: true
vars:
stack_dir: /opt/stacks/apprise
tasks:
- name: Ensure stack directory exists
ansible.builtin.file:
path: "{{ stack_dir }}"
state: directory
mode: '0755'
- name: Ensure pangolin network exists
community.docker.docker_network:
name: pangolin
state: present
- name: Deploy compose.yml
ansible.builtin.template:
src: apprise-compose.yml.j2
dest: "{{ stack_dir }}/compose.yml"
- name: Ensure config directory exists
ansible.builtin.file:
path: "{{ stack_dir }}/config"
state: directory
mode: '0755'
- name: Deploy apprise config
ansible.builtin.template:
src: templates/apprise.yaml.j2
dest: "{{ stack_dir }}/config/apprise.yaml"
mode: '0600'
- name: Pull images
community.docker.docker_compose_v2:
project_src: "{{ stack_dir }}"
pull: always
- name: Start stack
community.docker.docker_compose_v2:
project_src: "{{ stack_dir }}"
state: present