Closes #27 - Optimize the update process.

This commit is contained in:
Buster Silver 2016-09-10 23:33:30 -05:00
parent c891b00605
commit 856770bb7e
4 changed files with 17 additions and 7 deletions

View File

@ -1,9 +1,14 @@
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get install -q -y software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -q -y ansible python-mysqldb
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' ansible|grep "install ok installed")
echo Checking for Ansible: $PKG_OK
if [ "" == "$PKG_OK" ]; then
sudo apt-get update
sudo apt-get install -q -y software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -q -y ansible python-mysqldb
fi
ansible-playbook util/ansible/update.yml --inventory=util/ansible/hosts --extra-vars "app_env=production"

View File

@ -2,6 +2,7 @@
- name: Install Composer
become: true
shell: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
creates: /usr/bin/composer
args:
warn: no

View File

@ -2,17 +2,21 @@
- name: Add PHP PPA repository
become: true
apt_repository: repo=ppa:ondrej/php
register: installed_php_ppa
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'trusty'
- name: Add Phalcon PPA repository
become: true
shell: curl -s https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh | sudo bash
register: installed_phalcon_ppa
creates: /etc/apt/sources.list.d/phalcon_stable.list
args:
warn: no
- name: Update apt again
become: true
apt: update_cache=yes
when: installed_phalcon_ppa.changed or installed_php_ppa.changed
- name: Install PHP Libraries
become: true

View File

@ -10,8 +10,8 @@
roles:
- init
- azuracast-update
- azuracast-radio
- php-phalcon
- composer
- azuracast-cron
- azuracast-update
- azuracast-cron