Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Nginx, PHP-FPM and MariaDB startup issues #3

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ansible/roles/azuracast-radio/tasks/liquidsoap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@

- name: Install Liquidsoap
apt:
deb: "https://github.com/savonet/liquidsoap/releases/download/v2.1.3/liquidsoap_2.1.3-ubuntu-{{ ansible_distribution_release }}-1_{{ dpkg_arch.stdout_lines[0] | default('amd64') }}.deb"
deb: "https://github.com/savonet/liquidsoap/releases/download/v2.1.4/liquidsoap_2.1.4-ubuntu-{{ ansible_distribution_release }}-1_{{ dpkg_arch.stdout_lines[0] | default('amd64') }}.deb"

- name: Link Liquidsoap binary
file:
Expand Down
3 changes: 2 additions & 1 deletion ansible/roles/azuracast-radio/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
- name: Install Liquidsoap (Focal)
include_tasks: liquidsoap.yml
when:
- ansible_distribution_release == 'focal'
- ansible_distribution == 'Ubuntu' and ansible_distribution_release in ['focal', 'jammy']


- name: Add Audiowaveform PPA
apt_repository:
Expand Down
9 changes: 9 additions & 0 deletions ansible/roles/mariadb/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,12 @@
enabled: false
state: stopped
ignore_errors: true

- name: Create run subfolder
become: yes
file:
path: /run/mysqld/
state: directory
owner: mysql
group: mysql
mode: 0755
4 changes: 3 additions & 1 deletion ansible/roles/mariadb/templates/supervisor.conf.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[program:mariadb]
command=/usr/sbin/mariadbd
user=mysql
priority=100
priority=200
numprocs=1
autostart=true
autorestart=unexpected
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s_error.log
13 changes: 7 additions & 6 deletions ansible/roles/nginx/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,17 @@
state: link
src: "{{ app_base }}/acme/default.crt"

- name: Disable Nginx service
service:
name: "nginx"
enabled: false
state: stopped
ignore_errors: true

- name: Install Nginx Supervisord conf
template:
src: supervisor.conf.j2
dest: /etc/supervisor/conf.d/nginx.conf
force: true
mode: 0644

- name: Disable Nginx service
service:
name: "nginx"
enabled: false
state: stopped
ignore_errors: true
2 changes: 1 addition & 1 deletion ansible/roles/nginx/templates/nginx.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ http {
# SSL Settings
##

{% if ansible_distribution_release == 'focal' %}
{% if ansible_distribution_release in ['focal','jammy'] %}
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384';
ssl_prefer_server_ciphers off;
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/php/templates/supervisor.conf.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[program:php-fpm]
command=/usr/sbin/php-fpm{{ php_version }} --nodaemonize --fpm-config /etc/php/8.1/fpm/php-fpm.conf
command=/usr/sbin/php-fpm{{ php_version }} --nodaemonize --fpm-config /etc/php/{{ php_version }}/fpm/php-fpm.conf
priority=500
numprocs=1
autostart=true
Expand Down
15 changes: 11 additions & 4 deletions ansible/roles/redis/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
---
- name: Add Redis PPA repository (Focal)
- name: Import the Redis APT key
apt_key:
url: https://packages.redis.io/gpg
state: present
become: true

- name: Install Redis deb repository
apt_repository:
repo: "ppa:chris-lea/redis-server"
update_cache: true
when: ansible_distribution_release == 'focal'
repo: deb https://packages.redis.io/deb {{ ansible_distribution_release }} main
state: present
become: true

- name: Install Redis
apt:
name: redis-server
update_cache: yes

- name: Install Redis Conf
template:
Expand Down
6 changes: 3 additions & 3 deletions ansible/roles/ufw/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
port: "{{ ufw_allow_rule }}"
proto: tcp
loop:
- 80
- 443
- 2022
- '80'
- '443'
- '2022'
- '8000:8999'
loop_control:
loop_var: ufw_allow_rule
Expand Down
27 changes: 20 additions & 7 deletions ansible/roles/uninstall/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
loop:
- "influxdb"
- "mysql"
- "mariadb"
- "php7.4-fpm"
- "php8.0-fpm"
- "php8.1-fpm"
- "php8.2-fpm"
- "nginx"
- "redis-server"
- "supervisor"
Expand Down Expand Up @@ -59,12 +63,7 @@

- name: Remove software
apt:
name: "{{ packages }}"
state: absent
force: true
purge: true
vars:
packages:
name:
# Radio software
- icecast2
- liquidsoap
Expand Down Expand Up @@ -98,9 +97,13 @@
- nginx
- nginx-*

# PHP 7.2
# PHP
- php7.2-*
- php7.3-*
- php7.4-*
- php8.0-*
- php8.1-*
- php8.2-*

# MariaDB
- mariadb-*
Expand All @@ -120,3 +123,13 @@
# System packages
- pwgen
- lnav
state: absent
force: true
purge: true
autoremove: true
ignore_errors: true

- name: clean up the apt cache
apt:
autoclean: true
become: true