diff --git a/roles/plus-plus-service/tasks/main.yml b/roles/plus-plus-service/tasks/main.yml new file mode 100644 index 0000000000..567b31f415 --- /dev/null +++ b/roles/plus-plus-service/tasks/main.yml @@ -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 diff --git a/roles/plus-plus-service/templates/pps.cfg b/roles/plus-plus-service/templates/pps.cfg new file mode 100644 index 0000000000..4046e0e0ec --- /dev/null +++ b/roles/plus-plus-service/templates/pps.cfg @@ -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 %} diff --git a/roles/plus-plus-service/templates/pps.conf b/roles/plus-plus-service/templates/pps.conf new file mode 100644 index 0000000000..7e30fed500 --- /dev/null +++ b/roles/plus-plus-service/templates/pps.conf @@ -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 + + + WSGIProcessGroup plus_plus_service + + # Apache 2.4 + Require all granted + + + # Apache 2.2 + Order deny,allow + Allow from all + + +