lab-ansible/roles/proxy/tasks/main.yml
2023-12-28 00:07:21 +01:00

63 lines
1.5 KiB
YAML

# vim: ft=yaml.ansible
# code: language=ansible
---
- name: Create base directory for Caddy
ansible.builtin.file:
path: "{{ proxy_data_root }}"
owner: root
mode: u=rwx,g=rx,o=rx
state: directory
- name: Create build directory for Caddy
ansible.builtin.file:
path: "{{ proxy_data_root }}/build"
owner: root
mode: u=rwx,g=rx,o=rx
state: directory
- name: Copy Compose file for Caddy
ansible.builtin.template:
src: docker/docker-compose.yml.j2
dest: "{{ proxy_data_root }}/docker-compose.yml"
owner: root
mode: u=rw,go=
- name: Copy Dockerfile for Caddy
ansible.builtin.template:
src: docker/Dockerfile.j2
dest: "{{ proxy_data_root }}/build/Dockerfile"
owner: root
mode: u=rw,g=r,o=r
notify: Build custom Docker image for Caddy
- name: Create data directory for Caddy
ansible.builtin.file:
path: "{{ proxy_data_root }}/data"
owner: root
mode: u=rwx,g=rx,o=rx
state: directory
- name: Copy Caddyfile
ansible.builtin.template:
src: caddy/Caddyfile.j2
dest: "{{ proxy_data_root }}/data/Caddyfile"
owner: root
mode: u=rw,go=
- name: Create subdirectories for Caddy data
ansible.builtin.file:
path: "{{ proxy_data_root }}/data/caddy-{{ item }}"
owner: root
mode: u=rwx,go=
state: directory
loop:
- config
- data
- name: Copy deploy.sh
ansible.builtin.template:
src: scripts/deploy.sh.j2
dest: /usr/local/bin/deploy.sh
owner: root
mode: u=rwx,g=rx,o=rx