planetary-social / ansible-scripts

Ansible automation scripts used at Planetary
MIT License
2 stars 3 forks source link

Add rsslay role and example inventory/playbook #32

Closed cooldracula closed 1 year ago

cooldracula commented 1 year ago

This adds a role for creating an rsslay service on a ready planetary server. It includes the role, an example playbook, and an example inventory.

The role follows the pattern of adding a directory on the server named after the service, that holds a docker-compose file that is used to bring it up. This file uses an image generated from our rsslay repo. This repo has a workflow in place to create new images for every push to the main branch, and a new image tagged stable anytime we push a tag following a simple yyyy-mm-dd pattern.

This role includes a systemd service that polls the container registry to see if there's a new version of the stable tag and if so restarts the service to use this updated image. In this way, we can make sure our server is using the latest, stable version of the code without having to manually update it, and instead just push new tags to github.

This PR works as a proof of concept, having been used to bring up https://rsslay.ansible.fun. However, it is using an image stored at the cooldracula docker registry. We are also creating and pushing images to ghcr.io/planetary-social/rsslay, but these images are currently set to private. When they are public, I can adjust this role to use images from that registry instead.

boreq commented 1 year ago

I don't know if this helps but after merging https://github.com/planetary-social/rsslay/pull/10 the service will expose metrics as /metrics.

cooldracula commented 1 year ago

Will add the /metrics to our prometheus sources upon update!