diff options
author | Christian Pointner <equinox@spreadspace.org> | 2024-05-27 22:53:29 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2024-05-27 22:53:29 +0200 |
commit | 3c0cd65a7c3df993000029cb0cb8ec430845ef46 (patch) | |
tree | 3e46b49006aca2b2ec6ce971310f4e9a54f812df /chaos-at-home | |
parent | move chaos-at-home hosts to new apt cache and harmonize sources.list config f... (diff) |
move ch-cm4-sensors* to iot vlan
Diffstat (limited to 'chaos-at-home')
-rw-r--r-- | chaos-at-home/ch-iot.yml | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/chaos-at-home/ch-iot.yml b/chaos-at-home/ch-iot.yml index 1cc18e76..86e78956 100644 --- a/chaos-at-home/ch-iot.yml +++ b/chaos-at-home/ch-iot.yml @@ -17,3 +17,45 @@ - role: mosquitto/broker - role: nginx/base - role: monitoring/prometheus/exporter + post_tasks: + - name: create systemd override directory for nginx service unit + file: + path: /etc/systemd/system/nginx.service.d + state: directory + + - name: create overrides for nginx systemd unit + copy: + content: | + [Unit] + After=network-online.target + Wants=network-online.target + dest: /etc/systemd/system/nginx.service.d/after-network-online.conf + + - name: configure default vhost web.chaos-at-home.org + vars: + nginx_vhost: + name: iot-default + default: yes + listen: + - "{{ network_zones.iot.prefix | ansible.utils.ipaddr(network_zones.iot.offsets[inventory_hostname]) | ansible.utils.ipaddr('address') }}:80" + template: generic + locations: + '/': + return: 404 + include_role: + name: nginx/vhost + + - name: configure reverse-proxy for apt-cache + vars: + nginx_vhost: + name: apt.chaos-at-home.org + listen: + - "{{ network_zones.iot.prefix | ansible.utils.ipaddr(network_zones.iot.offsets[inventory_hostname]) | ansible.utils.ipaddr('address') }}:80" + hostnames: + - apt.chaos-at-home.org + template: generic + locations: + '/': + proxy_pass: "http://apt.chaos-at-home.org/" + include_role: + name: nginx/vhost |