summaryrefslogtreecommitdiff
path: root/roles/streaming/icecast/tasks/main.yml
blob: cbd9f90926c26c63c613c0e0220f00906aade941 (plain) (blame)
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
---
- name: create icecast instance directory
  loop: "{{ icecast_instances | list }}"
  file:
    path: "{{ icecast_base_path }}/{{ item }}"
    state: directory

- name: create icecast log directory
  loop: "{{ icecast_instances | list }}"
  file:
    dest: "{{ icecast_base_path }}/{{ item }}/logs"
    state: directory
    owner: app
    group: app

- name: generate icecast config
  loop: "{{ icecast_instances | dict2items }}"
  loop_control:
    label: "{{ item.key }}"
  template:
    src: icecast.xml.j2
    dest: "{{ icecast_base_path }}/{{ item.key }}/icecast.xml"
    owner: root
    group: app
    mode: 0640

- name: install pod manifest
  loop: "{{ icecast_instances | dict2items }}"
  loop_control:
    label: "{{ item.key }}"
  vars:
    kubernetes_standalone_pod:
      name: "icecast-{{ item.key }}"
      spec: "{{ lookup('template', 'pod-spec.yml.j2') }}"
      config_hash_items:
      - path: "{{ icecast_base_path }}/{{ item.key }}/icecast.xml"
        properties:
        - checksum
  include_role:
    name: kubernetes/standalone/pod