Yuvipanda has submitted this change and it was merged.

Change subject: ircyall: Introduce module for web2irc relay
......................................................................


ircyall: Introduce module for web2irc relay

Change-Id: I54b9e730d2e12d310c1b1162417d33d8b00284a9
---
A manifests/role/ircyall.pp
A modules/ircyall/files/ircyall-upstart.conf
A modules/ircyall/manifests/init.pp
A modules/ircyall/templates/ircyall-web.nginx.erb
4 files changed, 91 insertions(+), 0 deletions(-)

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



diff --git a/manifests/role/ircyall.pp b/manifests/role/ircyall.pp
new file mode 100644
index 0000000..ea3fd6a
--- /dev/null
+++ b/manifests/role/ircyall.pp
@@ -0,0 +1,6 @@
+# = Class: role::ircyall
+#
+# Sets up an ircyall instance
+class role::ircyall {
+    include ::ircyall
+}
diff --git a/modules/ircyall/files/ircyall-upstart.conf 
b/modules/ircyall/files/ircyall-upstart.conf
new file mode 100644
index 0000000..ffa80c8
--- /dev/null
+++ b/modules/ircyall/files/ircyall-upstart.conf
@@ -0,0 +1,14 @@
+description "Relay for ircyall, notifies to IRC from the web"
+
+start on runlevel [2345]
+stop on runlevel [!2345]
+
+setuid www-data
+setgid www-data
+
+respawn
+respawn limit 10 5
+
+script
+    /usr/bin/ircyall
+end script
diff --git a/modules/ircyall/manifests/init.pp 
b/modules/ircyall/manifests/init.pp
new file mode 100644
index 0000000..310536c
--- /dev/null
+++ b/modules/ircyall/manifests/init.pp
@@ -0,0 +1,59 @@
+# = Class: ircyall
+#
+# Sets up an ircyall instance that can take authenticated
+# requests via HTTP and relay them to different IRC channels.
+#
+# = Parameters
+# [*web_port*]
+#   Port number to use for ircyall web listener
+class ircyall(
+    $web_port = 80,
+) {
+
+    class { 'redis':
+        persist => 'aof',
+    }
+
+    package { 'uwsgi-plugin-python3':
+        ensure => present,
+    }
+
+    package { [
+        'python3-flask',
+        'python3-redis',
+        'python3-irc3',
+        'python3-asyncio-redis',
+        'python3-ircyall',
+    ]:
+        ensure => latest
+    }
+
+    uwsgi::app { 'ircyall-web':
+        settings => {
+            uwsgi => {
+                'plugins'   => 'python3',
+                'master'    => true,
+                'processes' => 8,
+                'module'    => 'ircyall.web2redis',
+                'callable'  => 'app',
+                'socket'    => '/run/uwsgi/ircyall-web.sock',
+            }
+        },
+        require => Package['python3-ircyall', 'uwsgi-plugin-python3'],
+    }
+
+    nginx::site { 'ircyall-web-nginx':
+        require => Uwsgi::App['ircyall-web'],
+        content => template('ircyall/ircyall-web.nginx.erb'),
+    }
+
+    file { '/etc/init/ircyall.conf':
+        ensure => present,
+        source => 'puppet:///modules/ircyall/ircyall-upstart.conf',
+    }
+
+    service { 'ircyall':
+        ensure  => running,
+        require => [Package['python3-ircyall'], File['/etc/init/ircyall.conf']]
+    }
+}
diff --git a/modules/ircyall/templates/ircyall-web.nginx.erb 
b/modules/ircyall/templates/ircyall-web.nginx.erb
new file mode 100644
index 0000000..d1e5868
--- /dev/null
+++ b/modules/ircyall/templates/ircyall-web.nginx.erb
@@ -0,0 +1,12 @@
+upstream quarry {
+    server unix:/run/uwsgi/ircyall-web.sock;
+}
+
+server {
+    listen <%= @web_port %>;
+
+    location / {
+        include uwsgi_params;
+        uwsgi_pass quarry;
+    }
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I54b9e730d2e12d310c1b1162417d33d8b00284a9
Gerrit-PatchSet: 8
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda <yuvipa...@gmail.com>
Gerrit-Reviewer: Yuvipanda <yuvipa...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to