summaryrefslogtreecommitdiff
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
parentsgg-icecast: change icecast contact addr. (diff)
icecast: make shoutcast compatible configs possible
-rw-r--r--inventory/host_vars/sgg-icecast.yml10
-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
-rw-r--r--spreadspace/host_vars/sgg-icecast.yml27
5 files changed, 49 insertions, 37 deletions
diff --git a/inventory/host_vars/sgg-icecast.yml b/inventory/host_vars/sgg-icecast.yml
index eef28af6..6f88219b 100644
--- a/inventory/host_vars/sgg-icecast.yml
+++ b/inventory/host_vars/sgg-icecast.yml
@@ -58,10 +58,11 @@ kubernetes_standalone_cni_variant: with-portmap
icecast_instances:
schlagergarten:
image_version: 2021-04-23.1
- port: 8080
+ listeners:
+ - port: 8080
+ shoutcast_mountpoint: /live.mp3
source_password: "{{ vault_icecast_secrets['schlagergarten'].source_password }}"
- relay_password: "{{ vault_icecast_secrets['schlagergarten'].relay_password }}"
admin:
username: admin
password: "{{ vault_icecast_secrets['schlagergarten'].admin_password }}"
@@ -69,8 +70,3 @@ icecast_instances:
hostname: "{{ external_ip }}"
location: Graz/Austria
contact: bussi@schlagergartengloria.at
-
- mountpoints:
- '/live.mp3':
- username: live
- password: "{{ vault_icecast_secrets['schlagergarten'].mountpoint_passwords['live.mp3'] }}"
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
diff --git a/spreadspace/host_vars/sgg-icecast.yml b/spreadspace/host_vars/sgg-icecast.yml
index c0e42963..a2fbf9c2 100644
--- a/spreadspace/host_vars/sgg-icecast.yml
+++ b/spreadspace/host_vars/sgg-icecast.yml
@@ -1,18 +1,11 @@
$ANSIBLE_VAULT;1.2;AES256;spreadspace
-39356439616363336239303163333166353034663966653934623963326433363061646164313031
-3862333763653737313830346237636531363966326336360a646166333832303135353833303831
-33393163633339636334653337346164636663653839306662616463386633396130643062376364
-3565333734323136340a306163663337663863616633613837636364643231353138393661353163
-33306332323030336566376634616663643636663335373033363935613964333166663661656138
-34636336383532646535396135303064653664626564333666623833303930396630633663356136
-39613038373831396662623630636338636164373664656235666362313633306439613631383064
-38613733613861663666666431373234306539666638616564353034396335656434393364613532
-30643032373332646335386566373866366536643866633537353061623866666234643862306464
-38666634653539396336393235343232363664326361386566666466633931373765383463613965
-63333262666230613033326364656235313530363932643461386362363839323035336436313130
-37316138323363613632626338353630643831643332396363333264653631383061396266383530
-32633032613631643530653534653563356539373836353934383062646434383062303162393934
-33383262303137396566656333626131636430656136666664656432646431383838303137346133
-36306465333335316131626165383937313237353461616464333933333837373166336130356539
-33666666646561373735643131656235366336303362633131363436613834376338383362306334
-61316435333265626339363965353836373464613338356137393434663539336164
+39363834326634646135336332623265656639643265336365376261623735656232336431633866
+3338626436643936626538396436626435383733356662330a373538303865623430386430343034
+30613631333931373363323962373737656230303162633331333334323663336433306464646466
+3338333661393232620a303932653164376533653266656361633338323962643935343533303736
+37353863343437333362653736353031343737373836393866323762303866626231616665646535
+35396633653666633262386536623139383831313365643734633438306634353463626461363337
+32303636616337306563613937616339336334313235306563616436363438323235323863313632
+31393238346534346335333261343033623831616632343137613737663766373935623962353262
+63376333666466323866336166373636626335633561633166343535653539306138643164306632
+3833316531323761613465383437646336643763646266643032