1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00
iiab/roles/azuracast/tasks/install.yml

79 lines
2.4 KiB
YAML
Raw Normal View History

- name: AzuraCast - Make config directory {{ azuracast_host_dir }}
2019-06-13 12:26:26 +00:00
file:
path: "{{ azuracast_host_dir }}"
state: directory
- name: AzuraCast - Install {{ azuracast_host_dir }}/.env from template
2019-06-13 12:26:26 +00:00
template:
src: env.j2
dest: "{{ azuracast_host_dir }}/.env"
owner: root
group: root
mode: 0644
- name: AzuraCast - Install {{ azuracast_host_dir }}/docker-compose.override.yml from template
template:
src: docker-compose.override.yml.j2
dest: "{{ azuracast_host_dir }}/docker-compose.override.yml"
owner: root
group: root
mode: 0644
- name: AzuraCast - Download {{ docker_sh_url }} to {{ azuracast_host_dir }}
2019-06-13 12:26:26 +00:00
get_url:
url: "{{ docker_sh_url }}"
dest: "{{ azuracast_host_dir }}/"
timeout: "{{ download_timeout }}"
mode: 0755
when: internet_available | bool
- name: AzuraCast - Download AzuraCast's docker-compose.yml sample from GitHub to {{ azuracast_host_dir }}
2019-06-18 12:16:21 +00:00
get_url:
url: "{{ docker_compose_url }}"
dest: "{{ azuracast_host_dir }}/docker-compose.yml"
timeout: "{{ download_timeout }}"
mode: 0755
when: internet_available | bool
2019-06-18 12:16:21 +00:00
- name: AzuraCast - Make changes to docker.sh script so it runs headless
2019-06-13 12:26:26 +00:00
lineinfile:
path: "{{ azuracast_host_dir }}/docker.sh"
regexp: "^(.*)read reply.*"
line: "\\1reply='Y'"
2019-06-13 12:26:26 +00:00
backrefs: yes
- name: AzuraCast - Make directory {{ docker_container_dir }}
2019-06-13 12:26:26 +00:00
file:
path: "{{ docker_container_dir }}"
state: directory
- name: AzuraCast - Symlink /var/lib/docker -> {{ docker_container_dir }}
2019-06-13 12:26:26 +00:00
file:
src: "{{ docker_container_dir }}"
path: /var/lib/docker
2019-06-13 12:26:26 +00:00
state: link
- name: Change default port number range 8xxx:8xxx to {{ azuracast_port_range_prefix }}xxx:{{ azuracast_port_range_prefix }}xxx icecast-stations in docker-compose.yml
2019-06-18 12:16:21 +00:00
replace:
path: "{{ azuracast_host_dir }}/docker-compose.yml"
regexp: "^( *- \\')8([0-9]{3})\\:8([0-9]{3}\\'.*)$"
replace: "\\g<1>{{ azuracast_port_range_prefix }}\\g<2>:{{ azuracast_port_range_prefix }}\\g<3>"
2019-06-18 12:16:21 +00:00
- name: AzuraCast - Run the installer
2019-06-13 12:26:26 +00:00
shell: "/bin/bash docker.sh install"
args:
chdir: "{{ azuracast_host_dir }}"
2019-09-14 21:50:19 +00:00
2020-01-30 09:00:00 +00:00
# RECORD AzuraCast AS INSTALLED
- name: "Set 'azuracast_installed: True'"
set_fact:
azuracast_installed: True
- name: "Add 'azuracast_installed: True' to {{ iiab_state_file }}"
2019-09-14 21:50:19 +00:00
lineinfile:
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
2019-09-14 21:50:19 +00:00
regexp: '^azuracast_installed'
2019-10-07 17:11:21 +00:00
line: 'azuracast_installed: True'