Update Ansible to use Deb Liquidsoap Package

This commit is contained in:
Buster "Silver Eagle" Neece 2021-12-14 09:07:21 -06:00
parent 90b1489d31
commit 61e0bcc605
No known key found for this signature in database
GPG Key ID: 9FC8B9E008872109
6 changed files with 210 additions and 169 deletions

View File

@ -34,7 +34,7 @@ else
fi
APP_ENV="${APP_ENV:-production}"
UPDATE_REVISION="${UPDATE_REVISION:-68}"
UPDATE_REVISION="${UPDATE_REVISION:-69}"
echo "Updating AzuraCast (Environment: $APP_ENV, Update revision: $UPDATE_REVISION)"

View File

@ -0,0 +1,35 @@
---
- name: Install IceCast-KH-AC Dependencies
apt:
name: "{{ packages }}"
state: latest
install_recommends: no
vars:
packages:
- libxml2
- libxslt1-dev
- libvorbis-dev
- libssl-dev
- libcurl4-openssl-dev
- pkg-config
- name: Download IceCast-KH-AC Source
get_url:
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
- name: Extract IceCast-KH-AC Source
unarchive:
src: "{{ app_base }}/servers/icecast2/icecast2.tar.gz"
dest: "{{ app_base }}/servers/icecast2"
remote_src: yes
mode: "u=rwx,g=rx,o=rx"
owner: "azuracast"
group: "www-data"
extra_opts: "--strip-components=1"
- name: Build IceCast-KH-AC
shell: "cd {{ app_base }}/servers/icecast2 && ./configure && make && make install"
args:
chdir: "{{ app_base }}/servers/icecast2"

View File

@ -0,0 +1,80 @@
---
- name: Clear OPAM directory
file:
path: "{{ app_base }}/.opam"
state: absent
- name: Install Liquidsoap Dependencies
apt:
name: "{{ packages }}"
state: latest
install_recommends: no
vars:
packages:
- libao-dev
- libasound2-dev
- libavcodec-dev
- libavdevice-dev
- libavfilter-dev
- libavformat-dev
- libavutil-dev
- libfaad-dev
- libfdk-aac-dev
- libflac-dev
- libfreetype-dev
- libgd-dev
- libjack-dev
- libjpeg-dev
- liblo-dev
- libmad0-dev
- libmagic-dev
- libmp3lame-dev
- libopus-dev
- libpng-dev
- libportaudio2
- libpulse-dev
- libsamplerate0-dev
- libsdl2-dev
- libsdl2-ttf-dev
- libshine-dev
- libsoundtouch-dev
- libspeex-dev
- libsrt-dev
- libswresample-dev
- libswscale-dev
- libtag1-dev
- libtheora-dev
- libtiff-dev
- libx11-dev
- libxpm-dev
- bubblewrap
- name: Install Optional Audio Plugins
apt:
name: "{{ packages }}"
state: latest
install_recommends: no
vars:
packages:
- frei0r-plugins-dev
- ladspa-sdk
- multimedia-audio-plugins
- swh-plugins
- tap-plugins
- lsp-plugins-ladspa
- name: Get the DPKG Architecture
shell: dpkg --print-architecture
register: dpkg_arch
ignore_errors: True
- name: Install Liquidsoap
apt:
deb: "https://github.com/savonet/liquidsoap/releases/download/v2.0.1/liquidsoap_2.0.1-ubuntu-focal-1_{{ dpkg_arch.stdout_lines[0] | default('amd64') }}.deb"
- name: Link Liquidsoap binary
file:
src: "/usr/bin/liquidsoap"
dest: /usr/local/bin/liquidsoap
state: link
force: yes

View File

