Add a role for the plus-plus-service

This commit is contained in:
Pierre-Yves Chibon 2016-07-27 11:36:57 +02:00
parent 965a09211a
commit 27798df2b7
3 changed files with 77 additions and 0 deletions

View file

@ -0,0 +1,40 @@
---
# Configuration for the mdapi webapp
- name: Ensure mod_wsgi is not installed since we're using python3
dnf: pkg=mod_wsgi state=absent
tags:
- pps
- packages
- name: install needed packages
dnf: pkg={{ item }} state=present
with_items:
- plus-plus-service
- python3-mod_wsgi
tags:
- pps
- packages
- name: create all the directory for the configuration file
file: state=directory path=/etc/plus-plus-service
tags:
- pps
- config
- name: Install the config files
template: src={{ item.file }}
dest={{ item.location }}/{{ item.file }}
with_items:
- { file: 'settings.py', location: /etc/plus-plus-service }
- { file: 'apache.conf', location: /etc/plus-plus-service }
tags:
- pps
- config
- name: start apache service
service: name=httpd enabled=yes state=running
ignore_errors: true
tags:
- pps
- service

View file

@ -0,0 +1,16 @@
# Configuration file for pps aka the plus-plus-service
SQLALCHEMY_DATABASE_URI = 'postgresql://{{ pps_db_user }}:{{ pps_db_pass }}@{{ pps_db_host }}/{{ pps_db_name }}'
## name of the user so the application can log in to FAS with
FAS_USERNAME = '{{ fedorathirdpartyUser }}'
## password of the user so the application can log in to FAS with
FAS_PASSWORD = '{{ fedorathirdpartyPassword }}'
PLUS_PLUS_TOKEN = '{{ plus-plus-service-token }}'
{% if env == 'staging' %}
FAS_URL = 'https://admin.stg.fedoraproject.org/accounts/'
{% else %}
FAS_URL = 'https://admin.fedoraproject.org/accounts/'
{% endif %}

View file

@ -0,0 +1,21 @@
WSGIDaemonProcess plus_plus_service user=apache maximum-requests=1000 display-name=plus_plus_service processes={{ wsgi_procs }} threads={{ wsgi_threads }}
WSGISocketPrefix run/wsgi
WSGIRestrictStdout On
WSGIRestrictSignal Off
WSGIPythonOptimize 1
WSGIScriptAlias /pps /etc/plus-plus-service/wsgi.py
<Location />
WSGIProcessGroup plus_plus_service
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order deny,allow
Allow from all
</IfModule>
</Location>