From 8c0ee8bca2cd460080a1c544de92b644c2856925 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 24 Apr 2021 19:27:10 +0200 Subject: icecast: make shoutcast compatible configs possible --- roles/streaming/icecast/templates/icecast.xml.j2 | 33 ++++++++++++++++------- roles/streaming/icecast/templates/pod-spec.yml.j2 | 10 +++++-- 2 files changed, 31 insertions(+), 12 deletions(-) (limited to 'roles/streaming/icecast/templates') 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 @@ - - 8080 - - 5 524288 @@ -15,8 +11,12 @@ +{% if 'source_password' in item.value %} {{ item.value.source_password }} +{% endif %} +{% if 'relay_password' in item.value %} {{ item.value.relay_password }} +{% endif %} {{ item.value.admin.username }} {{ item.value.admin.password }} @@ -32,21 +32,34 @@ {% endif %} + +{% for listener in item.value.listeners %} + + {{ listener.port }} +{% if 'shoutcast_mountpoint' in listener %} + {{ listener.shoutcast_mountpoint }} +{% endif %} + + +{% endfor %} + +{% if 'mountpoints' in item.value %} -{% for mountpoint, config in item.value.mountpoints.items() %} +{% for mountpoint, config in item.value.mountpoints.items() %} {{ mountpoint }} -{% if 'username' in config %} +{% if 'username' in config %} {{ config.username }} -{% endif %} +{% endif %} {{ config.password }} -{% if 'max_listeners' in config %} +{% if 'max_listeners' in config %} {{ config.max_listeners }} -{% endif %} +{% endif %} -{% endfor %} +{% endfor %} +{% endif %} 1 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 -- cgit v1.2.3