summaryrefslogtreecommitdiff
path: root/tasks/icecast2_setup.yaml
blob: 506c537d11c327646130c0bbe05cb8b9e3254c89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
- name: ensure {{ radio_music_dir }} directory exists
  file:
    path: "{{ radio_music_dir }}"
    state: directory
    owner: icecast2
    group: icecast
    mode: '0700'

- name: ensure {{ radio_music_dir }}/tracks directory exists
  file:
    path: "{{ radio_music_dir }}/tracks"
    state: directory
    owner: icecast2
    group: icecast
    mode: '0700'

- name: ensure {{ radio_music_dir }}/logs directory exists
  file:
    path: "{{ radio_music_dir }}/logs"
    state: directory
    owner: icecast2
    group: icecast
    mode: '0700'

- name: deploy icecast.xml from template
  template:
    src: etc/icecast2/icecast.xml.j2
    dest: /etc/icecast2/icecast.xml
    owner: root
    group: root
    mode: '0644'

- name: deploy radio.liq from template
  template:
    src: srv/radio/radio.liq.j2
    dest: "{{ radio_music_dir }}/radio.liq"
    owner: icecast2
    group: icecast
    mode: '0744'

- name: deploy liquidsoap-radio.service from template
  template:
    src: etc/systemd/system/liquidsoap-radio.service
    dest: /etc/systemd/system/liquidsoap-radio.service
    owner: icecast2
    group: icecast
    mode: '0744'

- name: reload systemd daemon
  systemd:
    daemon_reload: yes

- name: restart and enable icecast2 
  systemd:
    name: icecast2
    state: restarted
    enabled: true
  when: ansible_service_mgr == 'systemd'

- name: restart and enable liquidsoap-radio
  systemd:
    name: liquidsoap-radio
    state: restarted
    enabled: true
  when: ansible_service_mgr == 'systemd'

#- name: deploy ices-playlist.xml.j2 from template
#  template:
#    src: icecast2/ices-playlist.xml.j2
#    dest: /etc/icecast2/ices-playlist.xml
#    owner: root
#    group: root
#    mode: '0644'

#- name: deploy mp3-to-ogg.sh from template
#  template:
#    src: icecast2/mp3-to-ogg.sh.j2
#    dest: /etc/icecast2/mp3-to-ogg.sh
#    owner: root
#    group: root
#    mode: '0744'