This commit is contained in:
42
roles/ampache/tasks/ampache.yml
Normal file
42
roles/ampache/tasks/ampache.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
|
||||
## Remove the previous app & install the new version
|
||||
- name: Remove Ampache previous version
|
||||
ansible.builtin.file:
|
||||
state: absent
|
||||
dest: "{{ ampache_app_home }}"
|
||||
|
||||
- name: Create app home
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
dest: "{{ ampache_app_home }}"
|
||||
owner: root
|
||||
group: www-data
|
||||
mode: "0o750"
|
||||
|
||||
- name: Install ampache application
|
||||
ansible.builtin.unarchive:
|
||||
remote_src: true
|
||||
src: "{{ ampache_url }}"
|
||||
dest: "{{ ampache_app_home }}"
|
||||
owner: root
|
||||
group: www-data
|
||||
mode: "a-rwx,u+rwX,g+rX"
|
||||
# exclude: "{{ firefly3_userdata_app_dirs | map('regex_replace', '^', './') }}"
|
||||
|
||||
- name: Put config file
|
||||
ansible.builtin.template:
|
||||
src: "ampache.cfg.php.j2"
|
||||
dest: "{{ ampache_app_home }}/config/ampache.cfg.php"
|
||||
owner: root
|
||||
group: www-data
|
||||
mode: "0o640"
|
||||
|
||||
## Ensure the data dirs exists, populate them if not
|
||||
- name: Create data home
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
path: "{{ ampache_data_home }}"
|
||||
owner: www-data
|
||||
group: www-data
|
||||
mode: "0o750"
|
20
roles/ampache/tasks/db.yml
Normal file
20
roles/ampache/tasks/db.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
|
||||
- name: Create ampache db
|
||||
community.mysql.mysql_db:
|
||||
login_unix_socket: "/var/run/mysqld/mysqld.sock"
|
||||
login_user: root
|
||||
login_password: "{{ mariadb_root_pass }}"
|
||||
name: "{{ ampache_maria_database }}"
|
||||
state: present
|
||||
encoding: utf8mb4
|
||||
collation: utf8mb4_general_ci
|
||||
|
||||
- name: Create ampache db read/write user
|
||||
community.mysql.mysql_user:
|
||||
login_unix_socket: "/var/run/mysqld/mysqld.sock"
|
||||
login_user: root
|
||||
login_password: "{{ mariadb_root_pass }}"
|
||||
name: "{{ ampache_maria_user }}"
|
||||
password: "{{ ampache_maria_password }}"
|
||||
priv: "{{ ampache_maria_database }}.*:ALL"
|
10
roles/ampache/tasks/main.yml
Normal file
10
roles/ampache/tasks/main.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
|
||||
- name: Init db
|
||||
ansible.builtin.include_tasks: db.yml
|
||||
|
||||
- name: Install ampache
|
||||
ansible.builtin.include_tasks: ampache.yml
|
||||
|
||||
#- name: Install firefly3 cron
|
||||
# ansible.builtin.include_tasks: cron.yml
|
1465
roles/ampache/templates/ampache.cfg.php.j2
Normal file
1465
roles/ampache/templates/ampache.cfg.php.j2
Normal file
File diff suppressed because it is too large
Load Diff
10
roles/ampache/vars/main.yml
Normal file
10
roles/ampache/vars/main.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
|
||||
ampache_version: "7.7.2"
|
||||
ampache_url: "https://github.com/ampache/ampache/releases/download/{{ ampache_version }}/ampache-{{ ampache_version }}_all_php{{ php_version }}.zip"
|
||||
|
||||
ampache_access_url: "{{ web_hostname | selectattr('type', 'defined') | selectattr('type', '==', 'ampache') | map(attribute='host') | first }}"
|
||||
|
||||
# Access path
|
||||
ampache_app_home: "/var/www/{{ ampache_access_url }}"
|
||||
ampache_data_home: "/srv/www-data/{{ ampache_access_url }}"
|
Reference in New Issue
Block a user