Added Several New Services

This commit is contained in:
Annika Merris 2025-05-16 13:46:14 -04:00
parent 0f3b4dad7e
commit 4b89946070
12 changed files with 134 additions and 5 deletions

View file

@ -0,0 +1,48 @@
---
- name: Load distro-specific variables
ansible.builtin.include_vars: '{{ item }}'
tags: always
with_first_found:
- files:
- "{{ ansible_distribution }}.yaml"
skip: true
- name: Ensure Caddy is running on this device
block:
- name: Ensure presense of folders for Caddy Home
tags: packages,docker,caddy
ansible.builtin.file:
path: "/opt/caddy/{{ item }}"
state: directory
recurse: true
owner: root
group: root
loop:
- data
- config
- name: Ensure compose file is available on the server
tags: docker,caddy,settings
ansible.builtin.copy:
src: docker-compose.yaml
dest: /opt/caddy/docker-compose.yaml
owner: root
group: root
mode: u=rw,g=r,o=r
- name: Ensure environment file is available on the server
tags: docker,caddy,settings
ansible.builtin.template:
src: Caddyfile.j2
dest: /opt/caddy/Caddyfile
owner: root
group: root
mode: u=rw,g=,o=
- name: Ensure docker containers are pulled and running
tags: docker,caddy
community.docker.docker_compose_v2:
project_src: /opt/caddy
pull: always
rescue:
- name: Set that this task failed
ansible.builtin.set_fact:
task_failed: true