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 apt: pkg=vim state=present
tasks:
- name: install vim - name: configure vim
apt: pkg=vim state=present copy: src=../config/base/_vimrc dest=/home/vagrant/.vimrc
- name: configure vim
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 apt: pkg={{ item }} state=present
vars: with_items:
databases: - mysql-server
rookeries: - python-mysqldb
username: rookeries
password: system_admin
tasks:
- name: setup MySQL server + Python dependencies - name: setup MySQL databases for rookeries.
apt: pkg={{ item }} state=present mysql_db: name={{ item.key }} state=present
with_items: with_dict: databases
- mysql-server
- python-mysqldb
- name: setup MySQL databases for rookeries. - name: add MySQL database users for rookeries.
mysql_db: name={{ item.key }} state=present mysql_user: name={{ item.value.username }} password={{ item.value.password }} priv={{ item.key }}:ALL
with_dict: databases with_dict: databases
- name: add MySQL database users for rookeries.
mysql_user: name={{ item.value.username }} password={{ item.value.password }} priv={{ item.key }}:ALL
with_dict: databases

View File

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

1
requirements.yaml Normal file
View File

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