@ -0,0 +1,85 @@
---
- name: Clear OPAM directory
file:
path: "{{ app_base }}/.opam"
state: absent
- name: Add OPAM/OCaml Repository
apt_repository:
repo: "ppa:avsm/ppa"
update_cache: yes
- name: Install Liquidsoap Dependencies
apt:
name: "{{ packages }}"
state: latest
install_recommends: no
vars:
packages:
- ffmpeg
- opam
- ocaml
- libavcodec-dev
- libavdevice-dev
- libavfilter-dev
- libavformat-dev
- libavresample-dev
- libavutil-dev
- libfaad-dev
- libfdk-aac-dev
- libflac-dev
- libmad0-dev
- libmp3lame-dev
- libogg-dev
- libopus-dev
- libpcre3-dev
- libpostproc-dev
- libsamplerate0-dev
- libswresample-dev
- libswscale-dev
- libssl-dev
- libtag1-dev
- libvorbis-dev
- autoconf
- automake
- m4
- pkg-config
- unzip
- bubblewrap
- frei0r-plugins-dev
- ladspa-sdk
- multimedia-audio-plugins
- swh-plugins
- tap-plugins
- name: Initialize OPAM
become_user: azuracast
shell: "opam init -a --disable-sandboxing --bare && opam switch create 4.12.0"
args:
chdir: "{{ app_base }}"
executable: "bash" # Fixes some possible hang issues.
- name: Build and Install Liquidsoap and Dependencies
become_user: azuracast
shell: "opam install -y ladspa.0.2.0 ffmpeg.1.1.0 ffmpeg-avutil.1.1.0 ffmpeg-avcodec.1.1.0 ffmpeg-avdevice.1.1.0 ffmpeg-av.1.1.0 ffmpeg-avfilter.1.1.0 ffmpeg-swresample.1.1.0 ffmpeg-swscale.1.1.0 frei0r.0.1.2 samplerate.0.1.6 taglib.0.3.6 mad.0.5.0 faad.0.5.0 fdkaac.0.3.2 lame.0.3.4 vorbis.0.8.0 cry.0.6.5 flac.0.3.0 opus.0.2.0 dtools.0.4.4 duppy.0.9.2 ocurl.0.9.1 ssl liquidsoap.2.0.1"
args:
chdir: "{{ app_base }}"
register: install_result
async: 3600
poll: 0
- name: Check on Liquidsoap Installation
become_user: azuracast
async_status:
jid: "{{ install_result.ansible_job_id }}"
register: check_result
until: check_result.finished
retries: 60
delay: 60
- name: Link Liquidsoap binary
file:
src: "{{ app_base }}/.opam/4.12.0/bin/liquidsoap"
dest: /usr/local/bin/liquidsoap
state: link
force: yes

View File

