summaryrefslogtreecommitdiff
path: root/roles/streaming
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-04-24 19:27:10 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-04-24 19:27:10 +0200
commit8c0ee8bca2cd460080a1c544de92b644c2856925 (patch)
tree22a3672a134e525999dc6038656c191b6cb72e5c /roles/streaming
parentsgg-icecast: change icecast contact addr. (diff)
icecast: make shoutcast compatible configs possible
Diffstat (limited to 'roles/streaming')
-rw-r--r--roles/streaming/icecast/defaults/main.yml6
-rw-r--r--roles/streaming/icecast/templates/icecast.xml.j233
-rw-r--r--roles/streaming/icecast/templates/pod-spec.yml.j210
3 files changed, 36 insertions, 13 deletions
diff --git a/roles/streaming/icecast/defaults/main.yml b/roles/streaming/icecast/defaults/main.yml
index 673284fd..ba5bd99f 100644
--- a/roles/streaming/icecast/defaults/main.yml
+++ b/roles/streaming/icecast/defaults/main.yml
@@ -4,7 +4,10 @@ icecast_base_path: /srv/icecast
# icecast_instances:
# example:
# image_version: 2021-04-23.1
-# port: 8080
+# listeners:
+# - port: 8000
+# shoutcast_mountpoint: /stream
+# - port: 8080
# source_password: quite-secret
# relay_password: quite-secret
@@ -17,6 +20,7 @@ icecast_base_path: /srv/icecast
# location: Graz/Austria
# contact: icecast@example.com
+# ## optional
# mountpoints:
# '/test.mp3':
# username: ## optional
diff --git a/roles/streaming/icecast/templates/icecast.xml.j2 b/roles/streaming/icecast/templates/icecast.xml.j2
index 3bf0044a..60f6000f 100644
--- a/roles/streaming/icecast/templates/icecast.xml.j2
+++ b/roles/streaming/icecast/templates/icecast.xml.j2
@@ -1,9 +1,5 @@
<icecast>
<!-- ***** global ***** -->
- <listen-socket>
- <port>8080</port>
- </listen-socket>
-
<limits>
<threadpool>5</threadpool>
<queue-size>524288</queue-size>
@@ -15,8 +11,12 @@
</limits>
<authentication>
+{% if 'source_password' in item.value %}
<source-password>{{ item.value.source_password }}</source-password>
+{% endif %}
+{% if 'relay_password' in item.value %}
<relay-password>{{ item.value.relay_password }}</relay-password>
+{% endif %}
<admin-user>{{ item.value.admin.username }}</admin-user>
<admin-password>{{ item.value.admin.password }}</admin-password>
</authentication>
@@ -32,21 +32,34 @@
{% endif %}
+<!-- ***** listeners ***** -->
+{% for listener in item.value.listeners %}
+ <listen-socket>
+ <port>{{ listener.port }}</port>
+{% if 'shoutcast_mountpoint' in listener %}
+ <shoutcast-mount>{{ listener.shoutcast_mountpoint }}</shoutcast-mount>
+{% endif %}
+ </listen-socket>
+
+{% endfor %}
+
+{% if 'mountpoints' in item.value %}
<!-- ***** mountpoints ***** -->
-{% for mountpoint, config in item.value.mountpoints.items() %}
+{% for mountpoint, config in item.value.mountpoints.items() %}
<mount>
<mount-name>{{ mountpoint }}</mount-name>
-{% if 'username' in config %}
+{% if 'username' in config %}
<username>{{ config.username }}</username>
-{% endif %}
+{% endif %}
<password>{{ config.password }}</password>
-{% if 'max_listeners' in config %}
+{% if 'max_listeners' in config %}
<max-listeners>{{ config.max_listeners }}</max-listeners>
-{% endif %}
+{% endif %}
</mount>
-{% endfor %}
+{% endfor %}
+{% endif %}
<!-- ***** aux ***** -->
<fileserve>1</fileserve>
<paths>
diff --git a/roles/streaming/icecast/templates/pod-spec.yml.j2 b/roles/streaming/icecast/templates/pod-spec.yml.j2
index 5dc0b086..bac1ac3b 100644
--- a/roles/streaming/icecast/templates/pod-spec.yml.j2
+++ b/roles/streaming/icecast/templates/pod-spec.yml.j2
@@ -22,8 +22,14 @@ containers:
mountPath: /srv/logs
subPath: logs
ports:
- - containerPort: 8080
- hostPort: {{ item.value.port }}
+{% for listener in item.value.listeners %}
+ - containerPort: {{ listener.port }}
+ hostPort: {{ listener.port }}
+{% if 'shoutcast_mountpoint' in listener %}
+ - containerPort: {{ listener.port + 1 }}
+ hostPort: {{ listener.port + 1 }}
+{% endif %}
+{% endfor %}
volumes:
- name: home