Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4852971991 | ||
|
|
4d8c3cc0b4 | ||
|
|
431702ff74 | ||
|
|
67addcbe1b | ||
|
|
e654ae3bec | ||
|
|
1b25ff1450 | ||
|
|
a23ba7bee8 | ||
|
|
1b05e959e3 | ||
|
|
0289a216ba | ||
|
|
660765d1c6 |
No files matched your search
@@ -105,7 +105,7 @@ Keep it short:
|
||||
|
||||
- PR link and commits.
|
||||
- The review result, with any pre-existing findings or nits worth a follow-up.
|
||||
- What the merge triggers, from `on.push` in `.gitea/workflows/`. Today no workflow deploys on merge; say so until that changes.
|
||||
- What the merge triggers, from `on.push` in `.gitea/workflows/`. Say whether the PR touched a `deploy-stacks.yaml` path, and so deployed.
|
||||
- Anything left uncommitted.
|
||||
|
||||
Do not delete the branch, dispatch a workflow, or change a live system.
|
||||
@@ -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 .
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
name: Deploy Stacks
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- stacks/**
|
||||
- roles/docker_stack/**
|
||||
- playbooks/docker_stacks.yml
|
||||
- inventory/**
|
||||
- collections/requirements.yml
|
||||
- .gitea/workflows/deploy-stacks.yaml
|
||||
|
||||
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
|
||||
@@ -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
|
||||
@@ -42,7 +42,7 @@ Only commit when I explicitly say "commit" for that change. A yes to a question
|
||||
|
||||
The remote is a self-hosted Gitea, so `gh` doesn't work. For PRs and their CI status use `.claude/scripts/gitea.sh` (acts as `claude-bot`), e.g. `.claude/scripts/gitea.sh GET '/repos/kasun/homelab-ansible/pulls?state=open'`. Use it for PRs, and for issues when I ask. Reading from Gitea is free.
|
||||
|
||||
Open and merge PRs through `/merge`: typing it is my OK to commit, open a PR and merge for that run. Outside `/merge`, ask first. Every merge call asks for permission (also inside `/merge`), and `.claude/hooks/guard-merge.sh` refuses it unless the PR's newest review comment is a pass for its head commit. Before deploy-on-merge is enabled, revisit this: PRs that deploy will need my approval.
|
||||
Open and merge PRs through `/merge`: typing it is my OK to commit, open a PR and merge for that run. Outside `/merge`, ask first. Every merge call asks for permission (also inside `/merge`), and `.claude/hooks/guard-merge.sh` refuses it unless the PR's newest review comment is a pass for its head commit. Merging deploys: a push to `main` that touches the paths in `.gitea/workflows/deploy-stacks.yaml` runs the stacks playbook, so allowing the merge prompt is also my OK to deploy.
|
||||
|
||||
## Verifying changes
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
collections:
|
||||
- name: community.docker
|
||||
version: "5.4.1"
|
||||
@@ -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
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
docker_stack_root: "{{ homelab_stacks_root }}"
|
||||
docker_stack_name: ""
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
- 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: Create stack directory for {{ docker_stack_name }}
|
||||
ansible.builtin.file:
|
||||
path: "{{ docker_stack_root }}/{{ docker_stack_name }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- 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
|
||||
@@ -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
|
||||
Reference in new issue
Block a user