First stab at the notifications backend role.

This commit is contained in:
Ralph Bean 2013-12-10 17:30:53 +00:00
parent b3f6aa6dac
commit 13330ad4eb
4 changed files with 83 additions and 1 deletions

View file

@ -59,7 +59,7 @@
roles:
- /srv/web/infra/ansible/roles/fedmsg-hub
#- /srv/web/infra/ansible/roles/notifs-backend
- /srv/web/infra/ansible/roles/notifs-backend
vars_files:
- /srv/web/infra/ansible/vars/global.yml

View file

@ -0,0 +1,16 @@
#!/usr/bin/python
# This file is managed by ansible.
#
# Its like "permanent hotfix" so that the fedmsg-hub loads
# the forward-compat sqlalchemy.
#
__requires__ = ['fedmsg', "sqlalchemy>=0.8"]
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('fedmsg', 'console_scripts', 'fedmsg-hub')()
)

View file

@ -0,0 +1,30 @@
---
# Configuration for the notifications consumer
- name: install needed packages
yum: pkg=$item state=installed
with_items:
- python-fmn-consumer
- python-psycopg2
- libsemanage-python
- name: copy database configuration
template: >
src=$item dest=/etc/fedmsg.d/$item
owner=fedmsg group=fedmsg mode=0600
with_items:
- fmn.consumer.py
notify:
- restart fedmsg-hub
# Here I'm "permanently" hotfixing the fedmsg-hub
# It needs to load the forward-compat sqlalchemy0.7 package from the get-go.
- name: copy over patched fedmsg-hub
copy: >
src=patched-fedmsg-hub dest=/usr/bin/fedmsg-hub
owner=root group=root mode=0755
tags:
- patches
- hotfix
notify:
- restart fedmsg-hub

View file

@ -0,0 +1,36 @@
{% if env == 'staging' %}
domain = "stg.fedoraproject.org"
ircnick = "fedora-notifstg"
{% else %}
domain = "fedoraproject.org"
ircnick = "fedora-notifs"
{% endif %}
base = "https://apps.%s/notifications/" % domain
config = {
# Consumer stuff
"fmn.consumer.enabled": True,
"fmn.sqlalchemy.uri": "postgresql://${notifs_db_user}:${notifs_db_password}@db-notifs/notifications",
## Backend stuff ##
# Email
"fmn.email.mailserver": "bastion.fedoraproject.org:25",
"fmn.email.from_address": "notifications@" + domain,
# IRC
"fmn.irc.network": "irc.freenode.net",
"fmn.irc.nickname": ircnick,
"fmn.irc.port": 6667,
"fmn.irc.timeout": 120,
# GCM - Android notifs
"fmn.gcm.post_url": "wat",
"fmn.gcm.api_key": "wat",
# Confirmation urls:
"fmn.base_url": base,
"fmn.acceptance_url": base + "confirm/accept/{secret}",
"fmn.rejection_url": base + "confirm/reject/{secret}",
"fmn.support_email": "notifications@" + domain,
}