nsupdate_web: use .conf extention for opensuse nginx 608/head
authorKyr Shatskyy <kyrylo.shatskyy@gmail.com>
Tue, 19 Mar 2019 18:18:06 +0000 (19:18 +0100)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Tue, 9 Feb 2021 22:36:22 +0000 (23:36 +0100)
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@gmail.com>
(cherry picked from commit cbb0a82a0380038d33d1b59eb65eed9622ec61d6)

roles/nsupdate_web/tasks/main.yml
roles/nsupdate_web/templates/nsupdate_web_nginx [deleted file]
roles/nsupdate_web/templates/nsupdate_web_nginx_opensuse_leap_15 [new file with mode: 0644]
roles/nsupdate_web/templates/nsupdate_web_nginx_ubuntu_16 [new file with mode: 0644]
roles/nsupdate_web/vars/opensuse_leap_15.yml
roles/nsupdate_web/vars/ubuntu_16.yml

index 591d9326d6a71a6fd6a5377dc749437df54be943..ae78e0ce5359c17d8782356cb9c24518e0f672a3 100644 (file)
@@ -89,7 +89,7 @@
 
 - name: Ship nginx configuration
   template:
-    src: nsupdate_web_nginx
+    src: "nsupdate_web_nginx_{{ ansible_distribution | lower | replace(' ', '_') }}_{{ ansible_distribution_major_version }}"
     dest: "{{ nginx_available }}/nsupdate_web"
     owner: root
     group: root
 - name: Enable our nginx configuration
   file:
     src: "{{ nginx_available }}/nsupdate_web"
-    dest: "{{ nginx_enabled }}/nsupdate_web"
+    dest: "{{ nginx_enabled }}/{{ nsupdate_web_conf }}"
     state: link
 
 - name: Enable and restart nginx
diff --git a/roles/nsupdate_web/templates/nsupdate_web_nginx b/roles/nsupdate_web/templates/nsupdate_web_nginx
deleted file mode 100644 (file)
index 0a73d8e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-server {
-    listen 80;
-
-    location = /update {
-        include proxy_params;
-        proxy_pass http://localhost:{{ nsupdate_web_port }};
-    }
-}
diff --git a/roles/nsupdate_web/templates/nsupdate_web_nginx_opensuse_leap_15 b/roles/nsupdate_web/templates/nsupdate_web_nginx_opensuse_leap_15
new file mode 100644 (file)
index 0000000..d9054d3
--- /dev/null
@@ -0,0 +1,7 @@
+server {
+    listen 80;
+
+    location = /update {
+        proxy_pass http://localhost:{{ nsupdate_web_port }};
+    }
+}
diff --git a/roles/nsupdate_web/templates/nsupdate_web_nginx_ubuntu_16 b/roles/nsupdate_web/templates/nsupdate_web_nginx_ubuntu_16
new file mode 100644 (file)
index 0000000..0a73d8e
--- /dev/null
@@ -0,0 +1,8 @@
+server {
+    listen 80;
+
+    location = /update {
+        include proxy_params;
+        proxy_pass http://localhost:{{ nsupdate_web_port }};
+    }
+}
index 9268a5740ba3bfe8a3f80a7af44ce0c9c62d55e1..2de26aa3dd79cf748ad971a167c36e89fc671099 100644 (file)
@@ -6,3 +6,4 @@ packages:
   - nginx
 nginx_available: "/etc/nginx"
 nginx_enabled: "/etc/nginx/vhosts.d"
+nsupdate_web_conf: "nsupdate_web.conf"
index d74459f00529eedaaedcd8d7433ba139fb60ff08..d4761cdbfbf12b8f8d74ac65012c672352220eba 100644 (file)
@@ -7,3 +7,4 @@ packages:
 
 nginx_available: "/etc/nginx/sites-available"
 nginx_enabled: "/etc/nginx/sites-enabled"
+nsupdate_web_conf: "nsupdate_web"