@ -1,174 +1,15 @@
---
- name : Install IceCast-KH-AC Dependencies
apt :
name : "{{ packages }}"
state : latest
install_recommends : no
vars :
packages :
- libxml2
- libxslt1-dev
- libvorbis-dev
- libssl-dev
- libcurl4-openssl-dev
- pkg-config
- name: Build Icecast
include_tasks: icecast.yml
- name : Download IceCast-KH-AC Source
get_url :
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
- name : Extract IceCast-KH-AC Source
unarchive :
src : "{{ app_base }}/servers/icecast2/icecast2.tar.gz"
dest : "{{ app_base }}/servers/icecast2"
remote_src : yes
mode : "u=rwx,g=rx,o=rx"
owner : "azuracast"
group : "www-data"
extra_opts : "--strip-components=1"
- name : Build IceCast-KH-AC
shell : "cd {{ app_base }}/servers/icecast2 && ./configure && make && make install"
args :
chdir : "{{ app_base }}/servers/icecast2"
- name : Clear OPAM directory
file :
path : "{{ app_base }}/.opam"
state : absent
- name : Add OPAM/OCaml Repository
apt_repository :
repo : "ppa:avsm/ppa"
update_cache : yes
when :
- name: Build Liquidsoap (Legacy Ubuntu Versions)
include_tasks: liquidsoap_legacy.yml
when:
- ansible_distribution_release == 'xenial' or ansible_distribution_release == 'bionic'
- name : Install Liquidsoap Dependencies
apt :
name : "{{ packages }}"
state : latest
install_recommends : no
vars :
packages :
- ffmpeg
- opam
- ocaml
- libavcodec-dev
- libavdevice-dev
- libavfilter-dev
- libavformat-dev
- libavresample-dev
- libavutil-dev
- libfaad-dev
- libfdk-aac-dev
- libflac-dev
- libmad0-dev
- libmp3lame-dev
- libogg-dev
- libopus-dev
- libpcre3-dev
- libpostproc-dev
- libsamplerate0-dev
- libswresample-dev
- libswscale-dev
- libssl-dev
- libtag1-dev
- libvorbis-dev
- autoconf
- automake
- m4
- pkg-config
- unzip
- bubblewrap
- frei0r-plugins-dev
- ladspa-sdk
- multimedia-audio-plugins
- swh-plugins
- tap-plugins
- name : Add Optional LADSPA Plugins (Focal)
apt :
name : "{{ packages }}"
state : latest
install_recommends : no
vars :
packages :
- lsp-plugins-ladspa
when :
- ansible_distribution_release == 'focal'
- name : Initialize OPAM (Bionic)
become_user : azuracast
shell : "opam init -a --disable-sandboxing --bare && opam switch create 4.12.0"
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 4.12.0"
args :
chdir : "{{ app_base }}"
executable : "bash" # Fixes some possible hang issues.
when :
- ansible_distribution_release == 'focal'
- name : Download specific Liquidsoap commit
become_user : azuracast
git :
repo : https://github.com/savonet/liquidsoap.git
dest : "{{ app_base }}/liquidsoap-src"
version : 43aa734dd37595e991ad7d8d9b8560e7d47c19fe
clone : yes
update : yes
force : yes
- name : Pin specific Liquidsoap commit
become_user : azuracast
shell : opam pin add --no-action liquidsoap .
args :
chdir : "{{ app_base }}/liquidsoap-src"
executable : "bash" # Fixes some possible hang issues.
- name : Build and Install Liquidsoap and Dependencies
become_user : azuracast
shell : "opam install -y ladspa.0.2.0 ffmpeg.1.0.1 ffmpeg-avutil.1.0.1 ffmpeg-avcodec.1.0.1 ffmpeg-avdevice.1.0.1 ffmpeg-av.1.0.1 ffmpeg-avfilter.1.0.1 ffmpeg-swresample.1.0.1 ffmpeg-swscale.1.0.1 frei0r.0.1.2 samplerate.0.1.6 taglib.0.3.6 mad.0.5.0 faad.0.5.0 fdkaac.0.3.2 lame.0.3.4 vorbis.0.8.0 cry.0.6.5 flac.0.3.0 opus.0.2.0 dtools.0.4.4 duppy.0.9.2 ocurl.0.9.1 ssl liquidsoap"
args :
chdir : "{{ app_base }}"
register : install_result
async : 3600
poll : 0
- name : Check on Liquidsoap Installation
become_user : azuracast
async_status :
jid : "{{ install_result.ansible_job_id }}"
register : check_result
until : check_result.finished
retries : 60
delay : 60
- name : Link Liquidsoap binary (Xenial/Bionic)
file :
src : "{{ app_base }}/.opam/4.12.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/4.12.0/bin/liquidsoap"
dest : /usr/local/bin/liquidsoap
state : link
force : yes
when :
- name: Install Liquidsoap (Focal)
include_tasks: liquidsoap.yml
when:
- ansible_distribution_release == 'focal'
- name : Add Audiowaveform PPA

View File

@ -16,7 +16,7 @@
roles :
- init
- azuracast-config
- { role : azuracast-radio, when : update_revision|int < 66 }
- { role: azuracast-radio, when: update_revision|int < 69 }
- { role : supervisord, when : update_revision|int < 13 }
- { role : mariadb, when : update_revision|int < 63 }
- { role : nginx, when : update_revision|int < 60 }