Switch caddy to use json configuration
This commit is contained in:
parent
bebdf72b19
commit
79c704c1f9
6 changed files with 86 additions and 34 deletions
79
roles/caddy/templates/config.json.j2
Normal file
79
roles/caddy/templates/config.json.j2
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
{
|
||||
{% if caddy_use_api is sameas false %}
|
||||
"admin": {
|
||||
"disabled": true
|
||||
},
|
||||
{% endif %}
|
||||
{% if caddy_use_debug is sameas true %}
|
||||
"logging": {
|
||||
"logs": {
|
||||
"default": {
|
||||
"level": "DEBUG"
|
||||
}
|
||||
}
|
||||
},
|
||||
{% endif %}
|
||||
"apps": {
|
||||
"http": {
|
||||
"servers": {
|
||||
"{{ caddy_http_server_name }}": {
|
||||
"listen": [
|
||||
":80"
|
||||
],
|
||||
"routes": []
|
||||
{% if caddy_use_https is sameas true %},
|
||||
"automatic_https": {
|
||||
"disable": true
|
||||
}
|
||||
{% endif %}
|
||||
},
|
||||
"{{ caddy_https_server_name }}": {
|
||||
"listen": [
|
||||
":443"
|
||||
],
|
||||
"routes": []
|
||||
{% if caddy_use_https is sameas true %},
|
||||
"automatic_https": {
|
||||
"disable": true
|
||||
}
|
||||
{% endif %}
|
||||
}
|
||||
}
|
||||
}
|
||||
{% if caddy_use_https is sameas true %},
|
||||
"tls": {
|
||||
"automation": {
|
||||
"policies": [
|
||||
{
|
||||
"subjects": [],
|
||||
"issuers": [
|
||||
{% if caddy_tls_use_staging is sameas true %}
|
||||
{
|
||||
"ca": "https://acme-staging-v02.api.letsencrypt.org/directory",
|
||||
{%- if caddy_email is not undefined and not none %}
|
||||
"email": "{{ caddy_email }}",
|
||||
{% endif %}
|
||||
"module": "acme"
|
||||
}
|
||||
{% else %}
|
||||
{
|
||||
{%- if caddy_email is not undefined and not none %}
|
||||
"email": "{{ caddy_email }}",
|
||||
{% endif %}
|
||||
"module": "acme"
|
||||
},
|
||||
{
|
||||
{%- if caddy_email is not undefined and not none %}
|
||||
"email": "{{ caddy_email }}",
|
||||
{% endif %}
|
||||
"module": "zerossl"
|
||||
}
|
||||
{% endif %}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
{% endif %}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue