diff --git a/readme.md b/readme.md index 7d792c1..688e4f1 100644 --- a/readme.md +++ b/readme.md @@ -10,4 +10,30 @@ You'll need to install Ansible Playbook, either through APT or another avenue. sudo apt install ansible-core ``` -Then, configure your vaults using the variable templates provided & update the hosts file to match your hosts. After you've done so, you can simply run `ansible-playbook main.yml` & it will deploy all containers. +Once you've done so, configure the [hosts](./hosts) file to direct to your server(s). You'll need to deal with the SSH setup, alongside setting up the host variables for each service you want to use. + +## Project setup + +I have this project set up like so; + +- **tasks/** - All of the playbooks for the services I deploy +- **roles/** - More comprehensive tasks, like FiveM which requires multiple JNinja templates +- **scripts/** - Any utility scripts, like the one used for deployment +- **host_vars/** - All host variables, containings variables for each service +- **main.yml** - Playbook that contains all the setup for the automated deployment + +## Deployment + +In my lab, I have a Git runner sitting on my local network. I use this to deploy changes to this repository across all of my machines. + +The business logic for how this is done is in the `scripts/deploy_containers.py` script, which handles + +- Deploying new containers +- Redeploying changed containers based on the Git diff +- Redeploying VPN-based containers that need to restart when Gluetun does +- Redeploying containers when secrets update +- Cleaning up containers/images when tasks are removed + +This uses `tags` in [main.yml](./main.yml), structured as `{container}_deploy` - so if I update Immich, it will run ansible-playbook with the argument `--tags immich_deploy`. + +When secrets for a specific host are detected as updated, it will run the deploy tasks for all containers that host has (`-l {host}`) to refresh environment variables. diff --git a/templates/prometheus.yml.j2 b/templates/prometheus.yml.j2 deleted file mode 100644 index 5b8b75f..0000000 --- a/templates/prometheus.yml.j2 +++ /dev/null @@ -1,19 +0,0 @@ -global: - scrape_interval: 15s - evaluation_interval: 15s - -scrape_configs: - # Prometheus itself - - job_name: "prometheus" - static_configs: - - targets: ["localhost:9090"] - - # Node Exporter (system metrics) - - job_name: "node-exporter" - static_configs: - - targets: ["node-exporter:9100"] - - # Docker metrics - - job_name: "cadvisor" - static_configs: - - targets: ["cadvisor:8083"] \ No newline at end of file