Re-organized all files and added a Vagrantfile

This commit is contained in:
2016-02-02 11:40:47 -05:00
parent dd4fd53ce7
commit 8a55e9f946
19 changed files with 157 additions and 96 deletions

28
playbooks/code-deploy.yml Normal file
View File

@@ -0,0 +1,28 @@
---
# This playbook deploys the whole application stack for wrestlingdev
#
- hosts: webservers
remote_user: root
serial: 1
tasks:
- name: Refresh code
command: chdir=/root/wrestlingApp git pull origin master
- name: Restart and rebuild docker container
command: chdir=/root/wrestlingApp bash rails-prod.sh wrestlingdev-app
- name: Wait 5 seconds for server to warm up
command: sleep 5s
- hosts: workers
remote_user: root
serial: 1
tasks:
- name: Refresh code
command: chdir=/root/wrestlingApp git pull origin master
- name: Restart and rebuild docker container
command: chdir=/root/wrestlingApp bash rails-worker-prod.sh wrestlingdev-worker
- name: Wait 5 seconds for server to warm up
command: sleep 5s

26
playbooks/galeradb.yml Normal file
View File

@@ -0,0 +1,26 @@
---
# This playbook deploys a galera cluster
- name: Apply common configuration to all nodes
hosts: db
user: root
tasks:
- include: ../roles/common/tasks/main.yml
- name: Install galera and mariadb on all db nodes
hosts: db
user: root
tasks:
- include: ../roles/db/tasks/install.yml
- name: Start and create cluser on first db node
hosts: db[0]
user: root
tasks:
- include: ../roles/db/tasks/startcluster.yml
- name: Start mysql on other nodes
hosts: db[1-2]
user: root
tasks:
- include: ../roles/db/tasks/startmysql.yml

15
playbooks/proxy.yml Normal file
View File

@@ -0,0 +1,15 @@
---
# This playbook deploys the haproxy
- name: Apply common configuration to all nodes
hosts: proxy
user: root
tasks:
- include: ../roles/common/tasks/main.yml
- name: Deploy haproxy
hosts: proxy
user: root
tasks:
- include: ../roles/proxy/tasks/main.yml

26
playbooks/rails.yml Normal file
View File

@@ -0,0 +1,26 @@
---
# This playbook deploys the rails application
- name: Apply common configuration to all nodes
hosts: web:worker
user: root
tasks:
- include: ../roles/common/tasks/main.yml
- name: Apply variables to all nodes
hosts: web:worker
user: root
tasks:
- include: ../roles/rails/tasks/vars.yml
- name: Apply web tasks to web nodes
hosts: web
user: root
tasks:
- include: ../roles/rails/tasks/web.yml
- name: Apply worker tasks to worker nodes
hosts: worker
user: root
tasks:
- include: ../roles/rails/tasks/worker.yml