Migrate Ansible setup to use an external role to handle setup of the NGINX, UWSGI and supervisord setup.

Allow for greater reusability of Ansible playbooks.
This commit is contained in:
Dorian 2015-01-08 18:22:39 -05:00
parent 41a54c74e4
commit a634aac67f
5 changed files with 42 additions and 51 deletions

View File

@ -1,10 +1,17 @@
--- ---
- include: pre_deployment/base_linux.yaml - hosts: all
- include: pre_deployment/python.yaml sudo: yes
- include: pre_deployment/mysql_db.yaml
- include: pre_deployment/nginx.yaml roles:
- include: pre_deployment/supervisor.yaml - ansible-nginx-uwsgi-supervisor
- include: pre_deployment/web_data_folders.yaml tasks:
- include: pre_deployment/nodejs.yaml - include: pre_deployment/base_linux.yaml
- include: pre_deployment/mysql_db.yaml
vars:
databases:
rookeries:
username: rookeries
password: system_admin
- include: pre_deployment/nodejs.yaml
# TODO Add in globally defined values for webapp and virtualenv folders # TODO Add in globally defined values for webapp and virtualenv folders

View File

@ -1,10 +1,6 @@
--- ---
- hosts: all - name: install vim
sudo: yes
tasks:
- name: install vim
apt: pkg=vim state=present apt: pkg=vim state=present
- name: configure vim - name: configure vim
copy: src=../config/base/_vimrc dest=/home/vagrant/.vimrc copy: src=../config/base/_vimrc dest=/home/vagrant/.vimrc

View File

@ -1,23 +1,14 @@
--- ---
- hosts: all - name: setup MySQL server + Python dependencies
sudo: yes
vars:
databases:
rookeries:
username: rookeries
password: system_admin
tasks:
- name: setup MySQL server + Python dependencies
apt: pkg={{ item }} state=present apt: pkg={{ item }} state=present
with_items: with_items:
- mysql-server - mysql-server
- python-mysqldb - python-mysqldb
- name: setup MySQL databases for rookeries. - name: setup MySQL databases for rookeries.
mysql_db: name={{ item.key }} state=present mysql_db: name={{ item.key }} state=present
with_dict: databases with_dict: databases
- name: add MySQL database users for rookeries. - name: add MySQL database users for rookeries.
mysql_user: name={{ item.value.username }} password={{ item.value.password }} priv={{ item.key }}:ALL mysql_user: name={{ item.value.username }} password={{ item.value.password }} priv={{ item.key }}:ALL
with_dict: databases with_dict: databases

View File

@ -1,18 +1,14 @@
--- ---
- hosts: all - name: install nodejs + npm dependencies
sudo: yes
tasks:
- name: install nodejs + npm dependencies
apt: pkg={{ item }} state=present apt: pkg={{ item }} state=present
with_items: with_items:
- nodejs - nodejs
- npm - npm
- name: link nodejs binary correctly - name: link nodejs binary correctly
file: src=/usr/bin/nodejs dest=/usr/bin/node state=link file: src=/usr/bin/nodejs dest=/usr/bin/node state=link
- name: install coffeescript + less dependencies - name: install coffeescript + less dependencies
npm: name={{ item }} global=yes state=present npm: name={{ item }} global=yes state=present
with_items: with_items:
- coffee-script - coffee-script

1
requirements.yaml Normal file
View File

@ -0,0 +1 @@
- src: git+https://bitbucket.org/dorianpula/ansible-nginx-uwsgi-supervisor