working setup with caddy

This commit is contained in:
2026-05-12 10:20:05 -04:00
commit 89952369f0
7 changed files with 70 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
- name: Caddy
hosts: rosebook.local
become: true
tasks:
- name: Install Caddy
ansible.builtin.apt:
name: caddy
state: present
- name: Create Caddyfile
ansible.builtin.copy:
dest: /etc/caddy/Caddyfile
src: Caddyfile
- name: Web directory
ansible.builtin.file:
path: /var/www/html/test1
state: directory
mode: '0755'
- name: Web directory
ansible.builtin.file:
path: /var/www/html/test2
state: directory
mode: '0755'
- name: Static website
ansible.builtin.copy:
dest: /var/www/html/test1/index.html
src: test1.html
- name: Static website
ansible.builtin.copy:
dest: /var/www/html/test2/index.html
src: test2.html
- name: Enable and start service
ansible.builtin.service:
name: caddy
enabled: true
state: restarted