ctucx.git: ansible-configs

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

commit 9c230bce7324afe11e145ae4e7f8123c6e7ddc3e
parent 02c7f32a766bd57fe9349016da415044ac78884d
Author: Leah (ctucx) <leah@ctu.cx>
Date: Sat, 27 Feb 2021 14:37:48 +0100

roles/influx: remove basic auth
3 files changed, 4 insertions(+), 25 deletions(-)
diff --git a/roles/influxdb/tasks/checks.yml b/roles/influxdb/tasks/checks.yml
@@ -11,12 +11,6 @@
     - services.influxdb.nginx.enable is true
     - services.influxdb.nginx.domain is not defined
 
-- fail: msg="Option 'services.influxdb.nginx.enableBasicAuth' has to be set when using nginx!"
-  when:
-    - services.influxdb.nginx.enable is defined
-    - services.influxdb.nginx.enable is true
-    - services.influxdb.nginx.enableBasicAuth is not defined
-
 - fail: msg="Option 'services.influxdb.nginx.basicAuthFileContent' has to be set when using option 'services.influxdb.nginx.enableBasicAuth'!"
   when:
     - services.influxdb.nginx.enable is defined
diff --git a/roles/influxdb/tasks/nginx.yml b/roles/influxdb/tasks/nginx.yml
@@ -1,15 +1,5 @@
 ---
 
-- name: "Create file: /etc/nginx/passwd/influxdb"
-  copy:
-    content: "{{ services.influxdb.nginx.basicAuthFileContent }}"
-    dest: /etc/nginx/passwd/influxdb
-    mode: 0600
-    owner: "{{ services.nginx.user | default('http') }}"
-    group: "{{ services.nginx.group | default('http') }}"
-  when:
-    - services.influxdb.nginx.basicAuthFileContent is defined
-
 - name: "[nginx] Create vhost" 
   template:
     src: nginx-vhost.conf.j2
diff --git a/roles/influxdb/templates/nginx-vhost.conf.j2 b/roles/influxdb/templates/nginx-vhost.conf.j2
@@ -16,10 +16,11 @@ server {
 		{% endif %}
 
 		proxy_pass http://127.0.0.1:8086/;
+#		include /etc/nginx/proxy.conf;
+
 		proxy_redirect default;
 		proxy_http_version 1.1;
 		proxy_set_header Connection '';
-		proxy_set_header Authorization '';
 
 		proxy_set_header Host $host;
 		proxy_set_header X-Real-IP $remote_addr;

@@ -46,16 +47,11 @@ server {
 	server_name {{ services.influxdb.nginx.domain }};
 
 	location / {
-		{% if services.influxdb.nginx.enableBasicAuth is true %}
-		auth_basic 'Needs Autherization';
-		auth_basic_user_file /etc/nginx/passwd/influxdb;
-		{% endif %}
-
 		proxy_pass http://127.0.0.1:8086/;
+#		include /etc/nginx/proxy.conf;
 		proxy_redirect default;
 		proxy_http_version 1.1;
 		proxy_set_header Connection '';
-		proxy_set_header Authorization '';
 
 		proxy_set_header Host $host;
 		proxy_set_header X-Real-IP $remote_addr;

@@ -65,7 +61,6 @@ server {
 		proxy_send_timeout     240;
 		proxy_read_timeout     240;
 		expires -1;
-		add_header Cache-Control private;
-	}
+		add_header Cache-Control private;	}
 }
 {% endif %}