summaryrefslogtreecommitdiff
path: root/roles/streaming/icecast/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/streaming/icecast/tasks')
-rw-r--r--roles/streaming/icecast/tasks/main.yml40
1 files changed, 40 insertions, 0 deletions
diff --git a/roles/streaming/icecast/tasks/main.yml b/roles/streaming/icecast/tasks/main.yml
new file mode 100644
index 00000000..cbd9f909
--- /dev/null
+++ b/roles/streaming/icecast/tasks/main.yml
@@ -0,0 +1,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