Initial playbook and role for zanata2fedmsg.
This commit is contained in:
parent
ae615a1faf
commit
293b54cfd7
4 changed files with 117 additions and 0 deletions
55
playbooks/groups/zanata2fedmsg.yml
Normal file
55
playbooks/groups/zanata2fedmsg.yml
Normal file
|
@ -0,0 +1,55 @@
|
|||
# create a new zanata2fedmsg server
|
||||
# NOTE: should be used with --limit most of the time
|
||||
# NOTE: make sure there is room/space for this server on the vmhost
|
||||
# NOTE: most of these vars_path come from group_vars/zanata2fedmsg* or from hostvars
|
||||
|
||||
- include: "/srv/web/infra/ansible/playbooks/include/virt-create.yml myhosts=zanata2fedmsg:zanata2fedmsg-stg"
|
||||
|
||||
- name: make the box be real
|
||||
hosts: zanata2fedmsg:zanata2fedmsg-stg
|
||||
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:
|
||||
- base
|
||||
- rkhunter
|
||||
- nagios/client
|
||||
- hosts
|
||||
- fas_client
|
||||
- collectd/base
|
||||
- rsyncd
|
||||
- sudo
|
||||
- { role: openvpn/client,
|
||||
when: env != "staging" }
|
||||
- apache
|
||||
|
||||
tasks:
|
||||
- include: "{{ tasks }}/yumrepos.yml"
|
||||
- include: "{{ tasks }}/2fa_client.yml"
|
||||
- include: "{{ tasks }}/motd.yml"
|
||||
- include: "{{ tasks }}/mod_wsgi.yml"
|
||||
|
||||
handlers:
|
||||
- include: "{{ handlers }}/restart_services.yml"
|
||||
|
||||
- name: deploy service-specific config
|
||||
hosts: zanata2fedmsg:zanata2fedmsg-stg
|
||||
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
|
||||
|
||||
handlers:
|
||||
- include: "{{ handlers }}/restart_services.yml"
|
||||
|
||||
roles:
|
||||
- zanata2fedmsg
|
||||
- fedmsg/base
|
7
roles/zanata2fedmsg/files/zanata2fedmsg.wsgi
Normal file
7
roles/zanata2fedmsg/files/zanata2fedmsg.wsgi
Normal file
|
@ -0,0 +1,7 @@
|
|||
import sys
|
||||
sys.stdout = sys.stderr
|
||||
|
||||
import os
|
||||
os.environ['PYTHON_EGG_CACHE'] = '/var/www/.python-eggs'
|
||||
|
||||
from zanata2fedmsg import app as application
|
42
roles/zanata2fedmsg/tasks/main.yml
Normal file
42
roles/zanata2fedmsg/tasks/main.yml
Normal file
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
# Configuration for the tahrir webapp
|
||||
|
||||
- name: install needed packages
|
||||
yum: pkg={{ item }} state=present
|
||||
with_items:
|
||||
- zanata2fedmsg
|
||||
- libsemanage-python
|
||||
tags:
|
||||
- packages
|
||||
- zanata2fedmsg
|
||||
|
||||
- name: make some directories
|
||||
file: dest="{{item}}" mode=0755 state=directory
|
||||
with_items:
|
||||
- /usr/share/zanata2fedmsg
|
||||
tags:
|
||||
- zanata2fedmsg
|
||||
|
||||
- name: copy zanata2fedmsg wsgi script
|
||||
copy: >
|
||||
src={{ item }} dest="/usr/share/zanata2fedmsg/{{ item }}"
|
||||
owner=apache group=apache mode=0644
|
||||
with_items:
|
||||
- zanata2fedmsg.wsgi
|
||||
tags:
|
||||
- config
|
||||
- zanata2fedmsg
|
||||
notify:
|
||||
- restart apache
|
||||
|
||||
- name: copy zanata2fedmsg httpd config
|
||||
template: >
|
||||
src={{ item }} dest="/etc/httpd/conf.d/{{ item }}"
|
||||
owner=apache group=apache mode=0644
|
||||
with_items:
|
||||
- zanata2fedmsg.conf
|
||||
tags:
|
||||
- config
|
||||
- zanata2fedmsg
|
||||
notify:
|
||||
- restart apache
|
13
roles/zanata2fedmsg/templates/zanata2fedmsg.conf
Normal file
13
roles/zanata2fedmsg/templates/zanata2fedmsg.conf
Normal file
|
@ -0,0 +1,13 @@
|
|||
WSGIDaemonProcess zanata2fedmsg user=apache group=apache maximum-requests=1000 display-name=zanata2fedmsg processes={{wsgi_procs}} threads={{wsgi_threads}}
|
||||
WSGISocketPrefix run/wsgi
|
||||
WSGIRestrictStdout On
|
||||
WSGIRestrictSignal Off
|
||||
WSGIPythonOptimize 1
|
||||
|
||||
WSGIScriptAlias / /usr/share/zanata2fedmsg/zanata2fedmsg.wsgi
|
||||
|
||||
<Location />
|
||||
WSGIProcessGroup zanata2fedmsg
|
||||
Require all granted
|
||||
</Location>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue