Merge pull request 'Feature: Deploy it-tools through Ansible' (#15) from feature/adopt-it-tools-stack into main
Checks / Secret Scan (push) Successful in 5s
Checks / Lint (push) Successful in 22s

This commit was merged in pull request #15.
This commit is contained in:
claude-bot Bot committed 2026-11-27 21:10:25 +01:00
commit e654ae3bec
8 files changed
+69 -1

No files matched your search

+3
View File
@@ -48,6 +48,9 @@ jobs:
- name: Install Lint Tools
run: pip install -r requirements-dev.txt
- name: Install Ansible Collections
run: ansible-galaxy collection install -r collections/requirements.yml
- name: Run yamllint
run: yamllint --strict .
+18
View File
@@ -0,0 +1,18 @@
name: Deploy Stacks
on:
workflow_dispatch:
jobs:
deploy-stacks:
name: Deploy Stacks
runs-on: ansible
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Ansible Collections
run: ansible-galaxy collection install -r collections/requirements.yml
- name: Run Stacks Playbook
run: ansible-playbook playbooks/docker_stacks.yml --diff
+1 -1
View File
@@ -19,7 +19,7 @@ Branch → PR (lint, secret scan, later `--check --diff`) → merge to protected
- Keep the `/home/pi/docker/<service>/` paths, because Compose derives the project name from the folder.
- Ansible manages config, never data. No ownership changes under `DOCKER_DATA_ROOT` (mapped UIDs).
- When adopting a stack: pin its image, remove its Watchtower label, and require a no-change dry run first.
- When adopting a stack: pin its image and remove its Watchtower label.
- Gitea, its runner and Postgres never auto-deploy. I trigger them from the `ansible` LXC.
## Secrets
+4
View File
@@ -0,0 +1,4 @@
---
collections:
- name: community.docker
version: "5.4.1"
+10
View File
@@ -0,0 +1,10 @@
---
- name: Deploy stacks
hosts: docker_hosts
gather_facts: false
tasks:
- name: Deploy it-tools
ansible.builtin.include_role:
name: docker_stack
vars:
docker_stack_name: it-tools
+3
View File
@@ -0,0 +1,3 @@
---
docker_stack_root: "{{ homelab_stacks_root }}"
docker_stack_name: ""
+18
View File
@@ -0,0 +1,18 @@
---
- name: Require a stack name
ansible.builtin.assert:
that:
- docker_stack_name | length > 0
fail_msg: "docker_stack_name must be set"
quiet: true
- name: Copy compose file for {{ docker_stack_name }}
ansible.builtin.copy:
src: "{{ playbook_dir }}/../stacks/{{ docker_stack_name }}/docker-compose.yml"
dest: "{{ docker_stack_root }}/{{ docker_stack_name }}/docker-compose.yml"
mode: "0644"
- name: Start {{ docker_stack_name }}
community.docker.docker_compose_v2:
project_src: "{{ docker_stack_root }}/{{ docker_stack_name }}"
state: present
+12
View File
@@ -0,0 +1,12 @@
services:
it-tools:
image: corentinth/it-tools:latest
ports:
- 8085:80
restart: unless-stopped
container_name: it-tools
labels:
- "com.centurylinklabs.watchtower.enable=true"
environment:
- PUID=1000
- PGID=1000