ctucx.git: ansible-configs

My personal ansible roles and playbooks [deprecated in favor of nixos]

commit ea80fe8e53597fea0fdcd4fabec139d7873768b2
parent 56299c3d6b2306f1cdcf1e28d6ab860856522112
Author: Leah (ctucx) <leah@ctu.cx>
Date: Mon, 5 Apr 2021 19:59:26 +0200

move prometheus. grafana, fritzboxExporter and frps from wanderduene to osterei
3 files changed, 322 insertions(+), 165 deletions(-)
M
configuration/osterei.yml
|
159
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
M
configuration/wanderduene.yml
|
309
++++++++++++++++++++++++++++++++++++++++---------------------------------------
M
playbook.yml
|
19
+++++++++----------
diff --git a/configuration/osterei.yml b/configuration/osterei.yml
@@ -56,7 +56,7 @@ network:
       ipv4:
         address: 185.232.70.80
         gateway: 185.232.68.1
-        netmask: 255.255.255.0
+        netmask: 255.255.252.0
       ipv6:
         address: 2a03:4000:4e:af1::1
         gateway: fe80::1

@@ -101,6 +101,25 @@ services:
       osterei.ctu.cx:
         renewTasks:
           - sudo rc-service nginx restart
+      fbexporter.ctu.cx:
+        renewTasks:
+          - sudo rc-service nginx restart
+      prometheus.ctu.cx:
+        renewTasks:
+          - sudo rc-service nginx restart
+      grafana.ctu.cx:
+        renewTasks:
+          - sudo rc-service nginx restart
+      frp.ctu.cx:
+        extraDnsNames:
+          - stasicontainer-mac.frp.ctu.cx
+          - stasicontainer.frp.ctu.cx
+          - coladose.frp.ctu.cx
+          - toaster.frp.ctu.cx
+          - isa.frp.ctu.cx
+          - isa-mac.frp.ctu.cx
+        renewTasks:
+          - sudo rc-service nginx restart
 
   nginx:
     enable: true

@@ -118,3 +137,141 @@ services:
         locations:
           - path: /node-exporter
             proxy: http://127.0.0.1:9100/metrics
