From b1b338272891a9186f516795eafc6058a610236c Mon Sep 17 00:00:00 2001
From: Alexander Dahl <alex@netz39.de>
Date: Sun, 30 Jan 2022 11:42:48 +0100
Subject: [PATCH 1/3] Revert "Fix YAML format issues"

This reverts commit babeef822682d75939ec91039afee7d8e92efb7e.

Instead of fixing the indentation of the recently introduced gitea
stuff, the indentation of the old stuff was changed.
---
 pottwal.yml | 274 ++++++++++++++++++++++++++--------------------------
 1 file changed, 137 insertions(+), 137 deletions(-)

diff --git a/pottwal.yml b/pottwal.yml
index 90d910b..fe08604 100644
--- a/pottwal.yml
+++ b/pottwal.yml
@@ -71,156 +71,156 @@
       site_name: "gitea.n39.eu"
       proxy_port: "{{ gitea_host_port }}"
 
-  - name: Ensure apt-cacher container is running
-    docker_container:
-      name: apt_cacher_ng
-      image: "mrtux/apt-cacher-ng"
-      pull: true
-      state: started
-      restart_policy: unless-stopped
-      detach: yes
-      ports:
-        - 3142:3142
+    - name: Ensure apt-cacher container is running
+      docker_container:
+        name: apt_cacher_ng
+        image: "mrtux/apt-cacher-ng"
+        pull: true
+        state: started
+        restart_policy: unless-stopped
+        detach: yes
+        ports:
+          - 3142:3142
 
 
-  - name: Ensure the mosquitto directories exist
-    file:
-      path: "{{ item }}"
-      state: directory
-    with_items:
-      - "{{ mosquitto_data }}/config"
-      - "{{ mosquitto_data }}/data"
-      - "{{ mosquitto_data }}/log"
+    - name: Ensure the mosquitto directories exist
+      file:
+        path: "{{ item }}"
+        state: directory
+      with_items:
+        - "{{ mosquitto_data }}/config"
+        - "{{ mosquitto_data }}/data"
+        - "{{ mosquitto_data }}/log"
 
-  - name: Make sure mosquitto config is there
-    template:
-      src: "templates/mosquitto.conf.j2"
-      dest: "{{ mosquitto_data }}/config/mosquitto.conf"
-    notify: restart_mosquitto
+    - name: Make sure mosquitto config is there
+      template:
+        src: "templates/mosquitto.conf.j2"
+        dest: "{{ mosquitto_data }}/config/mosquitto.conf"
+      notify: restart_mosquitto
 
-  - name: Ensure mosquitto is running
-    docker_container:
-      name: mosquitto
-      image: "{{ mosquitto_image }}"
-      pull: true
-      state: started
-      ports:
-        - 1883:1883
-        - 9001:9001
-      volumes:
-        - "{{ mosquitto_data }}/config:/mosquitto/config"
-        - "{{ mosquitto_data }}/data:/mosquitto/data"
-        - "{{ mosquitto_data }}/log:/mosquitto/log"
-      detach: yes
-      keep_volumes: yes
-      restart_policy: unless-stopped
+    - name: Ensure mosquitto is running
+      docker_container:
+        name: mosquitto
+        image: "{{ mosquitto_image }}"
+        pull: true
+        state: started
+        ports:
+          - 1883:1883
+          - 9001:9001
+        volumes:
+          - "{{ mosquitto_data }}/config:/mosquitto/config"
+          - "{{ mosquitto_data }}/data:/mosquitto/data"
+          - "{{ mosquitto_data }}/log:/mosquitto/log"
+        detach: yes
+        keep_volumes: yes
+        restart_policy: unless-stopped
 
