infra/roles/icecast/tasks/icecast.yml

48 lines
772 B
YAML

---
- name: install icecast
apt:
name:
- icecast2
state: latest
tags:
- packages
- name: template config
template:
src: "{{ item }}.j2"
dest: "/etc/icecast2/{{ item }}"
owner: root
group: icecast
mode: '0640'
loop_control:
label: "{{ item }}"
with_items:
- icecast.xml
notify:
- restart icecast
tags:
- icecast-config
- name: template default file
template:
src: "{{ item }}.j2"
dest: "/etc/default/{{ item }}"
owner: root
group: root
mode: '0644'
loop_control:
label: "{{ item }}"
with_items:
- icecast2
notify:
- restart icecast
tags:
- icecast-config
- name: start and enable service
service:
name: icecast2
state: started
enabled: true