Initial commit for Ubuntu 20.04 support on Ansible.

This commit is contained in:
Buster "Silver Eagle" Neece 2020-04-25 01:36:13 -05:00
parent e47c8f91c1
commit fcc6fc2fdd
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
4 changed files with 70 additions and 24 deletions

View File

@ -49,21 +49,34 @@ if [[ "$1" == '--' ]]; then shift; fi
if ask "Use Docker installation method? (Recommended)" Y; then
bash docker.sh install
else
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' ansible|grep "install ok installed")
echo "Checking for Ansible: $PKG_OK"
exit 0
fi
if [[ "" == "$PKG_OK" ]]; then
sudo apt-get update
sudo apt-get install -q -y software-properties-common
. /etc/lsb-release
if [[ $DISTRIB_ID != "Ubuntu" ]]; then
echo "Ansible installation is only supported on Ubuntu distributions."
exit 0
fi
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
if [[ $DISTRIB_CODENAME == "focal" ]]; then
sudo apt-get install -q -y ansible python3-pip python3-mysqldb
else
sudo add-apt-repository -y ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -q -y python2.7 python-pip python-mysqldb ansible
fi
APP_ENV="${APP_ENV:-production}"
echo "Installing AzuraCast (Environment: $APP_ENV)"
ansible-playbook util/ansible/deploy.yml --inventory=util/ansible/hosts --extra-vars "app_env=$APP_ENV"
fi
APP_ENV="${APP_ENV:-production}"
echo "Installing AzuraCast (Environment: $APP_ENV)"
ansible-playbook util/ansible/deploy.yml --inventory=util/ansible/hosts --extra-vars "app_env=$APP_ENV"

View File

@ -15,7 +15,7 @@
- name: Download IceCast-KH-AC Source
get_url:
url: https://github.com/AzuraCast/icecast-kh-ac/archive/2.4.0-kh10-ac4.tar.gz
url: https://github.com/AzuraCast/icecast-kh-ac/archive/2.4.0-kh13-ac2.tar.gz
dest: "{{ app_base }}/servers/icecast2/icecast2.tar.gz"
force: yes
@ -43,6 +43,8 @@
apt_repository:
repo: "ppa:avsm/ppa"
update_cache: yes
when:
- ansible_distribution_release == 'xenial' or ansible_distribution_release == 'bionic'
- name: Install Liquidsoap Dependencies
apt:
@ -76,6 +78,16 @@
args:
chdir: "{{ app_base }}"
executable: "bash" # Fixes some possible hang issues.
when:
- ansible_distribution_release == 'xenial' or ansible_distribution_release == 'bionic'
- name: Initialize OPAM (Focal)
become_user: azuracast
shell: "opam init --disable-sandboxing -a --bare && opam switch create ocaml-system.4.08.1"
args:
chdir: "{{ app_base }}"
when:
- ansible_distribution_release == 'focal'
- name: Build and Install Liquidsoap
become_user: azuracast
@ -84,9 +96,20 @@
chdir: "{{ app_base }}"
executable: "bash" # Fixes some possible hang issues.
- name: Link Liquidsoap binary
- name: Link Liquidsoap binary (Xenial/Bionic)
file:
src: "{{ app_base }}/.opam/4.08.0/bin/liquidsoap"
dest: /usr/local/bin/liquidsoap
state: link
force: yes
when:
- ansible_distribution_release == 'xenial' or ansible_distribution_release == 'bionic'
- name: Link Liquidsoap binary (Focal)
file:
src: "{{ app_base }}/.opam/ocaml-system.4.08.1/bin/liquidsoap"
dest: /usr/local/bin/liquidsoap
state: link
force: yes
when:
- ansible_distribution_release == 'focal'

View File

@ -3,19 +3,21 @@
msg: "Running Ansible on {{ inventory_hostname }} with OS {{ ansible_distribution }} {{ ansible_distribution_release }} {{ ansible_distribution_version }} {{ ansible_architecture }} ({{ app_env }})"
- fail:
msg: "AzuraCast can only be installed onto computers running Ubuntu 16.04 or 18.04 LTS."
msg: "The AzuraCast Ansible installation can only be installed onto computers running Ubuntu."
when: ansible_distribution != 'Ubuntu'
- fail:
msg: "AzuraCast can only be installed onto computers running Ubuntu 16.04 or 18.04 LTS."
when: ansible_distribution_release != 'bionic' and ansible_distribution_release != 'xenial'
msg: "The AzuraCast Ansible installation can only be installed onto computers running Ubuntu 16.04, 18.04 or 20.04 LTS."
when:
- ansible_distribution_release != 'bionic'
- ansible_distribution_release != 'xenial'
- ansible_distribution_release != 'focal'
- name: Add multiverse repository
apt_repository:
repo: "{{item}}"
update_cache: no
when:
- ansible_distribution == 'Ubuntu'
- ansible_architecture == 'x86_64' or ansible_architecture == 'i386'
with_items:
- "deb http://archive.ubuntu.com/ubuntu {{ansible_distribution_release}} multiverse"
@ -49,13 +51,15 @@
apt:
name: software-properties-common
state: latest
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'bionic'
when:
- ansible_distribution_release == 'bionic' or ansible_distribution_release == 'focal'
- name: Install python-software-properties (16.04 only)
apt:
name: python-software-properties
state: latest
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release != 'bionic'
when:
- ansible_distribution_release == 'xenial'
- name: Update pip components
pip:

View File

@ -1,25 +1,31 @@
---
- name: Add repo file
- name: Add MariaDB Repository (Xenial/Bionic)
template: src=mariadb_ubuntu.list.j2 dest=/etc/apt/sources.list.d/mariadb.list owner=root group=root mode=0644
register: mariadb_list
when:
- ansible_distribution_release == 'xenial' or ansible_distribution_release == 'bionic'
- name: Add repo key (Xenial)
apt_key:
keyserver: keyserver.ubuntu.com
id: "0xF1656F24C74CD1D8"
state: present
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'xenial'
when:
- ansible_distribution_release == 'xenial'
- name: Add repo key (Bionic)
apt_key:
keyserver: keyserver.ubuntu.com
id: "0xF1656F24C74CD1D8"
state: present
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'bionic'
when:
- ansible_distribution_release == 'bionic'
- name: Update apt cache
apt: update_cache=yes
when: mariadb_list.changed == True
when:
- ansible_distribution_release == 'xenial' or ansible_distribution_release == 'bionic'
- mariadb_list.changed == True
- name: Unattended package installation
shell: export DEBIAN_FRONTEND=noninteractive