-  - name: Ensure the openhab directories exist
-    file:
-      path: "{{ item }}"
-      state: directory
-    with_items:
-      - "{{ openhab_data }}/addons"
-      - "{{ openhab_data }}/conf"
-      - "{{ openhab_data }}/userdata"
+    - name: Ensure the openhab directories exist
+      file:
+        path: "{{ item }}"
+        state: directory
+      with_items:
+        - "{{ openhab_data }}/addons"
+        - "{{ openhab_data }}/conf"
+        - "{{ openhab_data }}/userdata"
 
-  - name: Clone or update configuration
-    git:
-      repo: "{{ openhab_configuration_source }}"
-      version: "{{ openhab_configuration_version }}"
-      dest: "{{ openhab_data }}/conf"
-      clone: yes
-      update: yes
+    - name: Clone or update configuration
+      git:
+        repo: "{{ openhab_configuration_source }}"
+        version: "{{ openhab_configuration_version }}"
+        dest: "{{ openhab_data }}/conf"
+        clone: yes
+        update: yes
 
-  - name: ensure openhab is up and running
-    docker_container:
-      name: openhab
-      image: "{{ openhab_image }}"
-      pull: true
-      state: started
-      detach: yes
-      interactive: yes
-      tty: yes
-      ports:
-        - "{{ openhab_host_port }}:8080"
-      volumes:
-        - /etc/localtime:/etc/localtime:ro
-        - /etc/timezone:/etc/timezone:ro
-        - "{{ openhab_data }}/addons:/openhab/addons:rw"
-        - "{{ openhab_data }}/conf:/openhab/conf:rw"
-        - "{{ openhab_data }}/userdata:/openhab/userdata:rw"
-      keep_volumes: yes
-      restart_policy: unless-stopped
-      env: EXTRA_JAVA_OPTS="-Duser.timezone=Europe/Berlin"
+    - name: ensure openhab is up and running
+      docker_container:
+        name: openhab
+        image: "{{ openhab_image }}"
+        pull: true
+        state: started
+        detach: yes
+        interactive: yes
+        tty: yes
+        ports:
+          - "{{ openhab_host_port }}:8080"
+        volumes:
+          - /etc/localtime:/etc/localtime:ro
+          - /etc/timezone:/etc/timezone:ro
+          - "{{ openhab_data }}/addons:/openhab/addons:rw"
+          - "{{ openhab_data }}/conf:/openhab/conf:rw"
+          - "{{ openhab_data }}/userdata:/openhab/userdata:rw"
+        keep_volumes: yes
+        restart_policy: unless-stopped
+        env: EXTRA_JAVA_OPTS="-Duser.timezone=Europe/Berlin"
 
-  - name: Setup proxy site openhab.n39.eu
-    include_role:
-      name: setup-http-site-proxy
-    vars:
-      site_name: openhab.n39.eu
-      proxy_port: "{{ openhab_host_port }}"
+    - name: Setup proxy site openhab.n39.eu
+      include_role:
+        name: setup-http-site-proxy
+      vars:
+        site_name: openhab.n39.eu
+        proxy_port: "{{ openhab_host_port }}"
 
-  - name: Ensure container for URI tools is running
-    docker_container:
-      name: uritools
-      image: mrtux/clean_uri
-      pull: true
-      state: started
-      detach: yes
-      ports:
-        - "{{ uritools_host_port }}:8080"
-      restart_policy: unless-stopped
+    - name: Ensure container for URI tools is running
+      docker_container:
+        name: uritools
+        image: mrtux/clean_uri
+        pull: true
+        state: started
+        detach: yes
+        ports:
+          - "{{ uritools_host_port }}:8080"
+        restart_policy: unless-stopped
 
-  - name: Setup proxy site uritools.n39.eu
-    include_role:
-      name: setup-http-site-proxy
-    vars:
-      site_name: uritools.n39.eu
-      proxy_port: "{{ uritools_host_port }}"
+    - name: Setup proxy site uritools.n39.eu
+      include_role:
+        name: setup-http-site-proxy
+      vars:
+        site_name: uritools.n39.eu
+        proxy_port: "{{ uritools_host_port }}"
 
