This role installs and configures the caddy web server. The user can specify any http configuration parameters they wish to apply their site. Any number of sites can be added with configurations of your choice.
None
The Caddyfile (notice the pipe)
default:
caddy_config: |
localhost:2020
gzip
root /var/www
git github.com/antoiner77/caddy-ansible /
Email is used for the lets encrypt integration:
example:
caddy_email: foo@foo.bar
Auto update Caddy?
default:
caddy_update: yes
Features that can be added to core: cors,git,hugo,ipfilter,jsonp,search
Changing this variable will reinstall Caddy with the new features if caddy_update
is enabled
default:
caddy_features: git
Init-Systems: systemd, upstart
By default the role tries to deploy service files for all init systems. This works because the tasks ignore errors if a directory doesn't exist, but there might still be a red warning. To fix this just specify your init system:
caddy_init_system: false (this tries everything, but might generate red warnings)
caddy_init_system: systemd (only deploy systemd service and skip everything else)
---
- hosts: all
roles:
- role: caddy-ansible
caddy_email: foo@foo.bar
caddy_config: |
localhost:2020
gzip
root /var/www
git github.com/antoiner77/caddy-ansible /
If the service fails to start you can figure out why by looking at the output of Caddy.
Upstart (ubuntu, debian wheezy, centos/rhel 6)
tail /var/log/upstart/caddy.log
Systemd (debian jessie, centos/rhel 7)
systemctl status caddy -l
If something doesn't seem right, open an issue!
Pull requests are welcome. Please test your changes beforehand with vagrant:
vagrant up
vagrant provision (since it already provisioned there should be no changes here)
vagrant destroy