diff --git a/playbooks/apprise.yml b/playbooks/apprise.yml index e69de29..5dd5b13 100644 --- a/playbooks/apprise.yml +++ b/playbooks/apprise.yml @@ -0,0 +1,46 @@ +- 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: templates/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 \ No newline at end of file