From 19bf20ac422e6291cd358f66249c902331b6749a Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Tue, 16 Jun 2015 20:57:25 +0000 Subject: [PATCH] Add github2fedmsg to the dynamic fedmsg endpoints stuff. --- inventory/group_vars/github2fedmsg | 14 ++++++++------ inventory/group_vars/github2fedmsg-stg | 14 ++++++++------ roles/fedmsg/base/tasks/main.yml | 2 +- .../base/templates/endpoints-github2fedmsg.py.j2 | 14 -------------- roles/github2fedmsg/tasks/main.yml | 12 +++++++++++- .../{files => templates}/github2fedmsg.conf | 2 +- 6 files changed, 29 insertions(+), 29 deletions(-) delete mode 100644 roles/fedmsg/base/templates/endpoints-github2fedmsg.py.j2 rename roles/github2fedmsg/{files => templates}/github2fedmsg.conf (81%) diff --git a/inventory/group_vars/github2fedmsg b/inventory/group_vars/github2fedmsg index 4274dc2152..90d2c36e6f 100644 --- a/inventory/group_vars/github2fedmsg +++ b/inventory/group_vars/github2fedmsg @@ -4,13 +4,15 @@ lvm_size: 20000 mem_size: 2048 num_cpus: 2 -# for systems that do not match the above - specify the same parameter in -# the host_vars/$hostname file +# Definining these vars has a number of effects +# 1) mod_wsgi is configured to use the vars for its own setup +# 2) iptables opens enough ports for all threads for fedmsg +# 3) roles/fedmsg/base/ declares enough fedmsg endpoints for all threads +wsgi_fedmsg_service: github2fedmsg +wsgi_procs: 2 +wsgi_threads: 2 -tcp_ports: [ 80, 443, - # These 16 ports are used by fedmsg. One for each wsgi thread. - 3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, - 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015] +tcp_ports: [ 80 ] # Neeed for rsync from log01 for logs. custom_rules: [ '-A INPUT -p tcp -m tcp -s 10.5.126.13 --dport 873 -j ACCEPT', '-A INPUT -p tcp -m tcp -s 192.168.1.59 --dport 873 -j ACCEPT' ] diff --git a/inventory/group_vars/github2fedmsg-stg b/inventory/group_vars/github2fedmsg-stg index aede5aa723..0eb48f2dfb 100644 --- a/inventory/group_vars/github2fedmsg-stg +++ b/inventory/group_vars/github2fedmsg-stg @@ -4,13 +4,15 @@ lvm_size: 20000 mem_size: 1024 num_cpus: 1 -# for systems that do not match the above - specify the same parameter in -# the host_vars/$hostname file +# Definining these vars has a number of effects +# 1) mod_wsgi is configured to use the vars for its own setup +# 2) iptables opens enough ports for all threads for fedmsg +# 3) roles/fedmsg/base/ declares enough fedmsg endpoints for all threads +wsgi_fedmsg_service: github2fedmsg +wsgi_procs: 2 +wsgi_threads: 2 -tcp_ports: [ 80, 443, - # These 16 ports are used by fedmsg. One for each wsgi thread. - 3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, - 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015] +tcp_ports: [ 80 ] # Neeed for rsync from log01 for logs. custom_rules: [ '-A INPUT -p tcp -m tcp -s 10.5.126.13 --dport 873 -j ACCEPT', '-A INPUT -p tcp -m tcp -s 192.168.1.59 --dport 873 -j ACCEPT' ] diff --git a/roles/fedmsg/base/tasks/main.yml b/roles/fedmsg/base/tasks/main.yml index d5775dea67..5d9586b9b7 100644 --- a/roles/fedmsg/base/tasks/main.yml +++ b/roles/fedmsg/base/tasks/main.yml @@ -39,6 +39,7 @@ with_items: - endpoints-nuancier.py - endpoints-kerneltest.py + - endpoints-github2fedmsg.py tags: - config - fedmsgdconfig @@ -71,7 +72,6 @@ - endpoints-mailman.py - endpoints-summershum.py - endpoints-fedimg.py - - endpoints-github2fedmsg.py - endpoints-bugzilla2fedmsg.py - relay.py - pkgdb.py diff --git a/roles/fedmsg/base/templates/endpoints-github2fedmsg.py.j2 b/roles/fedmsg/base/templates/endpoints-github2fedmsg.py.j2 deleted file mode 100644 index d821d3701e..0000000000 --- a/roles/fedmsg/base/templates/endpoints-github2fedmsg.py.j2 +++ /dev/null @@ -1,14 +0,0 @@ -{% if env == 'staging' %} -suffix = 'stg.phx2.fedoraproject.org' -{% else %} -suffix = 'phx2.fedoraproject.org' -{% endif %} - -config = dict( - endpoints={ - "github2fedmsg.github2fedmsg01": [ - "tcp://github2fedmsg01.%s:30%02i" % (suffix, i) - for i in range(16) - ], - }, -) diff --git a/roles/github2fedmsg/tasks/main.yml b/roles/github2fedmsg/tasks/main.yml index b015915db4..d6568d776a 100644 --- a/roles/github2fedmsg/tasks/main.yml +++ b/roles/github2fedmsg/tasks/main.yml @@ -10,12 +10,15 @@ - libsemanage-python tags: - packages + - github2fedmsg - name: make some directories file: dest="{{item}}" mode=0755 state=directory with_items: - /etc/github2fedmsg - /usr/share/github2fedmsg + tags: + - github2fedmsg - name: copy github2fedmsg app configuration template: > @@ -25,6 +28,7 @@ - github2fedmsg.ini tags: - config + - github2fedmsg notify: - restart apache @@ -36,17 +40,19 @@ - github2fedmsg.wsgi tags: - config + - github2fedmsg notify: - restart apache - name: copy github2fedmsg httpd config - copy: > + template: > src={{ item }} dest="/etc/httpd/conf.d/{{ item }}" owner=apache group=apache mode=0644 with_items: - github2fedmsg.conf tags: - config + - github2fedmsg notify: - restart apache @@ -57,8 +63,12 @@ owner=root group=root mode=0644 tags: - hotfix + - github2fedmsg notify: - restart apache - name: ensure selinux lets httpd talk to postgres seboolean: name=httpd_can_network_connect_db persistent=yes state=yes + tags: + - selinux + - github2fedmsg diff --git a/roles/github2fedmsg/files/github2fedmsg.conf b/roles/github2fedmsg/templates/github2fedmsg.conf similarity index 81% rename from roles/github2fedmsg/files/github2fedmsg.conf rename to roles/github2fedmsg/templates/github2fedmsg.conf index faff65d860..912418c68a 100644 --- a/roles/github2fedmsg/files/github2fedmsg.conf +++ b/roles/github2fedmsg/templates/github2fedmsg.conf @@ -1,7 +1,7 @@ Alias /static /usr/lib/python2.7/site-packages/github2fedmsg/static Alias /pngs /usr/share/badges/pngs -WSGIDaemonProcess github2fedmsg user=apache group=apache maximum-requests=1000 display-name=github2fedmsg processes=4 threads=4 +WSGIDaemonProcess github2fedmsg user=apache group=apache maximum-requests=1000 display-name=github2fedmsg processes={{wsgi_procs}} threads={{wsgi_threads}} WSGISocketPrefix run/wsgi WSGIRestrictStdout On WSGIRestrictSignal Off