Fix git ignore to only apply to /ansible/ in the root (not the /util/ansible folder) and set hosts to localhost.

This commit is contained in:
Buster Silver 2016-09-08 12:28:06 -05:00
parent 1e03feca9b
commit c49f101735
6 changed files with 59 additions and 3 deletions

5
.gitignore vendored
View File

@ -23,5 +23,6 @@ app/.env
/vendor/
# Ansible deployment files
ansible/
/util/ansible/deploy.retry
/ansible/
/util/ansible/deploy.retry
/util/ansible/update.retry

View File

@ -1,5 +1,5 @@
---
- hosts: all
- hosts: localhost
become: true
vars:
util_base: "{{ playbook_dir | dirname }}"

View File

@ -0,0 +1,3 @@
---
- name: restart cron
service: name=cron enabled=yes state=restarted

View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Pull down update
git reset --hard
git pull
chmod a+x ./update.sh
cd $util_base
phpuser cli.php cache:clear
phpuser doctrine.php orm:schema-tool:update --force --complete

View File

@ -0,0 +1,24 @@
---
- name: Reset local git
shell: git reset --hard
args:
chdir: "{{ www_base }}"
- name: Pull new Git repository
shell: git pull
args:
chdir: "{{ www_base }}"
- name: Make update script executable again
shell: "chmod a+x {{ www_base }}/update.sh"
- name: Clear AzuraCast Cache
become: true
become_user: azuracast
shell: php {{ util_base }}/cli.php cache:clear
- name: Update Doctrine Database
become: true
become_user: azuracast
shell: php {{ util_base }}/doctrine.php orm:schema-tool:update --force --complete

17
util/ansible/update.yml Normal file
View File

@ -0,0 +1,17 @@
---
- hosts: localhost
become: true
vars:
util_base: "{{ playbook_dir | dirname }}"
www_base: "{{ util_base | dirname }}"
app_base: "{{ www_base | dirname }}"
tmp_base: "{{ app_base }}/www_tmp"
app_env: "production"
roles:
- init
- azuracast-radio
- php-phalcon
- composer
- azuracast-cron
- azuracast-update