What is this ansible repo for ?
This ansible repo aim to configure an Elastic stack ready to host your AppleMusic played history. You'll also be able to share it (read-only) publicly if you want to.
At the end you'll get:
- An Elasticsearch server (admin and read-only)
- A Kibana web app (admin and read-only)
- An Nginx with HTTP2 support and an SSL grade of A
- A restrictive firewall configuration
- An configured environment able to host your AppleMusic played history
First you need to install some dependencies:
ansible-galaxy install geerlingguy.kibana
ansible-galaxy install geerlingguy.nginx
ansible-galaxy install geerlingguy.htpasswd
ansible-galaxy install geerlingguy.certbot
The elasticsearch role uses the json_query filter which requires jmespath on the local machine.
sudo apt install python-jmespath
git clone https://github.com/CypressXt/ansible-applemusic-elastic.git
Check and edit the var file with your custom values such as your fqdn, mail address for the Let's Encrypt cert...
Configure the hosts file with the proper hosts.
ansible-playbook -i hosts elastic.yml --ask-become-pass
Here is your final cheat-sheet:
Service | URL | PORT | Privileges | basic-auth |
---|---|---|---|---|
Kibana | https://music.mydomain.gg | 443 | read-only | ❌ |
Kibana | https://music.mydomain.gg:8443 | 8443 | admin | ✅ |
Elasticsearch | https://music.mydomain.gg:9200 | 9200 | read-only | ❌ |
Elasticsearch | https://music.mydomain.gg:9203 | 9203 | admin | ✅ |