diff options
| author | Joe Carstairs <me@joeac.net> | 2026-08-03 17:54:57 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-08-03 17:54:57 +0100 |
| commit | f61d649de766f5b86ad4815a423f3ac5b086297d (patch) | |
| tree | 1685a44dbeb8abc350068334e70c5f6e84bd7f8d /ansible/roles | |
| parent | 66ba9847e9fd90daf7f59f75f57db0cc1615f04d (diff) | |
hard-codes subdomain full domain in ansible vars
Diffstat (limited to 'ansible/roles')
| -rw-r--r-- | ansible/roles/mox/templates/domains.conf | 8 | ||||
| -rw-r--r-- | ansible/roles/tls/tasks/main.yml | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/ansible/roles/mox/templates/domains.conf b/ansible/roles/mox/templates/domains.conf index e3ef95c..2aea5b9 100644 --- a/ansible/roles/mox/templates/domains.conf +++ b/ansible/roles/mox/templates/domains.conf @@ -61,7 +61,7 @@ WebHandlers: LogName: {{ subdomain.name }}.joeac.net PathRegexp: ^/ Compress: true - Domain: {% if subdomain.name == "@" %}joeac.net{% else %}{{ subdomain.name }}.joeac.net{% endif %} + Domain: {{ subdomain.full_domain }} WebStatic: Root: {{ services[subdomain.service].root }} ListFiles: {{ "directory_listing" in services[subdomain.service] and services[subdomain.service].directory_listing }} @@ -71,7 +71,7 @@ WebHandlers: LogName: {{ subdomain.name }}.joeac.net PathRegexp: ^.*[^(.html)]$ Compress: true - Domain: {% if subdomain.name == "@" %}joeac.net{% else %}{{ subdomain.name }}.joeac.net{% endif %} + Domain: {{ subdomain.full_domain }} WebRedirect: OrigPathRegexp: ^(.*[^(.html)])$ ReplacePath: $1/index.html @@ -80,7 +80,7 @@ WebHandlers: LogName: {{ subdomain.name }}.joeac.net PathRegexp: ^/.*/index.html$ Compress: true - Domain: {% if subdomain.name == "@" %}joeac.net{% else %}{{ subdomain.name }}.joeac.net{% endif %} + Domain: {{ subdomain.full_domain }} WebRedirect: OrigPathRegexp: ^(.*)/index.html$ ReplacePath: $1.html @@ -90,7 +90,7 @@ WebHandlers: LogName: {{ subdomain.name }}.joeac.net PathRegexp: ^/ Compress: true - Domain: {% if subdomain.name == "@" %}joeac.net{% else %}{{ subdomain.name }}.joeac.net{% endif %} + Domain: {{ subdomain.full_domain }} WebForward: URL: http://{{ hostvars[services[subdomain.service].host].ansible_host }}:{{ services[subdomain.service].port }} {% endif %} diff --git a/ansible/roles/tls/tasks/main.yml b/ansible/roles/tls/tasks/main.yml index e758fc5..195a391 100644 --- a/ansible/roles/tls/tasks/main.yml +++ b/ansible/roles/tls/tasks/main.yml @@ -29,13 +29,13 @@ certbot renew --non-interactive - name: Install missing TLS certificates - loop: "{{ subdomains | map(attribute='name') }}" - when: not ( ( item ~ ".joeac.net" ) in ansible_local.certbot.certificates ) + loop: "{{ subdomains }}" + when: not ( ( item.name ~ ".joeac.net" ) in ansible_local.certbot.certificates ) ansible.builtin.shell: certbot certonly \ --nginx \ - --cert-name {{ item }}.joeac.net \ - --domain {% if item == "@" %} joeac.net {% else %} {{ item }}.joeac.net {% endif %} \ + --cert-name {{ item.name }}.joeac.net \ + --domain {{ subdomain.full_domain }} \ --non-interactive - name: Add joeac.net group |