+
+  prometheus:
+    enable: true
+    nginx:
+      enable: true
+      domain: "prometheus.ctu.cx"
+      sslOnly: true
+      ssl:
+        enable: true
+        cert: "/var/lib/acme-redirect/live/prometheus.ctu.cx/fullchain"
+        privkey: "/var/lib/acme-redirect/live/prometheus.ctu.cx/privkey"
+    config:
+      global:
+        scrape_interval: 20s
+        evaluation_interval: 1m
+      scrape_configs:
+        - job_name: 'prometheus'
+          static_configs:
+          - targets: ['127.0.0.1:9090']
+
+        - job_name: 'node-exporter'
+          metrics_path: '/node-exporter'
+          scheme: 'https'
+          scrape_interval: 30s
+          static_configs:
+          - targets: [
+            'wanderduene.ctu.cx',
+            'taurus.ctu.cx',
+            'quitschi.ctu.cx',
+            'osterei.ctu.cx',
+            'desastro.ctu.cx',
+            'lollo.ctu.cx',
+            'joguhrtbecher.ctu.cx',
+            'repo.f2k1.de',
+            'stasicontainer.home.ctu.cx',
+            'toaster.frp.ctu.cx',
+            'luna.f2k1.de'
+          ]
+
+        - job_name: 'fritzbox-exporter'
+          metrics_path: '/metrics'
+          scheme: 'https'
+          scrape_interval: 30s
+          static_configs:
+          - targets: [
+            'fbexporter.ctu.cx',
+            'fbexporter.f2k1.de'
+          ]
+
+  grafana:
+    enable: true
+    configFile: config-files/wanderduene/grafana/grafana.ini
+    provisioning:
+      enable: true
+      dashboards: config-files/wanderduene/grafana/dashboards
+      datasources:
+        - name: Prometheus
+          type: prometheus
+          access: proxy
+          orgId: 1
+          url: http://127.0.0.1:9090
+          isDefault: true
+          jsonData:
+             httpMode: GET
+          version: 1
+          editable: false
+
+        - name: InfluxDB (Powermeters)
+          type: influxdb
+          access: proxy
+          orgId: 1
+          url: https://influx.home.ctu.cx
+          database: powermeters
+#          secureJsonData:
+#            token: "{{ lookup('diskcache', 'passwordstore', 'Server/lollo/influx/smartied.token')}}"
+#          jsonData:
+#            version: Flux
+#            organization: organization
+#            defaultBucket: bucket
+#            tlsSkipVerify: true
+          jsonData:
+            httpMode: GET
+            httpHeaderName1: "Authorization"
+          secureJsonData:
+            httpHeaderValue1: "Token {{ lookup('diskcache', 'passwordstore', 'Server/lollo/influx/smartied.token')}}"
+          version: 3
+          editable: false
+
+        - name: InfluxDB (Sensors)
+          type: influxdb
+          access: proxy
+          orgId: 1
+          url: https://influx.home.ctu.cx
+          database: sensors
+#          secureJsonData:
+#            token: "{{ lookup('diskcache', 'passwordstore', 'Server/lollo/influx/smartied.token')}}"
+#          jsonData:
+#            version: Flux
+#            organization: organization
+#            defaultBucket: bucket
+#            tlsSkipVerify: true
+          jsonData:
+            httpMode: GET
+            httpHeaderName1: "Authorization"
+          secureJsonData:
+            httpHeaderValue1: "Token {{ lookup('diskcache', 'passwordstore', 'Server/lollo/influx/smartied.token')}}"
+          version: 3
+          editable: false
+
+    nginx:
+      enable: true
+      domain: "grafana.ctu.cx"
+      sslOnly: true
+      ssl:
+        enable: true
+        cert: "/var/lib/acme-redirect/live/grafana.ctu.cx/fullchain"
+        privkey: "/var/lib/acme-redirect/live/grafana.ctu.cx/privkey"
+
+  frps:
+    enable: true
+    token: "{{ lookup('diskcache', 'passwordstore', 'Server/{{system.hostname}}/frps/token returnall=true')}}"
+    port: 5050
+    vhostDomain: "frp.ctu.cx"
+    vhostPort: 8088
+    nginx:
+      enable: true
+      sslOnly: true
+      ssl:
+        enable: true
+        cert: "/var/lib/acme-redirect/live/frp.ctu.cx/fullchain"
+        privkey: "/var/lib/acme-redirect/live/frp.ctu.cx/privkey"
+      vhosts:
+        - stasicontainer-mac
+        - stasicontainer
+        - coladose
+        - toaster
+        - isa
+        - isa-mac
diff --git a/configuration/wanderduene.yml b/configuration/wanderduene.yml
@@ -161,28 +161,28 @@ services:
       cgit.ctu.cx:
         renewTasks:
           - sudo rc-service nginx restart
-      fbexporter.ctu.cx:
-        renewTasks:
-          - sudo rc-service nginx restart
-      prometheus.ctu.cx:
-        renewTasks:
-          - sudo rc-service nginx restart
-      grafana.ctu.cx:
-        renewTasks:
-          - sudo rc-service nginx restart
+#      fbexporter.ctu.cx:
+#        renewTasks:
+#          - sudo rc-service nginx restart
+#      prometheus.ctu.cx:
+#        renewTasks:
+#          - sudo rc-service nginx restart
+#      grafana.ctu.cx:
+#        renewTasks:
+#          - sudo rc-service nginx restart
       pleroma.ctu.cx:
         renewTasks:
           - sudo rc-service nginx restart
