From 4be491289cf405f1a09c0d25f1b6c5ef35828b4b Mon Sep 17 00:00:00 2001 From: olli Date: Sun, 10 Jul 2022 10:51:03 +0200 Subject: [PATCH] first commit --- README.md | 0 novnc.yml | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 README.md create mode 100644 novnc.yml diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/novnc.yml b/novnc.yml new file mode 100644 index 0000000..3c96acc --- /dev/null +++ b/novnc.yml @@ -0,0 +1,86 @@ +--- +- name: novnc + hosts: tor-nas.dedyn.io defiant.dedyn.io + tasks: + + - name: Packages for novnc + apt: + name: + - novnc + update_cache: no + install_recommends: no + + - name: /etc/systemd/system/websockify-novnc.service + blockinfile: + path: /etc/systemd/system/websockify-novnc.service + create: yes + mode: "0444" + owner: root + group: root + marker: "# {mark} tor-nas ANSIBLE MANAGED BLOCK" + block: | + [Unit] + Description=Websockify NoVNC + After=network.target + + [Service] + Type=simple + ExecStart=/usr/bin/websockify --web=/usr/share/novnc 0.0.0.0:8000 127.0.0.1:5900 + KillMode=process + Restart=on-failure + RestartPreventExitStatus=255 + RuntimeDirectory=websockify + RuntimeDirectoryMode=0755 + + [Install] + WantedBy=multi-user.target + Alias=websockify-novnc.service + backup: yes + notify: + - Restart websockify-novnc + + - name: 'add websockify-novnc to startup' + command: systemctl enable websockify-novnc + args: + creates: /etc/systemd/system/multi-user.target.wants/websockify-novnc.service + + - name: /home/docker/traefik/providers/novnc.yml Webmin<->Traefik provider + blockinfile: + path: /home/docker/traefik/providers/novnc.yml + create: yes + mode: 0444 + owner: root + group: docker + marker: "# {mark} ANSIBLE MANAGED BLOCK" + block: | + http: + routers: + novnc: + rule: "Host(`novnc.{{inventory_hostname}}`)" + service: novnc + entryPoints: + - "https" + tls: + certresolver: + - "letsencrypt" + middlewares: + - "secHeaders@file" + - "auth-novnc" + services: + novnc: + loadBalancer: + servers: + - url: "http://192.168.41.1:8000" + middlewares: + auth-novnc: + basicauth: + users: "admin:$apr1$XLxGs/Ba$3phZ1a2RtfExOp8x6NFjZ." + + + handlers: + + - name: Restart websockify-novnc + service: + name: websockify-novnc + state: restarted +