From 407658cbac84075a24d3b11496906729b970cfd1 Mon Sep 17 00:00:00 2001
From: keshavprasadms <msknext@gmail.com>
Date: Fri, 28 Jun 2019 16:01:45 +0530
Subject: [PATCH] fix: revert host network changes

---
 .../stack-proxy/templates/stack-proxy.yml     | 11 +---
 .../templates/stack-proxy.yml_host_network    | 60 +++++++++++++++++++
 2 files changed, 62 insertions(+), 9 deletions(-)
 create mode 100644 ansible/roles/stack-proxy/templates/stack-proxy.yml_host_network

diff --git a/ansible/roles/stack-proxy/templates/stack-proxy.yml b/ansible/roles/stack-proxy/templates/stack-proxy.yml
index cd155ba14..b325e4778 100644
--- a/ansible/roles/stack-proxy/templates/stack-proxy.yml
+++ b/ansible/roles/stack-proxy/templates/stack-proxy.yml
@@ -3,16 +3,9 @@ version: '3.3'
 services:
   proxy:
     image: "{{hub_org}}/{{image_name}}:{{image_tag}}"
-    # This is a workaround for remote ip address is not visible nginx
     ports:
-      - mode: host
-        target: 80
-        published: 80
-        protocol: TCP
-      - mode: host
-        target: 443
-        published: 443
-        protocol: TCP
+      - "443:443"
+      - "80:80"
     deploy:
       mode: global
       resources:
diff --git a/ansible/roles/stack-proxy/templates/stack-proxy.yml_host_network b/ansible/roles/stack-proxy/templates/stack-proxy.yml_host_network
new file mode 100644
index 000000000..1aeadca20
--- /dev/null
+++ b/ansible/roles/stack-proxy/templates/stack-proxy.yml_host_network
@@ -0,0 +1,60 @@
+version: '3.3'
+
+services:
+  proxy:
+    image: "{{hub_org}}/{{image_name}}:{{image_tag}}"
+    # This is a workaround for remote ip address is not visible nginx
+    ports:
+      - mode: host
+        target: 80
+        published: 80
+        protocol: TCP
+      - mode: host
+        target: 443
+        published: 443
+        protocol: TCP
+    deploy:
+      replicas: {{ proxy_replicas }}
+      resources:
+        reservations:
+          memory: "{{ proxy_reservation_memory }}"
+        limits:
+          memory: "{{ proxy_limit_memory }}"
+      update_config:
+        parallelism: 1
+        delay: 30s
+    secrets:
+{# Skip copying ssls for no domain configs #}
+{% if proto=='https' %}
+      - site.key
+      - site.crt
+{% endif %}
+      - prom_admin_creds
+    configs:
+      - source: nginx.conf
+        target: /etc/nginx/nginx.conf
+      - source: proxy-default.conf
+        target: /etc/nginx/conf.d/default.conf
+    networks:
+      - application_default
+
+secrets:
+{# Skip copying ssls for no domain configs #}
+{% if proto=='https' %}
+  site.key:
+    external: true
+  site.crt:
+    external: true
+{% endif %}
+  prom_admin_creds:
+    external: true
+
+configs:
+  nginx.conf:
+    external: true
+  proxy-default.conf:
+    external: true
+
+networks:
+  application_default:
+    external: true
-- 
GitLab