Add ansible files

This commit is contained in:
Evrard Van Espen
2025-11-23 11:22:45 +00:00
parent 8fc60f9d8b
commit bc439597cb
26 changed files with 1364 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
- name: Setup Gitea
vars_files:
- secrets/git_secrets.yaml
- config/config_vars.yaml
hosts:
- localhost
tasks:
- name: Add Gitea chart repo
kubernetes.core.helm_repository:
name: gitea-charts
repo_url: "https://dl.gitea.com/charts/"
- name: Setup Gitea
kubernetes.core.helm:
name: gitea
chart_ref: gitea-charts/gitea
update_repo_cache: true
create_namespace: true
release_namespace: gitea
values: "{{ lookup('template', 'files/gitea_values.template.yaml') | from_yaml }}"
- name: Setup gitea service
kubernetes.core.k8s:
template: files/gitea_svc.template.yaml
state: present
- name: Get Gitea runner registration token
uri:
url: "https://{{ git.domain }}/api/v1/admin/actions/runners/registration-token"
method: POST
headers:
Content-Type: "application/json"
Authorization: "Basic {{ (git_admin_username + ':' + git_admin_password) | b64encode }}"
body_format: json
body:
name: "admin-token"
scopes: ["all"]
register: gitea_token_response
no_log: true
- name: Create Gitea runner registration token secret
kubernetes.core.k8s:
state: present
namespace: gitea
definition:
apiVersion: v1
kind: Secret
metadata:
name: gitea-runner-registration-token
type: Opaque
data:
token: "{{ gitea_token_response.json.token | b64encode }}"
- name: Setup gitea runner
kubernetes.core.k8s:
template: files/gitea_runner.template.yaml
state: present