commit c36accd784ca4848c2e490f22963324a51bcc3fa Author: olli Date: Sun Jul 10 11:00:52 2022 +0200 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/hugo.yml b/hugo.yml new file mode 100644 index 0000000..0694c78 --- /dev/null +++ b/hugo.yml @@ -0,0 +1,77 @@ +--- +- name: blog with hugo + hosts: defiant.dedyn.io + tasks: + + - name: Packages for blog with hugo + apt: + name: + - hugo + update_cache: no + install_recommends: no + + - name: /etc/systemd/system/hugo-blog.service + blockinfile: + path: /etc/systemd/system/hugo-blog.service + create: yes + mode: "0444" + owner: root + group: root + marker: "# {mark} ANSIBLE MANAGED BLOCK" + block: | + [Unit] + Description=Websockify NoVNC + After=network.target + + [Service] + Type=simple + WorkingDirectory=/home/docker/nextcloud.defiant.dedyn.io/nextcloud-data/data/olli/files/Projekte/hugo/gabosh-blog + ExecStart=hugo server --bind=192.168.41.1 --port=1313 --baseURL=https://blog.defiant.dedyn.io --buildDrafts --disableFastRender --appendPort=false + KillMode=process + Restart=on-failure + RestartPreventExitStatus=255 + RuntimeDirectory=websockify + RuntimeDirectoryMode=0755 + + [Install] + WantedBy=multi-user.target + Alias=hugo-blog.service + backup: yes + notify: + - Restart hugo-blog + + - name: /home/docker/traefik/providers/hugo-blog.yml Hugo<->Traefik provider + blockinfile: + path: /home/docker/traefik/providers/hugo-blog.yml + create: yes + mode: 0444 + owner: root + group: docker + marker: "# {mark} ANSIBLE MANAGED BLOCK" + block: | + http: + routers: + hugo-blog: + rule: "Host(`blog.defiant.dedyn.io`) || Host(`blog.gabosh.net`)" + service: hugo-blog + entryPoints: + - "https" + tls: + certresolver: + - "letsencrypt" + middlewares: + - "secHeaders@file" + services: + hugo-blog: + loadBalancer: + servers: + - url: "http://192.168.41.1:1313" + + + handlers: + + - name: Restart hugo-blog + service: + name: hugo-blog + state: restarted +