---
- name: Dependencies installed
  community.general.pkgng:
    name: icecast
    state: latest

- name: Icecast silence.mp3 installed
  copy:
    src: silence.mp3
    dest: /usr/local/share/icecast/web/
    owner: root
    mode: 0664

- name: Icecast settings installed
  template:
    src: icecast.xml.j2
    dest: /usr/local/etc/icecast.xml
    owner: root
    mode: 0664
  notify: Icecast restarted

- name: Icecast enabled
  shell: sysrc icecast_enable="YES"
  notify: Icecast restarted

- name: Icecast started
  service: name=icecast state=started
