Skip to content

Commit

Permalink
Updated caddy role to better detect between jinja & raw Caddyfile a…
Browse files Browse the repository at this point in the history
…nd added a folder for file sharing
  • Loading branch information
AllRWeak authored and bl0way committed Feb 23, 2024
1 parent 8703d99 commit ef7a67c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions nova/core/roles/caddy/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
docker_network: local-network

# Caddy configuration modes
caddy_template_caddyfile_with_vars: true
caddy_template_caddyfile: false
caddy_template_caddyfile: false # Set to true to use a custom Caddyfile template
caddy_use_labels: false
caddy_container_ports:
- "80:80"
Expand Down
1 change: 1 addition & 0 deletions nova/core/roles/caddy/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- "{{ caddy_config_folder }}/data"
- "{{ caddy_config_folder }}/config"
- "{{ caddy_config_folder }}/logs"
- "{{ caddy_config_folder }}/www"
- "{{ caddy_certificates_folder }}"

- name: Templating Caddy configuration files for {{ inventory_hostname }}...
Expand Down
2 changes: 1 addition & 1 deletion nova/core/roles/caddy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- name: Including Caddyfile with variables mode tasks...
ansible.builtin.include_tasks: caddyfile_with_vars.yml
when: caddy_template_caddyfile_with_vars
when: not caddy_template_caddyfile

- name: Including Caddyfile template tasks...
ansible.builtin.include_tasks: caddy_template.yml
Expand Down
1 change: 1 addition & 0 deletions nova/core/roles/caddy/templates/caddy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
- /srv/caddy/data:/data/caddy
- /srv/caddy/config:/config/caddy
- /srv/caddy/logs:/srv/logs
- /srv/caddy/www:/srv/www
- "{{ caddy_certificates_folder }}:/srv/certs"
- /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt

Expand Down

0 comments on commit ef7a67c

Please sign in to comment.