adding testdays.fedorainfracloud.org playbook

This commit is contained in:
Tim Flink 2015-09-10 01:39:24 +00:00
parent 4af491e50e
commit c74db77bec
7 changed files with 147 additions and 0 deletions

View file

@ -0,0 +1,36 @@
---
image: rhel7-20141015
instance_type: m1.small
keypair: fedora-admin-20130801
security_group: ssh-anywhere-persistent,web-80-anywhere-persistent,web-443-anywhere-persistent,default
zone: nova
tcp_ports: [22, 80, 443]
inventory_tenant: persistent
inventory_instance_name: testdays
hostbase: testdays
public_ip: 209.132.184.134
root_auth_users: tflink jskladan
description: fedora testdays instance
#cloud_networks:
# # persistent-net
# - net-id: "67b77354-39a4-43de-b007-bb813ac5c35f"
resultsdb_db_host: 209.132.184.134
resultsdb_db_port: 5432
resultsdb_endpoint: 'resultsdb_api'
resultsdb_fe_endpoint: 'resultsdb'
resultsdb_db_name: resultsdb_testdays
testdays_db_host: 209.132.184.134
testdays_db_port: 5432
testdays_endpoint: 'testdays'
testdays_db_name: testdays
external_hostname: testdays.fedorainfracloud.org
allowed_hosts:
- 10.5.124
freezes: false

View file

@ -869,6 +869,8 @@ developer.fedorainfracloud.org
#
# These are in the new cloud
#
testdays.fedorainfracloud.org
[jenkins-master]
jenkins.fedorainfracloud.org

View file

@ -0,0 +1,49 @@
---
- name: check/create instance
hosts: testdays.fedorainfracloud.org
gather_facts: False
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- /srv/private/ansible/vars.yml
- /srv/web/infra/ansible/vars/fedora-cloud.yml
- /srv/private/ansible/files/openstack/passwords.yml
tasks:
- include: "{{ tasks }}/persistent_cloud_new.yml"
- name: setup all the things
hosts: testdays.fedorainfracloud.org
gather_facts: True
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- /srv/private/ansible/vars.yml
- /srv/private/ansible/files/openstack/passwords.yml
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
pre_tasks:
- include: "{{ tasks }}/cloud_setup_basic.yml"
- name: set hostname (required by some services, at least postfix need it)
shell: "hostname {{inventory_hostname}}"
roles:
- postgresql_server
- name: configure resultsdb and testdays
hosts: testdays
user: root
gather_facts: True
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
roles:
- { role: taskotron/resultsdb-backend, tags: ['resultsdb-be'] }
- { role: taskotron/resultsdb-frontend, tags: ['resultsdb-fe'] }
- { role: taskotron/testdays, tags: ['testdays'] }
handlers:
- include: "{{ handlers }}/restart_services.yml"

View file

View file

@ -0,0 +1,33 @@
---
- name: ensure packages required for testdays are installed
action: yum name={{ item }} state=latest
with_items:
- testdays
- mod_wsgi
- python-psycopg2
- name: ensure database is created
delegate_to: "{{ testdays_db_host }}"
sudo_user: postgres
sudo: true
action: postgresql_db db={{ testdays_db_name }}
- name: ensure testdays db user has access to database
delegate_to: "{{ testdays_db_host }}"
sudo_user: postgres
sudo: true
action: postgresql_user db={{ testdays_db_name }} user={{ testdays_db_user }} password={{ testdays_db_password }} role_attr_flags=NOSUPERUSER
- name: ensure selinux lets httpd talk to postgres
seboolean: name=httpd_can_network_connect_db persistent=yes state
- name: generate testdays config
template: src=settings.py.j2 dest=/etc/testdays/settings.py owner=root group=root mode=0644
notify:
- restart httpd
- name: generate testdays apache config
template: src=testdays.conf.j2 dest=/etc/httpd/conf.d/testdays.conf owner=root group=root mode=0644
notify:
- restart httpd

View file

@ -0,0 +1,9 @@
RESULTSDB_URL = 'http://127.0.0.1/{{ resultsdb_endpoint }}/api/v1.0'
SECRET_KEY = '{{ testdays_secret_key }}'
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://{{ testdays_db_user }}:{{ testdays_db_password }}@{{ testdays_db_host }}:{{ testdays_db_port }}/{{ testdays_db_name }}'
SHOW_DB_URI = False
PRODUCTION = True
FILE_LOGGING = False
LOGFILR = '/var/log/testdays/testdays.log'
SYSLOG_LOGGING = False
STREAM_LOGGING = True

View file

@ -0,0 +1,18 @@
WSGIDaemonProcess testdays user=apache group=apache threads=5
WSGIScriptAlias /{{ testdays_endpoint }} /usr/share/testdays/testdays.wsgi
WSGISocketPrefix run/wsgi
<Directory /usr/share/testdays>
WSGIProcessGroup testdays
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>