35 lines
994 B
YAML
35 lines
994 B
YAML
---
|
|
- name: Find fixture ZIP files
|
|
find:
|
|
paths: "{{ util_base }}/fixtures"
|
|
patterns: "*.zip"
|
|
recurse: yes
|
|
register: fixture_zip_files
|
|
|
|
- name: Extract fixture ZIP files
|
|
unarchive:
|
|
src: "{{ item.path }}"
|
|
dest: "{{ app_base }}/stations"
|
|
owner: azuracast
|
|
with_items: "{{ fixture_zip_files.files }}"
|
|
when: fixture_zip_files.matched > 0
|
|
|
|
- name: Find fixture SQL files
|
|
find:
|
|
paths: "{{ util_base }}/fixtures"
|
|
patterns: "*.sql"
|
|
recurse: yes
|
|
register: fixture_sql_files
|
|
|
|
- name: Import fixture SQL files
|
|
become: true
|
|
become_user: azuracast
|
|
shell: "php {{ util_base }}/cli.php dbal:import {{ item.path }}"
|
|
with_items: "{{ fixture_sql_files.files }}"
|
|
when: fixture_sql_files.matched > 0
|
|
|
|
- name: Clear AzuraCast Cache and Restart Stations
|
|
become: true
|
|
become_user: azuracast
|
|
shell: php {{ util_base }}/cli.php cache:clear && php {{ util_base }}/cli.php radio:restart
|
|
when: fixture_zip_files.matched > 0 or fixture_sql_files.matched > 0 |