Ansible cleanup
This commit is contained in:
parent
c0b8612bb0
commit
5739e64155
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
- name: Write environment configuration file
|
||||
become: true
|
||||
template: src=env.ini.j2 dest="{{ www_base }}/app/env.ini" owner=azuracast group=www-data mode=0644 force=no
|
||||
|
||||
- name: Set up environment file
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
template: src=azuracast_cron.j2 dest="{{ tmp_base }}/azuracast_cron" force=true
|
||||
|
||||
- name: Install Cron file
|
||||
become: true
|
||||
shell: "crontab -u azuracast {{ tmp_base }}/azuracast_cron"
|
||||
notify: restart cron
|
||||
|
||||
|
|
|
@ -9,11 +9,9 @@
|
|||
mysql_user_password: "{{ prod_mysql_user_password.stdout if app_env == 'production' else dev_mysql_user_password }}"
|
||||
|
||||
- name: Add configuration
|
||||
become: true
|
||||
template: src=my.cnf.j2 dest=/etc/mysql/conf.d/my.cnf owner=root group=root mode=0644
|
||||
|
||||
- name: Add empty root .my.cnf (if none exists)
|
||||
become: true
|
||||
template: src=root_empty_my.cnf.j2 dest=/root/.my.cnf owner=root group=root mode=0600 force=no
|
||||
|
||||
- name: MariaDB Cleanup
|
||||
|
@ -37,7 +35,6 @@
|
|||
notify: send mysql notification
|
||||
|
||||
- name: Add .my.cnf
|
||||
become: true
|
||||
template: src=user_my.cnf.j2 dest="{{ app_base }}/.my.cnf" owner=azuracast group=www-data mode=0644 force=yes
|
||||
|
||||
- name: Reload privilege tables
|
||||
|
|
|
@ -1,20 +1,17 @@
|
|||
---
|
||||
- name: Install IceCast2
|
||||
become: true
|
||||
apt: pkg=icecast2 state=latest
|
||||
|
||||
- name: Link Fallback Error MP3
|
||||
file: src="{{ www_base }}/resources/error.mp3" dest="/usr/share/icecast2/web/error.mp3" state=link
|
||||
|
||||
- name: Remove problematic LiquidSoap plugins
|
||||
become: true
|
||||
apt: pkg="{{ item }}" state=absent
|
||||
with_items:
|
||||
- liquidsoap-plugin-all
|
||||
- liquidsoap-plugin-opus
|
||||
|
||||
- name: Install LiquidSoap
|
||||
become: true
|
||||
apt: pkg="{{ item }}" install_recommends=yes state=latest
|
||||
with_items:
|
||||
- liquidsoap
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
- name: Install IceCast-KH Dependencies
|
||||
become: true
|
||||
apt: pkg="{{ item }}" install_recommends=no state=latest
|
||||
with_items:
|
||||
- libxml2
|
||||
|
@ -27,7 +26,6 @@
|
|||
extra_opts: "--strip-components=1"
|
||||
|
||||
- name: Build IceCast-KH
|
||||
become: true
|
||||
shell: "cd {{ app_base }}/servers/icecast2 && ./configure && make && make install"
|
||||
args:
|
||||
chdir: "{{ app_base }}/servers/icecast2"
|
||||
|
@ -41,11 +39,9 @@
|
|||
- { src: "{{ www_base }}/resources/xml2json.xslt", dest: "/usr/local/share/icecast/web/xml2json.xslt" }
|
||||
|
||||
- name: Install OPAM
|
||||
become: true
|
||||
apt: pkg="opam" install_recommends=yes state=latest
|
||||
|
||||
- name: Install LiquidSoap Dependencies
|
||||
become: true
|
||||
apt: pkg="{{ item }}" install_recommends=no state=latest
|
||||
with_items:
|
||||
- libpcre3-dev
|
||||
|
@ -63,7 +59,6 @@
|
|||
- camlp4
|
||||
|
||||
- name: Build LiquidSoap
|
||||
become: true
|
||||
become_user: azuracast
|
||||
shell: "opam init -y && opam update && opam install -y taglib.0.3.3 mad.0.4.5 faad.0.3.3 fdkaac.0.2.1 lame.0.3.3 vorbis.0.7.0 cry.0.6.0 flac.0.1.2 opus.0.1.2 liquidsoap.1.3.3"
|
||||
args:
|
||||
|
|
|
@ -4,14 +4,12 @@
|
|||
register: prod_azuracast_user_password
|
||||
|
||||
- name: Create Groups
|
||||
become: true
|
||||
group: name="{{ item }}" state=present
|
||||
with_items:
|
||||
- www-data
|
||||
- admin
|
||||
|
||||
- name: Create AzuraCast User
|
||||
become: true
|
||||
user:
|
||||
name: azuracast
|
||||
home: "{{ app_base }}"
|
||||
|
@ -22,5 +20,4 @@
|
|||
notify: send user notification
|
||||
|
||||
- name: Modify www-data User
|
||||
become: true
|
||||
user: name=www-data groups="azuracast" append=yes
|
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
- name: Install Composer
|
||||
become: true
|
||||
shell: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
|
||||
args:
|
||||
creates: /usr/bin/composer
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
register: influx_installed
|
||||
|
||||
- name: Fix permissions on InfluxDB data folder
|
||||
become: true
|
||||
file: path="/var/lib/influxdb" state=directory owner=influxdb group=influxdb recurse=true
|
||||
|
||||
- name: Lock down InfluxDB to localhost requests
|
||||
|
|
|
@ -16,12 +16,10 @@
|
|||
- "deb-src http://archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}}-updates multiverse"
|
||||
|
||||
- name: Update apt
|
||||
become: true
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: Install system packages
|
||||
become: true
|
||||
apt: pkg="{{ item }}" state=latest
|
||||
with_items:
|
||||
- apt-transport-https
|
||||
|
@ -32,17 +30,14 @@
|
|||
- pwgen
|
||||
- whois
|
||||
- python-pip
|
||||
- lnav
|
||||
|
||||
- name: Install software-properties (18.04 only)
|
||||
become: true
|
||||
apt: pkg="{{ item }}" state=latest
|
||||
with_items:
|
||||
- software-properties-common
|
||||
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'bionic'
|
||||
|
||||
- name: Install python-software-properties (16.04 only)
|
||||
become: true
|
||||
apt: pkg="{{ item }}" state=latest
|
||||
with_items:
|
||||
- python-software-properties
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
---
|
||||
- name: Uninstall web server packages that may conflict with nginx
|
||||
become: true
|
||||
apt: package="{{ item }}" state=absent
|
||||
with_items:
|
||||
- apache2
|
||||
- lighttpd
|
||||
|
||||
- name: Unhold nginx-related packages for updates
|
||||
become: true
|
||||
dpkg_selections:
|
||||
name: "{{ item }}"
|
||||
selection: install
|
||||
|
@ -17,7 +15,6 @@
|
|||
- "nginx-extras"
|
||||
|
||||
- name: Remove any older nginx
|
||||
become: true
|
||||
apt: package="{{ item }}" state=absent purge=yes
|
||||
with_items:
|
||||
- nginx
|
||||
|
@ -25,7 +22,6 @@
|
|||
- nginx-extras
|
||||
|
||||
- name: Install nginx
|
||||
become: true
|
||||
apt: package="{{ item }}" state=latest
|
||||
with_items:
|
||||
- nginx
|
||||
|
@ -33,40 +29,33 @@
|
|||
- nginx-extras
|
||||
|
||||
- name: Create nginx ssl directory
|
||||
become: true
|
||||
file: path="{{ item }}" state=directory owner=root group=root mode=0744
|
||||
with_items:
|
||||
- "/etc/nginx/ssl"
|
||||
|
||||
- name: Create self-signed SSL cert
|
||||
become: true
|
||||
command: openssl req -new -nodes -x509 -subj "/C=US/ST=Texas/L=Austin/O=IT/CN=${ansible_fqdn}" -days 3650 -keyout /etc/nginx/ssl/server.key -out /etc/nginx/ssl/server.crt -extensions v3_ca
|
||||
args:
|
||||
creates: /etc/nginx/ssl/server.crt
|
||||
|
||||
- name: Remove default nginx site symlink
|
||||
become: true
|
||||
file:
|
||||
path: "/etc/nginx/sites-enabled/default"
|
||||
state: absent
|
||||
|
||||
- name: Add nginx global config
|
||||
become: true
|
||||
template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf force=yes backup=yes
|
||||
|
||||
- name: Add app-specific nginx site
|
||||
become: true
|
||||
template: src=default.j2 dest=/etc/nginx/sites-available/00-azuracast force=yes
|
||||
|
||||
- name: Link app-specific nginx site
|
||||
become: true
|
||||
file:
|
||||
path: "/etc/nginx/sites-enabled/00-azuracast"
|
||||
state: link
|
||||
src: "/etc/nginx/sites-available/00-azuracast"
|
||||
|
||||
- name: Turn sendfile off on nginx for local development
|
||||
become: true
|
||||
replace:
|
||||
dest: /etc/nginx/nginx.conf
|
||||
regexp: 'sendfile on;'
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
---
|
||||
- name: Add PHP PPA repository
|
||||
become: true
|
||||
apt_repository:
|
||||
repo: "ppa:ondrej/php"
|
||||
update_cache: yes
|
||||
|
||||
- name: Remove Old PHP Libraries
|
||||
become: true
|
||||
apt: package="{{ item }}" state=absent
|
||||
with_items:
|
||||
- php5-common
|
||||
|
@ -35,7 +33,6 @@
|
|||
- php7.1-redis
|
||||
|
||||
- name: Install PHP 7.2
|
||||
become: true
|
||||
apt: package="{{ item }}" state=latest
|
||||
with_items:
|
||||
- php7.2-fpm
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
- name: Install Redis
|
||||
become: true
|
||||
apt: package="{{ item }}" state=latest
|
||||
with_items:
|
||||
- redis-server
|
||||
|
|
|
@ -1,29 +1,24 @@
|
|||
---
|
||||
- name: Install supervisord from repo
|
||||
become: true
|
||||
apt: pkg=supervisor state=latest
|
||||
register: supervisord_install
|
||||
|
||||
- name: Change supervisord configuration
|
||||
become: true
|
||||
template: src=supervisord.conf.j2 dest=/etc/supervisor/supervisord.conf force=yes
|
||||
register: supervisord_conf
|
||||
|
||||
- name: Remove old core supervisord configuration
|
||||
become: true
|
||||
file:
|
||||
path: /etc/supervisor/conf.d/core.conf
|
||||
state: absent
|
||||
register: supervisord_core
|
||||
|
||||
- name: Kill legacy radio processes (if upgrading from older version)
|
||||
become: true
|
||||
command: killall -q -9 icecast2 sc_serv liquidsoap
|
||||
ignore_errors: true
|
||||
when: supervisord_install.changed
|
||||
|
||||
- name: Trigger manual restart of supervisord (if not already running)
|
||||
become: true
|
||||
service: name=supervisor enabled=yes state=restarted
|
||||
when: supervisord_install.changed or supervisord_conf.changed or supervisord_core.changed
|
||||
ignore_errors: true
|
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
- name: Install UFW Firewall
|
||||
become: true
|
||||
apt: pkg="{{ item }}" state=latest
|
||||
with_items:
|
||||
- ufw
|
||||
|
|
|
@ -16,17 +16,14 @@
|
|||
ignore_errors: True
|
||||
|
||||
- name: Kill all processes owned by AzuraCast user
|
||||
become: true
|
||||
command: pkill -9 -u azuracast
|
||||
ignore_errors: true
|
||||
|
||||
- name: Update apt
|
||||
become: true
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: Remove AzuraCast User
|
||||
become: true
|
||||
user:
|
||||
name: azuracast
|
||||
state: absent
|
||||
|
@ -38,7 +35,6 @@
|
|||
- "{{ app_base }}/servers"
|
||||
|
||||
- name: Remove PPAs
|
||||
become: true
|
||||
apt_repository: repo="{{ item }}" state=absent
|
||||
with_items:
|
||||
- ppa:avsm/ppa
|
||||
|
@ -49,7 +45,6 @@
|
|||
ignore_errors: True
|
||||
|
||||
- name: Remove software
|
||||
become: true
|
||||
apt: pkg="{{ item }}" state=absent force=yes purge=yes
|
||||
with_items:
|
||||
# Radio software
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
app_base: "{{ www_base | dirname }}"
|
||||
tmp_base: "{{ app_base }}/www_tmp"
|
||||
app_env: "production"
|
||||
testing_mode: false
|
||||
update_revision: 1
|
||||
|
||||
roles:
|
||||
|
|
Loading…
Reference in New Issue