add caddy shit

This commit is contained in:
Arya 2023-04-19 21:23:19 +05:30
parent b9656b2247
commit 1e34416958
Signed by: arya
GPG Key ID: 842D12BDA50DF120
4 changed files with 46 additions and 0 deletions

View File

@ -10,6 +10,8 @@
- curl - curl
- wget - wget
- sudo - sudo
- net-tools
- nmap
- name: Add users - name: Add users
hosts: ansibletest hosts: ansibletest
vars: vars:

8
playbooks/caddy.yaml Normal file
View File

@ -0,0 +1,8 @@
---
- hosts: all
roles:
- role: caddy_ansible.caddy_ansible
caddy_systemd_capabilities_enabled: true
caddy_config: "{{ lookup('template', '../templates/Caddyfile.j2') }}"
caddy_user: "caddy"
caddy_home: "/var/lib/caddy"

8
secrets.enc Normal file
View File

@ -0,0 +1,8 @@
$ANSIBLE_VAULT;1.1;AES256
34633834373963623539346533333535383664336566363338616335353361383733626138646666
3331303661623232643935353663336230343065613962350a626437336265616433666337613632
64303262663662386637653337323930353966623262383334386139376563333031646436303930
3330383339663266330a663435623061333061333961353864663035663736303238333065306335
65373836316532356233323234343264316232303135366462373938393563643935646234356366
33643962323333306134383038383932653734666430646336663730363565343738313031313938
366131626531636637636135333238373361

28
templates/Caddyfile.j2 Normal file
View File

@ -0,0 +1,28 @@
#{
# acme_dns rfc2136 {
# key_name "dynupd"
# key_alg "hmac-sha256"
# # declared in secrets.en: https://aryak.me/blog/01-knot
# key "{{ rfc2136_key }}"
# server "107.189.12.96:53"
# }
# acme_ca https://acme-v02.api.letsencrypt.org/directory
#}
:80 {
redir https://wiki.projectsegfau.lt/index.php?title={{ inventory_hostname }}
}
{% if inventory_hostname == 'ansible01' %}
:691 {
redir https://wiki.projectsegfau.lt/index.php?title={{ inventory_hostname }}
}
{% elif inventory_hostname == 'ansible02' %}
:692 {
redir https://wiki.projectsegfau.lt/index.php?title={{ inventory_hostname }}
}
{% elif inventory_hostname == 'ansible03' %}
:693 {
redir https://wiki.projectsegfau.lt/index.php?title={{ inventory_hostname }}
}
{% else %}
# Nothing extra defined
{% endif %}