Set up mote webapp role

This commit is contained in:
Chaoyi Zha 2015-06-10 00:21:49 +00:00
parent 5b606d4a19
commit f5de255fd3
4 changed files with 159 additions and 0 deletions

72
roles/mote/tasks/main.yml Normal file
View file

@ -0,0 +1,72 @@
---
# Configuration for the mote webapp
- name: install needed packages
yum: pkg={{ item }} state=present
with_items:
- mote
tags:
- packages
- name: copy sundry mote configuration
template: src={{ item.file }}
dest={{ item.location }}/{{ item.dest }}
owner=apache group=apache mode=0600
with_items:
- { file: mote_config.py, location: /etc/mote, dest: config.py }
- { file: alembic.ini, location: /etc/nuancier, dest: alembic.ini }
changed_when: "1 != 1"
tags:
- config
notify:
- restart apache
- name: create the cache folder where nuancier creates the thumbnails
action: file state=directory
path=/var/cache/nuancier/cache
owner=apache group=apache mode=0700
tags:
- setup
- name: replace the mote configuration file by the one with the normal user
template: src={{ item.file }}
dest="{{ item.location }}/{{ item.file }}"
owner=apache group=apache mode=0600
changed_when: "1 != 1"
with_items:
- { file: mote_config.py, location: /etc/mote, dest: config.py }
- { file: mote.conf, location: /etc/httpd/conf.d }
- { file: mote.wsgi, location: /usr/share/mote }
tags:
- config
notify:
- restart apache
- restart memcached
- name: set sebooleans so nuancier can talk to the db
action: seboolean name=httpd_can_network_connect_db
state=true
persistent=true
- name: apply selinux type to static files
file: >
dest=/usr/lib/python2.7/site-packages/mote/static/
setype=httpd_sys_content_t
state=directory
recurse=yes
- name: apply selinux type to meetbot files
file: >
dest=/srv/web/meetbot/
setype=httpd_sys_content_t
state=directory
recurse=yes
- name: set sebooleans so apache can use memcached
action: seboolean name=httpd_can_network_memcache
state=true
persistent=true
- name: apply selinux type to the wsgi file
file: >
dest=/usr/share/mote/mote.wsgi
setype=httpd_sys_content_t