-  - name: Ensure container for entities validation service is running
-    docker_container:
-      name: entities_validation_svc
-      image: netz39/entities_validation_svc:v1.0.0
-      pull: true
-      state: started
-      detach: yes
-      ports:
-        - "{{ entities_validation_svc_host_port }}:8080"
-      restart_policy: unless-stopped
+    - name: Ensure container for entities validation service is running
+      docker_container:
+        name: entities_validation_svc
+        image: netz39/entities_validation_svc:v1.0.0
+        pull: true
+        state: started
+        detach: yes
+        ports:
+          - "{{ entities_validation_svc_host_port }}:8080"
+        restart_policy: unless-stopped
 
-  - name: Setup proxy site entities-validation.svc.n39.eu
-    include_role:
-      name: setup-http-site-proxy
-    vars:
-      site_name: entities-validation.svc.n39.eu
-      proxy_port: "{{ entities_validation_svc_host_port }}"
+    - name: Setup proxy site entities-validation.svc.n39.eu
+      include_role:
+        name: setup-http-site-proxy
+      vars:
+        site_name: entities-validation.svc.n39.eu
+        proxy_port: "{{ entities_validation_svc_host_port }}"
 
-  - name: Ensure container for shlink is running
-    docker_container:
-      name: shlink
-      image: shlinkio/shlink:2.6.2
-      pull: true
-      state: started
-      detach: yes
-      ports:
-        - "{{ shlink_host_port }}:8080"
-      restart_policy: unless-stopped
-      env:
-        SHORT_DOMAIN_HOST: "{{ shlink_domain_name }}"
-        SHORT_DOMAIN_SCHEMA: https
-        GEOLITE_LICENSE_KEY: "{{ shlink_geolite_license_key }}"
+    - name: Ensure container for shlink is running
+      docker_container:
+        name: shlink
+        image: shlinkio/shlink:2.6.2
+        pull: true
+        state: started
+        detach: yes
+        ports:
+          - "{{ shlink_host_port }}:8080"
+        restart_policy: unless-stopped
+        env:
+          SHORT_DOMAIN_HOST: "{{ shlink_domain_name }}"
+          SHORT_DOMAIN_SCHEMA: https
+          GEOLITE_LICENSE_KEY: "{{ shlink_geolite_license_key }}"
 
-  - name: Setup proxy site {{ shlink_domain_name }}
-    include_role:
-      name: setup-http-site-proxy
-    vars:
-      site_name: "{{ shlink_domain_name }}"
-      proxy_port: "{{ shlink_host_port }}"
+    - name: Setup proxy site {{ shlink_domain_name }}
+      include_role:
+        name: setup-http-site-proxy
+      vars:
+        site_name: "{{ shlink_domain_name }}"
+        proxy_port: "{{ shlink_host_port }}"    
     
   handlers:
-  - name: restart mosquitto
-    docker_container:
-      name: mosquitto
-      state: started
-      restart: yes
+    - name: restart mosquitto
+      docker_container:
+        name: mosquitto
+        state: started
+        restart: yes

From be09ef57f61059ad6f79265aa6d8fedae7597af7 Mon Sep 17 00:00:00 2001
From: Alexander Dahl <alex@netz39.de>
Date: Sun, 30 Jan 2022 11:48:09 +0100
Subject: [PATCH 2/3] pottwal: Fix indentation

Please yamllint.

Fixes: 3aced1fe4623 ("Install gitea via ansible")
---
 pottwal.yml | 80 ++++++++++++++++++++++++++---------------------------
 1 file changed, 40 insertions(+), 40 deletions(-)

diff --git a/pottwal.yml b/pottwal.yml
index fe08604..390446d 100644
--- a/pottwal.yml
+++ b/pottwal.yml
@@ -28,48 +28,48 @@
 
   tasks:
 
-  - name: Check if gitea data dir exists
-    ansible.builtin.stat:
-      path: "/srv/data/gitea"
-    register: gitea_dir
-  - name: Fail if gitea data dir does not exist
-    ansible.builtin.fail:
-      msg: "Gitea data dir is missing, please restore from the backup!"
-    when: not gitea_dir.stat.exists
+    - name: Check if gitea data dir exists
+      ansible.builtin.stat:
+        path: "/srv/data/gitea"
+      register: gitea_dir
+    - name: Fail if gitea data dir does not exist
+      ansible.builtin.fail:
+        msg: "Gitea data dir is missing, please restore from the backup!"
+      when: not gitea_dir.stat.exists
 
-  # If port 2222 is changed here, it must also be adapted
-  # in the gitea config file (see application volume)!!
-  - name: Setup the docker container for gitea
-    docker_container:
-      name: gitea
-      image: "gitea/gitea:1.15.10"
-      pull: true
-      state: started
-      restart_policy: unless-stopped
-      detach: yes
-      ports:
-#      - 127.0.0.1:{{ gitea_host_port }}:3000
-      - "{{ gitea_host_port }}:3000"
-      - 2222:2222
-      env:
-        APP_NAME="Netz39 Gitea"
-        RUN_MODE="prod"
-        SSH_DOMAIN="gitea.n39.eu"
-        SSH_PORT="2222"
-        SSH_START_SERVER="false"
-        ROOT_URL="https://gitea.n39.eu"
-        DISABLE_REGISTRATION="true"
-        USER_UID=1000
-        USER_GID=1000
-      volumes:
-      - "/srv/data/gitea:/data:rw"
+    # If port 2222 is changed here, it must also be adapted
+    # in the gitea config file (see application volume)!!
+    - name: Setup the docker container for gitea
+      docker_container:
+        name: gitea
+        image: "gitea/gitea:1.15.10"
+        pull: true
+        state: started
+        restart_policy: unless-stopped
+        detach: yes
+        ports:
+#          - 127.0.0.1:{{ gitea_host_port }}:3000
+          - "{{ gitea_host_port }}:3000"
+          - 2222:2222
+        env:
+          APP_NAME="Netz39 Gitea"
+          RUN_MODE="prod"
+          SSH_DOMAIN="gitea.n39.eu"
+          SSH_PORT="2222"
+          SSH_START_SERVER="false"
+          ROOT_URL="https://gitea.n39.eu"
+          DISABLE_REGISTRATION="true"
+          USER_UID=1000
+          USER_GID=1000
+        volumes:
+          - "/srv/data/gitea:/data:rw"
 
-  - name: Setup proxy site gitea.n39.eu
-    include_role:
-      name: setup-http-site-proxy
-    vars:
-      site_name: "gitea.n39.eu"
-      proxy_port: "{{ gitea_host_port }}"
+    - name: Setup proxy site gitea.n39.eu
+      include_role:
+        name: setup-http-site-proxy
+      vars:
+        site_name: "gitea.n39.eu"
+        proxy_port: "{{ gitea_host_port }}"
 
     - name: Ensure apt-cacher container is running
       docker_container:

From 65bfb358ddbc724518a5cf970013314aeccd93d3 Mon Sep 17 00:00:00 2001
From: Alexander Dahl <alex@netz39.de>
Date: Sun, 30 Jan 2022 11:48:51 +0100
Subject: [PATCH 3/3] pottwal: Strip trailing whitespace

---
 pottwal.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pottwal.yml b/pottwal.yml
index 390446d..a4b48c2 100644
--- a/pottwal.yml
+++ b/pottwal.yml
@@ -216,8 +216,8 @@
         name: setup-http-site-proxy
       vars:
         site_name: "{{ shlink_domain_name }}"
-        proxy_port: "{{ shlink_host_port }}"    
-    
+        proxy_port: "{{ shlink_host_port }}"
+
   handlers:
     - name: restart mosquitto
       docker_container: