An Ansible role for installing an Icecast server. Notably, this role has been tested with Raspbian on Raspberry Pi hardware. This role's purpose is to make it simple to install an Icecast (Internet radio) server in any of a number of flexible configurations, such as authenticated relays.
To configure your Icecast server instance, use any number of variables that map nearly one-to-one to the configuration directives described in Icecast's Config File documentation page. Configuration directive groups are their own dictionaries, and directives that can accept more than one value are specified as a list.
Some examples may prove helpful:
- Simple Icecast server with default for all values except some user-supplied passwords and the server's public-facing hostname:
This configuration will bring up your Icecast server on its default port
icecast_hostname: radio.example.com icecast_admin_password: ChangeMe icecast_source_password: ChangeMe
8000
. You can then broadcast through it by setting up a source client to send your stream to it using the passwordChangeMe
(which, obviously, you should change). - Simple Icecast server bound to the local host only and listening on the alternative HTTP port:
Note that
icecast_listen_sockets: - port: 8080 bind_address: 127.0.0.1
icecast_listen_sockets
is a list, meaning you can open multiple sockets. If a socket doesn't include thebind_address
key, it will default to all interfaces (0.0.0.0
). - Simple Icecast server with custom server metadata and a higher number of listeners (clients) and broadcasters (sources) allowed to connect:
icecast_location: Somewhere in Cyberspace icecast_admin_email: [email protected] icecast_default_stream: /the_alternative icecast_limits_clients: 9000 icecast_limits_sources: 10
See the comments in the defaults/main.yaml
file for additional details.
Use Molecule to run the tests. (You'll also need to install Docker, as tests are run in Docker containers.) Here's how to install Molecule into a virtual environment.
# Molecule is written in Python, so you'll also need Python.
python -m venv venv # Create your virtual environment.
source venv/bin/activate # Activate it.
pip install molecule ansible-lint docker # Install testing tools.
# Then, you can run the tests:
molecule test
# When you're done, deactivate your virtual environment.
deactivate