Andrew Bogott has submitted this change and it was merged.

Change subject: dynamicproxy: Separate api configuration into own file
......................................................................


dynamicproxy: Separate api configuration into own file

Change-Id: Ifd671fe6305501826893979b2f0172a7c7ccd474
---
M modules/dynamicproxy/manifests/api.pp
A modules/dynamicproxy/templates/api.conf
M modules/dynamicproxy/templates/proxy.conf
3 files changed, 26 insertions(+), 14 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/dynamicproxy/manifests/api.pp 
b/modules/dynamicproxy/manifests/api.pp
index 3138306..7529308 100644
--- a/modules/dynamicproxy/manifests/api.pp
+++ b/modules/dynamicproxy/manifests/api.pp
@@ -1,4 +1,17 @@
 class dynamicproxy::api {
+    file { '/etc/nginx/sites-available/api':
+        ensure => 'file',
+        content => template('dynamicproxy/api.conf'),
+        require => Package['nginx-extras'],
+        notify => Service['nginx']
+    }
+
+    file { '/etc/nginx/sites-enabled/api':
+        ensure => 'link',
+        target => '/etc/nginx/sites-available/api',
+        require => File['/etc/nginx/sites-available/api']
+    }
+
     package { 'python-flask':
         ensure => 'latest',
         require => Class['misc::labsdebrepo'],
diff --git a/modules/dynamicproxy/templates/api.conf 
b/modules/dynamicproxy/templates/api.conf
new file mode 100644
index 0000000..7d7d010
--- /dev/null
+++ b/modules/dynamicproxy/templates/api.conf
@@ -0,0 +1,13 @@
+# Run the proxy api on port 5668; a firewall rule
+# will open this only for wikitech.
+server {
+    listen   5668;
+
+    location /dynamicproxy-api {
+        include uwsgi_params;
+        uwsgi_pass unix:///tmp/uwsgi.sock;
+        uwsgi_param SCRIPT_NAME /dynamicproxy-api;
+        uwsgi_modifier1 30;
+    }
+}
+
diff --git a/modules/dynamicproxy/templates/proxy.conf 
b/modules/dynamicproxy/templates/proxy.conf
index bb1f8e9..7ae87bb 100644
--- a/modules/dynamicproxy/templates/proxy.conf
+++ b/modules/dynamicproxy/templates/proxy.conf
@@ -5,20 +5,6 @@
         ''      close;
 }
 
-# Run the proxy api on port 5668; a firewall rule
-# will open this only for wikitech.
-server {
-    listen   5668;
-
-    location /dynamicproxy-api {
-        include uwsgi_params;
-        uwsgi_pass unix:///tmp/uwsgi.sock;
-        uwsgi_param SCRIPT_NAME /dynamicproxy-api;
-        uwsgi_modifier1 30;
-    }
-}
-
-
 <%- if !@notfound_servers.empty? -%>
 upstream notfound {
     <%- @notfound_servers.each do |server| -%>

-- 
To view, visit https://gerrit.wikimedia.org/r/97712
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd671fe6305501826893979b2f0172a7c7ccd474
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda <[email protected]>
Gerrit-Reviewer: Andrew Bogott <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to