adding fake_fedorainfra role for taskotron

This commit is contained in:
Tim Flink 2014-07-03 14:58:59 +00:00
parent db80839ca3
commit 8465d6243a
6 changed files with 78 additions and 0 deletions

View file

@ -27,3 +27,5 @@ resultsdb_endpoint: resultsdb
landingpage_title: "Taskotron Development"
deployment_type: dev
tcp_ports: [ 80, 443, "{{ buildslave_port }}" ]
fakefedorainfra_db_name: dev_fakefedorainfra
fakefedorainfra_endpoint: fakefedorainfra

View file

@ -70,6 +70,7 @@
- { role: taskotron/taskotron-trigger, tags: ['trigger'] }
- { role: taskotron/taskotron-frontend, tags: ['frontend'] }
- { role: taskotron/taskotron-proxy, tags: ['taskotronproxy'] }
- { role: taskotron/fake_fedorainfra, tags: ['fakefedorainfra'] }
handlers:
- include: "{{ handlers }}/restart_services.yml"

View file

@ -0,0 +1,7 @@
---
fakefedorainfra_db_host: localhost
fakefedorainfra_db_port: 5432
fakefedorainfra_db_name: fakefedorainfra
fakefedorainfra_db_user: fakefedorainfra
fakefedorainfra_db_password: somefancypassword
fakefedorainfra_endpoint: '/fakefedorainfra'

View file

@ -0,0 +1,29 @@
- name: ensure packages required for fakefedorainfra are installed
action: yum name={{ item }} state=latest
with_items:
- mod_wsgi
- fake_fedorainfra
- name: ensure database is created
when: deployment_type == 'dev'
delegate_to: "{{ buildmaster_db_host }}"
sudo: true
sudo_user: postgres
action: postgresql_db db={{ dev_fakefedorainfra_db_name }}
- name: ensure fakefedorainfra user has access to database
when: deployment_type == 'dev'
delegate_to: "{{ buildmaster_db_host }}"
sudo: true
sudo_user: postgres
action: postgresql_user db={{ dev_fakefedorainfra_db_name }} user={{ dev_fakefedorainfra_db_user }} password={{ dev_fakefedorainfra_db_password }} role_attr_flags=NOSUPERUSER
- name: generate fakefedorainfra config
template: src=settings.py.j2 dest=/etc/fake_fedorainfra/settings.py owner=root group=root mode=0644
notify:
- restart httpd
- name: generate fakefedorainfra apache config
template: src=fake_fedorainfra.conf.j2 dest=/etc/httpd/conf.d/fakefedorainfra.conf owner=root group=root mode=0644
notify:
- restart httpd

View file

@ -0,0 +1,31 @@
WSGIDaemonProcess fakefedorainfra user=apache group=apache threads=5
WSGIScriptAlias /{{ fake_fedorainfra_endpoint }} /usr/share/fake_fedorainfra/fake_fedorainfra.wsgi
WSGISocketPrefix run/wsgi
# this isn't the best way to force SSL but it works for now
#RewriteEngine On
#RewriteCond %{HTTPS} !=on
#RewriteRule ^/fake_fedorainfra/admin/?(.*) https://%{SERVER_NAME}/$1 [R,L]
<Directory /usr/share/fake_fedorainfra>
WSGIProcessGroup fakefedorainfra
WSGIApplicationGroup %{GLOBAL}
WSGIScriptReloading On
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
</IfModule>
<IfModule !mod_auth_core.c>
Order allow,deny
Allow from all
</IfModule>
</Directory>
#Alias /fake_fedorainfra/static /var/www/fake_fedorainfra/fake_fedorainfra/static
#
#<Directory /var/www/fake_fedorainfra/static>
#Order allow,deny
#Allow from all
#</Directory>

View file

@ -0,0 +1,8 @@
{% if deployment_type == 'dev' %}
SECRET_KEY = '{{ dev_fakefedorainfra_secret_key }}'
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://{{ dev_fakefedorainfra_db_user }}:{{ dev_fakefedorainfra_db_password }}@{{ fakefedorainfra_db_host }}:{{ fakefedorainfra_db_port }}/{{ fakefedorainfra_db_name }}'
{% endif %}
FILE_LOGGING = True
LOGFILR = '/var/log/fakefedorainfra/fakefedorainfra.log'
SYSLOG_LOGGING = False
STREAM_LOGGING = False