Pin the Gitea chart and tag the runner tasks
Demo / hello (push) Successful in 1m4s

- Add gitea_chart_version (12.7.0, the deployed chart) so a rerun can't
  upgrade Gitea unexpectedly.
- Import the task files statically with tags, so
  `ansible-playbook gitea.yaml --tags actions` applies only the runner
  release. The Helm repo tasks carry both tags because the runner chart
  comes from the same repo.
- Use pullPolicy IfNotPresent for Gitea's image. The tag follows the
  pinned chart, so pulling on every restart adds a registry dependency
  without changing what runs.

Refs DevOps/software-infrastructure#35

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 20:01:05 -05:00
co-authored by Claude Opus 5.5
parent 284ecc4581
commit ffd782cfa6
3 changed files with 23 additions and 3 deletions
+6
View File
@@ -29,6 +29,12 @@ gitea_postgresql_resources:
memory: 2Gi
ephemeral-storage: 2Gi
# Gitea's Helm chart (gitea/gitea). Pinned so a rerun of the role never
# upgrades Gitea by surprise. 12.7.0 ships Gitea 1.27.0 and is the version
# deployed on 2026-11-09. Bump it deliberately, after reading the chart's
# release notes.
gitea_chart_version: 12.7.0
# Gitea Actions runner (gitea/actions chart)
gitea_actions_enabled: true
gitea_actions_chart_version: 0.1.2
+10 -1
View File
@@ -5,15 +5,19 @@
name: gitea
repo_url: https://dl.gitea.com/charts/
register: repo_update
# The runner's chart comes from this repo too.
tags: [actions]
- name: update repos
command: helm repo update
when: repo_update.changed
tags: [actions]
- name: deploy gitea
kubernetes.core.helm:
name: gitea
chart_ref: gitea/gitea
chart_version: "{{ gitea_chart_version }}"
release_namespace: gitea
create_namespace: true
values:
@@ -30,8 +34,13 @@
matchLabels:
app.kubernetes.io/component: controller
app.kubernetes.io/name: ingress-nginx
# The image tag comes from the pinned chart's appVersion (1.27.0 for
# 12.7.0), so it only changes when gitea_chart_version is bumped.
# IfNotPresent keeps a restart from pulling a re-pushed tag or
# failing because the registry is unreachable; the pinned version
# is what decides which Gitea runs.
image:
pullPolicy: Always
pullPolicy: IfNotPresent
service:
ssh:
type: LoadBalancer
+7 -2
View File
@@ -1,9 +1,14 @@
#SPDX-License-Identifier: MIT-0
---
# tasks file for ansible-role-gitea
# Static imports so tags reach every task. Apply just the runner with
# ansible-playbook gitea.yaml --tags actions
# which leaves the main Gitea release untouched.
- name: gitea
include_tasks: gitea.yaml
import_tasks: gitea.yaml
tags: [gitea]
- name: gitea actions runner
include_tasks: actions.yaml
import_tasks: actions.yaml
when: gitea_actions_enabled | bool
tags: [actions]