Files
fedora-infra_ansible/roles/elections/tasks/main.yml
2015-02-02 03:12:09 +00:00

70 lines
1.8 KiB
YAML

---
# Configuration for the nuancier webapp
- name: install needed packages
yum: pkg={{ item }} state=present
with_items:
- fedora-elections
- python-psycopg2
- python-openid-cla
- python-openid-teams
- python-memcached
- libsemanage-python
- python-alembic
tags:
- packages
- name: replace the fedora-elections configuration file by the one with the normal user
template: src={{ item.file }}
dest="{{ item.location }}/{{ item.file }}"
owner=apache group=apache mode=0600
with_items:
- { file: fedora-elections.cfg, location: /etc/fedora-elections }
- { file: fedora-elections.conf, location: /etc/httpd/conf.d }
- { file: fedora-elections.wsgi, location: /var/www }
- { file: alembic.ini, location: /etc/fedora-elections }
tags:
- config
notify:
- restart apache
- name: create the database scheme
command: /usr/bin/python2 /usr/share/fedora-elections/fedora-elections_createdb.py
environment:
FEDORA_ELECTIONS_CONFIG: /etc/fedora-elections/fedora-elections.cfg
changed_when: "1 != 1"
tags:
- config
notify:
- restart apache
- name: set sebooleans so fedora-elections can talk to the db
action: seboolean name=httpd_can_network_connect_db
state=true
persistent=true
tags:
- selinux
- name: apply selinux type to static files
file: >
dest=/usr/lib/python2.6/site-packages/fedora_elections/static/
setype=httpd_sys_content_t
state=directory
recurse=yes
tags:
- selinux
- name: apply selinux type to the wsgi file
file: >
dest=/usr/share/fedora-elections/fedora-elections.wsgi
setype=httpd_sys_content_t
tags:
- selinux
- name: set sebooleans so apache can talk to memcached0*
action: seboolean name=httpd_can_network_memcache
state=true
persistent=true
tags:
- selinux