From dbf61f1fbf233e3a5e39608abcf114873b96f602 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Tue, 10 Dec 2013 19:41:42 +0000 Subject: [PATCH] Some configuration for the fmn frontend. --- roles/notifs-frontend/files/fmn.web.wsgi | 16 ++++++++++++++++ roles/notifs-frontend/tasks/main.yml | 16 +++++++++++++--- roles/notifs-frontend/templates/fmn.web.cfg | 18 ++++++++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 roles/notifs-frontend/files/fmn.web.wsgi create mode 100644 roles/notifs-frontend/templates/fmn.web.cfg diff --git a/roles/notifs-frontend/files/fmn.web.wsgi b/roles/notifs-frontend/files/fmn.web.wsgi new file mode 100644 index 0000000000..358d4b695e --- /dev/null +++ b/roles/notifs-frontend/files/fmn.web.wsgi @@ -0,0 +1,16 @@ +#-*- coding: utf-8 -*- + +# The three lines below are required to run on EL6 as EL6 has +# two possible version of python-sqlalchemy and python-jinja2 +# These lines make sure the application uses the correct version. +import __main__ +__main__.__requires__ = ['SQLAlchemy >= 0.7', 'jinja2 >= 2.4'] +import pkg_resources + +import os +os.environ['FMN_WEB_CONFIG'] = '/etc/fmn.web.cfg' + +# The most import line to make the wsgi working +from fmn.web.app import app as application +# Dangerous.. only use when testing. +#application.debug = True diff --git a/roles/notifs-frontend/tasks/main.yml b/roles/notifs-frontend/tasks/main.yml index 3cf3c14041..8278b84817 100644 --- a/roles/notifs-frontend/tasks/main.yml +++ b/roles/notifs-frontend/tasks/main.yml @@ -19,10 +19,20 @@ - name: copy fmn httpd config copy: > - src={{ item }} dest=/etc/httpd/conf.d/{{ item }} + src=fmn.web.conf dest=/etc/httpd/conf.d/fmn.web.conf owner=apache group=apache mode=0644 - with_items: - - fmn.web.conf + notify: + - restart apache + +- name: copy custom wsgi file + copy: src=fmn.web.wsgi dest=/usr/share/fmn/fmn.web.wsgi mode=0644 + notify: + - restart apache + +- name: copy app configuration + template: > + src=fmn.web.cfg dest=/etc/fmn.web.cfg + owner=root group=apache mode=0640 notify: - restart apache diff --git a/roles/notifs-frontend/templates/fmn.web.cfg b/roles/notifs-frontend/templates/fmn.web.cfg new file mode 100644 index 0000000000..76d0eb28eb --- /dev/null +++ b/roles/notifs-frontend/templates/fmn.web.cfg @@ -0,0 +1,18 @@ +# See /etc/fedmsg.d/fmn.web.py for the db url + +SECRET_KEY = {{ notifs_secret_key }} + +FMN_ADMINS = ['ralph.id.fedoraproject.org'] + +{% if env == 'staging' %} +FAS_OPENID_CHECK_CERT = False +FMN_FEDORA_OPENID = 'https://id.stg.fedoraproject.org' +{% else %} +FAS_OPENID_CHECK_CERT = True +FMN_FEDORA_OPENID = 'https://id.fedoraproject.org' +{% endif %} + +FMN_ALLOW_FAS_OPENID = True +FMN_ALLOW_GOOGLE_OPENID = True +FMN_ALLOW_YAHOO_OPENID = True +FMN_ALLOW_GENERIC_OPENID = True