commit 89952369f0017db60771f8981bec5cfd29d4a50c Author: fichince Date: Tue May 12 10:20:05 2026 -0400 working setup with caddy diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..e9f7377 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,9 @@ +test1.tingker.ddns.net { + file_server + root * /var/www/html/test1 +} + +test2.tingker.ddns.net { + file_server + root * /var/www/html/test2 +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..45f183b --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +Before using this playbook, the target hosts must have: +- Public key of control node in ~/.ssh/id_rsa.pub +- Passwordless sudo enabled (see: ) \ No newline at end of file diff --git a/inventory.yaml b/inventory.yaml new file mode 100644 index 0000000..29d0772 --- /dev/null +++ b/inventory.yaml @@ -0,0 +1,3 @@ +homelab: + hosts: + rosebook.local: \ No newline at end of file diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000..32229ea --- /dev/null +++ b/mise.toml @@ -0,0 +1,2 @@ +[tools] +python = "3" diff --git a/playbook.yaml b/playbook.yaml new file mode 100644 index 0000000..5535c74 --- /dev/null +++ b/playbook.yaml @@ -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 \ No newline at end of file diff --git a/test1.html b/test1.html new file mode 100644 index 0000000..d06931a --- /dev/null +++ b/test1.html @@ -0,0 +1,9 @@ + + + Test 1 + + +

Test 1

+

This is a test page.

+ + \ No newline at end of file diff --git a/test2.html b/test2.html new file mode 100644 index 0000000..31b3c31 --- /dev/null +++ b/test2.html @@ -0,0 +1,9 @@ + + + Test 2 + + +

Test 2

+

This is a test page.

+ + \ No newline at end of file