-      frp.ctu.cx:
-        extraDnsNames:
-          - stasicontainer-mac.frp.ctu.cx
-          - stasicontainer.frp.ctu.cx
-          - coladose.frp.ctu.cx
-          - toaster.frp.ctu.cx
-          - isa.frp.ctu.cx
-          - isa-mac.frp.ctu.cx
-        renewTasks:
-          - sudo rc-service nginx restart
+#      frp.ctu.cx:
+#        extraDnsNames:
+#          - stasicontainer-mac.frp.ctu.cx
+#          - stasicontainer.frp.ctu.cx
+#          - coladose.frp.ctu.cx
+#          - toaster.frp.ctu.cx
+#          - isa.frp.ctu.cx
+#          - isa-mac.frp.ctu.cx
+#        renewTasks:
+#          - sudo rc-service nginx restart
       oeffi.ctu.cx:
         renewTasks:
           - sudo rc-service nginx restart

@@ -436,98 +436,99 @@ services:
           auth_basic_user_file /etc/nginx/passwd/synapse;
         }
       "
-  prometheus:
-    enable: true
-    nginx:
-      enable: true
-      domain: "prometheus.ctu.cx"
-      sslOnly: true
-      ssl:
-        enable: true
-        cert: "/var/lib/acme-redirect/live/prometheus.ctu.cx/fullchain"
-        privkey: "/var/lib/acme-redirect/live/prometheus.ctu.cx/privkey"
-    config:
-      global:
-        scrape_interval: 20s
-        evaluation_interval: 1m
-      scrape_configs:
-        - job_name: 'prometheus'
-          static_configs:
-          - targets: ['127.0.0.1:9090']
-
-        - job_name: 'node-exporter'
-          metrics_path: '/node-exporter'
-          scheme: 'https'
-          scrape_interval: 30s
-          static_configs:
-          - targets: [
-            'wanderduene.ctu.cx',
-            'taurus.ctu.cx',
-            'quitschi.ctu.cx',
-            'desastro.ctu.cx',
-            'lollo.ctu.cx',
-            'joguhrtbecher.ctu.cx',
-            'repo.f2k1.de',
-            'stasicontainer.home.ctu.cx',
-            'toaster.frp.ctu.cx',
-            'luna.f2k1.de'
-          ]
+#  prometheus:
+#    enable: true
+#    nginx:
+#      enable: true
+#      domain: "prometheus.ctu.cx"
+#      sslOnly: true
+#      ssl:
+#        enable: true
+#        cert: "/var/lib/acme-redirect/live/prometheus.ctu.cx/fullchain"
+#        privkey: "/var/lib/acme-redirect/live/prometheus.ctu.cx/privkey"
+#    config:
+#      global:
+#        scrape_interval: 20s
+#        evaluation_interval: 1m
+#      scrape_configs:
+#        - job_name: 'prometheus'
+#          static_configs:
+#          - targets: ['127.0.0.1:9090']
 
-        - job_name: 'fritzbox-exporter'
-          metrics_path: '/metrics'
-          scheme: 'https'
-          scrape_interval: 30s
-          static_configs:
-          - targets: [
-            'fbexporter.ctu.cx',
-            'fbexporter.f2k1.de'
-          ]
+#        - job_name: 'node-exporter'
+#          metrics_path: '/node-exporter'
+#          scheme: 'https'
+#          scrape_interval: 30s
+#          static_configs:
+#          - targets: [
+#            'wanderduene.ctu.cx',
+#            'taurus.ctu.cx',
+#            'quitschi.ctu.cx',
+#            'osterei.ctu.cx',
+#            'desastro.ctu.cx',
+#            'lollo.ctu.cx',
+#            'joguhrtbecher.ctu.cx',
+#            'repo.f2k1.de',
+#            'stasicontainer.home.ctu.cx',
+#            'toaster.frp.ctu.cx',
+#            'luna.f2k1.de'
+#          ]
 
-  grafana:
-    enable: true
-    configFile: config-files/wanderduene/grafana/grafana.ini
-    provisioning:
-      enable: true
-      dashboards: config-files/wanderduene/grafana/dashboards
-      datasources:
-        - name: Prometheus
-          type: prometheus
-          access: proxy
-          orgId: 1
-          url: http://127.0.0.1:9090
-          isDefault: true
-          jsonData:
-             httpMode: GET
-          version: 1
-          editable: false
+#        - job_name: 'fritzbox-exporter'
+#          metrics_path: '/metrics'
+#          scheme: 'https'
+#          scrape_interval: 30s
+#          static_configs:
+#          - targets: [
+#            'fbexporter.ctu.cx',
+#            'fbexporter.f2k1.de'
+#          ]
 
-        - name: InfluxDB (Powermeters)
-          type: influxdb
-          access: proxy
-          orgId: 1
-          url: https://influx.home.ctu.cx
-          database: powermeters
-#          secureJsonData:
-#            token: "{{ lookup('diskcache', 'passwordstore', 'Server/lollo/influx/smartied.token')}}"
+#  grafana:
+#    enable: true
+#    configFile: config-files/wanderduene/grafana/grafana.ini
+#    provisioning:
+#      enable: true
+#      dashboards: config-files/wanderduene/grafana/dashboards
+#      datasources:
+#        - name: Prometheus
+#          type: prometheus
+#          access: proxy
+#          orgId: 1
+#          url: http://127.0.0.1:9090
+#          isDefault: true
 #          jsonData:
-#            version: Flux
-#            organization: organization
-#            defaultBucket: bucket
-#            tlsSkipVerify: true
-          jsonData:
-            httpMode: GET
-            httpHeaderName1: "Authorization"
-          secureJsonData:
-            httpHeaderValue1: "Token {{ lookup('diskcache', 'passwordstore', 'Server/lollo/influx/smartied.token')}}"
-          version: 3
-          editable: false
-
-        - name: InfluxDB (Sensors)
-          type: influxdb
-          access: proxy
-          orgId: 1
-          url: https://influx.home.ctu.cx
-          database: sensors
+#             httpMode: GET
+#          version: 1
+#          editable: false
+#
+#        - name: InfluxDB (Powermeters)
+#          type: influxdb
+#          access: proxy
+#          orgId: 1
+#          url: https://influx.home.ctu.cx
+#          database: powermeters
+##          secureJsonData:
+##            token: "{{ lookup('diskcache', 'passwordstore', 'Server/lollo/influx/smartied.token')}}"
+##          jsonData:
+##            version: Flux
+##            organization: organization
+##            defaultBucket: bucket
+##            tlsSkipVerify: true
+#          jsonData:
+#            httpMode: GET
+#            httpHeaderName1: "Authorization"
+#          secureJsonData:
+#            httpHeaderValue1: "Token {{ lookup('diskcache', 'passwordstore', 'Server/lollo/influx/smartied.token')}}"
+#          version: 3
+#          editable: false
+#
+#        - name: InfluxDB (Sensors)
+#          type: influxdb
+#          access: proxy
+#          orgId: 1
+#          url: https://influx.home.ctu.cx
+#          database: sensors
 #          secureJsonData:
 #            token: "{{ lookup('diskcache', 'passwordstore', 'Server/lollo/influx/smartied.token')}}"
 #          jsonData:

@@ -535,22 +536,22 @@ services:
 #            organization: organization
 #            defaultBucket: bucket
 #            tlsSkipVerify: true
-          jsonData:
-            httpMode: GET
-            httpHeaderName1: "Authorization"
-          secureJsonData:
-            httpHeaderValue1: "Token {{ lookup('diskcache', 'passwordstore', 'Server/lollo/influx/smartied.token')}}"
-          version: 3
-          editable: false
-
-    nginx:
-      enable: true
-      domain: "grafana.ctu.cx"
-      sslOnly: true
-      ssl:
-        enable: true
-        cert: "/var/lib/acme-redirect/live/grafana.ctu.cx/fullchain"
-        privkey: "/var/lib/acme-redirect/live/grafana.ctu.cx/privkey"
+#          jsonData:
+#            httpMode: GET
+#            httpHeaderName1: "Authorization"
+#          secureJsonData:
+#            httpHeaderValue1: "Token {{ lookup('diskcache', 'passwordstore', 'Server/lollo/influx/smartied.token')}}"
+#          version: 3
+#          editable: false
+#
+#    nginx:
+#      enable: true
+#      domain: "grafana.ctu.cx"
+#      sslOnly: true
+#      ssl:
+#        enable: true
+#        cert: "/var/lib/acme-redirect/live/grafana.ctu.cx/fullchain"
+#        privkey: "/var/lib/acme-redirect/live/grafana.ctu.cx/privkey"
 
   pleroma:
     enable: true

@@ -565,34 +566,34 @@ services:
         cert: "/var/lib/acme-redirect/live/pleroma.ctu.cx/fullchain"
         privkey: "/var/lib/acme-redirect/live/pleroma.ctu.cx/privkey"
 
-  fritzboxExporter:
-    enable: true
-    nginx:
-      enable: true
-      domain: "fbexporter.ctu.cx"
-      sslOnly: true
-      ssl:
-        enable: true
-        cert: "/var/lib/acme-redirect/live/fbexporter.ctu.cx/fullchain"
-        privkey: "/var/lib/acme-redirect/live/fbexporter.ctu.cx/privkey"
-
-  frps:
-    enable: true
-    token: "{{ lookup('diskcache', 'passwordstore', 'Server/{{system.hostname}}/frps/token returnall=true')}}"
-    port: 5050
-    vhostDomain: "frp.ctu.cx"
-    vhostPort: 8088
-    nginx:
-      enable: true
-      sslOnly: true
-      ssl:
-        enable: true
-        cert: "/var/lib/acme-redirect/live/frp.ctu.cx/fullchain"
-        privkey: "/var/lib/acme-redirect/live/frp.ctu.cx/privkey"
-      vhosts:
-        - stasicontainer-mac
-        - stasicontainer
-        - coladose
-        - toaster
-        - isa
-        - isa-mac
+#  fritzboxExporter:
+#    enable: true
+#    nginx:
+#      enable: true
+#      domain: "fbexporter.ctu.cx"
+#      sslOnly: true
+#      ssl:
+#        enable: true
+#        cert: "/var/lib/acme-redirect/live/fbexporter.ctu.cx/fullchain"
+#        privkey: "/var/lib/acme-redirect/live/fbexporter.ctu.cx/privkey"
+#
+#  frps:
+#    enable: true
+#    token: "{{ lookup('diskcache', 'passwordstore', 'Server/{{system.hostname}}/frps/token returnall=true')}}"
+#    port: 5050
+#    vhostDomain: "frp.ctu.cx"
+#    vhostPort: 8088
+#    nginx:
+#      enable: true
+#      sslOnly: true
+#      ssl:
+#        enable: true
+#        cert: "/var/lib/acme-redirect/live/frp.ctu.cx/fullchain"
+#        privkey: "/var/lib/acme-redirect/live/frp.ctu.cx/privkey"
+#      vhosts:
+#        - stasicontainer-mac
+#        - stasicontainer
+#        - coladose
+#        - toaster
+#        - isa
+#        - isa-mac
diff --git a/playbook.yml b/playbook.yml
@@ -42,14 +42,6 @@
       tags: pleroma
     - role: synapse
       tags: synapse
-    - role: prometheus 
-      tags: prometheus
-    - role: grafana
-      tags: grafana
-    - role: fritzboxExporter
-      tags: fritzboxExporter
-    - role: frps
-      tags: [ frp, frps ]
     - role: backup
       tags: backup
 

@@ -223,4 +215,12 @@
     - role: vnstat
       tags: vnstat
     - role: nginx
-      tags: nginx-
\ No newline at end of file
+      tags: nginx
+    - role: prometheus 
+      tags: prometheus
+    - role: grafana
+      tags: grafana
+    - role: fritzboxExporter
+      tags: fritzboxExporter
+    - role: frps
+      tags: [ frp, frps ]