fmartingr
/
shelfzilla
Archived
1
0
Fork 0

Added shelfzilla module, not finished

This commit is contained in:
Juan Manuel Parrilla 2014-11-14 09:30:10 +01:00
parent cb55268e50
commit 02689c5825
10 changed files with 117 additions and 1 deletions

View File

@ -1 +1,2 @@
shelfzilla_base_path: /opt/shelfzilla
shelfzilla_base_path: /opt/shelfzilla
system_init_path: /etc/init.d

View File

@ -0,0 +1,4 @@
---
- name: restart postgresql
service: name=postgresql state=restarted
sudo: yes

View File

@ -0,0 +1,6 @@
---
- debug: msg="Starting Shelfzilla module"
- include: shelfzilla.yml
#- include: npm_dependencies.yml
#- include: pip_dependencies.yml
#- include: postgre.yml

View File

@ -0,0 +1,6 @@
- name: Install NodeJS and NPM packages
yum: pkg={{item}} state=installed
sudo: yes
with_items:
- nodejs
- npm

View File

@ -0,0 +1,13 @@
- name: Install Python27 packages
yum: pkg={{item}} state=installed
sudo: yes
with_items:
- python27
- python27-tools
- python27-devel
- python27-libs
- python27-setuptools
- easy_install: name=pip executable=/usr/bin/easy_install-2.7
sudo: yes

View File

@ -0,0 +1,41 @@
---
- name: Install PostgreSQL packages
yum: pkg={{item}} state=installed
sudo: yes
with_items:
- postgresql
- postgresql-server
- python-psycopg2
- postgresql-contrib
- postgresql-libs
- postgresql-devel
- name: Initiate PostgreSQL database
action: shell /sbin/service postgresql initdb
creates=/var/lib/pgsql/data/postgresql.conf
sudo: yes
notify:
- restart postgresql
- meta: flush_handlers
- lineinfile: "dest=/etc/sudoers regexp='^%vagrant' state=present line='%vagrant ALL = (postgres) NOPASSWD: ALL'"
sudo: yes
when: local_environment
- name: ensure database is created
postgresql_db: name={{dbname}}
sudo: yes
sudo_user: postgres
- name: ensure user has access to database
postgresql_user: db={{dbname}} name={{dbuser}} priv=ALL
sudo_user: postgres
sudo: yes
- name: ensure user does not have unnecessary privilege
postgresql_user: name={{dbuser}} role_attr_flags=NOSUPERUSER,NOCREATEDB
sudo_user: postgres
sudo: yes

View File

@ -0,0 +1,35 @@
---
- name: Install shelfzilla RPM
yum: pkg=shelfzilla state=installed
sudo: yes
- name: Move Shelfzilla init script
command: mv {{shelfzilla_base_path}}/init/shelfzilla {{system_init_path}}/shelfzilla
sudo: yes
- name: Change Permission of init script
file: path={{system_init_path}}/shelfzilla
owner=root
group=root
mode=0755
sudo: yes
- name: Load Shelfzilla service in boot
service: name=shelfzilla
pattern={{system_init_path}}/shelfzilla
enabled=yes
sudo: yes
- name: delete init directory
file: path={{items}} state=absent recurse=no
sudo: yes
with_items:
- {{shelfzilla_base_path}}/init/shelfzilla
- {{shelfzilla_base_path}}/init
mv %{_app_dir}/init/shelfzilla %{_init_path}/
chmod 775 %{_init_path}/shelfzilla
chkconfig --add shelfzilla
rmdir %{_app_dir}/init/

View File

@ -0,0 +1,5 @@
[Shelfzilla]
name=Shelfzilla Awesome App
baseurl=http://37.139.15.172/
gpgcheck=0
enabled=1

View File

@ -0,0 +1,4 @@
---
## PostgreSQL Variables
dbname: shelfzilla
dbuser: shelfzilla

View File

@ -4,6 +4,7 @@
roles:
- role: common
- role: shelfzilla_base
- role: shelfzilla
- name: Production Task
hosts: production