IaC for deploying Icecast
Intended as a quick-start guide to support small internet-radio communities launching their own Icecast setups.
-
A DigitalOcean account.
The terraform provisioning was written for the DigitalOcean provider, because it's cheap and easy to get started with. You'll either need a digitalocean account, or you'll need to adjust the terraform setup. Recommended reading: How To Use Terraform with DigitalOcean
-
Your ssh key added to your Digital Ocean team.
See how-to docs for info. In the case of this project, the private key is stored at
~/.ssh/do_rsaMake sure to either adjust that in the/ansible/ansible.cfgor save create your key in the same name and location. -
Your DigitalOcean API token as variable in your terminal session.
export DO_PAT="person access token here"
-
Terraform installed on your local machine.
-
Ansible installed on your local machine
-
Clone project
git clone git@github.com:alex-thorne/icecast.automation.git ~/icecast-automation cd ~/icecast-automation
-
Run terraform plan:
terraform plan \ -var "do_token=${DO_PAT}" \ -var "pvt_key=$HOME/.ssh/do_rsa"
-
Run terraform apply to provision icecast and nginx droplets
terraform apply \ -var "do_token=${DO_PAT}" \ -var "pvt_key=$HOME/.ssh/do_rsa"
-
Deploy ansible playbook to install and configure icecast and nginx services on their respective hosts:
cd ../ansible ansible-playbook playbook.yml --check -
Connect. Note: no mountpoint will be available until you begin a broadcast stream on icecast once a stream is active, connect in browser via: http://:8000/live
-
Broadcast to Icecast stream, check stream output
TODO: add basic steps using BUTT to connect to stream and check that stream is playing
-
Destroy. Don't forget to tear down the droplets if you are just testing!
terraform destroy \ -var "do_token=${DO_PAT}" \ -var "pvt_key=$HOME/.ssh/do_rsa"
- check that icecast is running via: http://:8000/status.xsl
- check if you can hit the icecast server from the nginx server via
curl http://<icecastip>:8000 - check icecast error logs on icecast server via
sudo cat /var/log/icecast2/error.log - check that icecast is listening for traffic via
root@icecast:~# ss -tulnp | grep icecast. Output should be:tcp LISTEN 0 5 0.0.0.0:8000 0.0.0.0:* users:(("icecast2",pid=2934,fd=4))
- Dynamic inventory: If you deploy any later changes via ansible, remember to run terraform apply before running the Ansible playbook to ensure the inventory file is up to date with the latest IP addresses.
[ ] improve README.md
