forgejo: add task for creating runnerhost vm

Signed-off-by: David Kirwan <davidkirwanirl@gmail.com>
This commit is contained in:
David Kirwan
2025-10-21 11:58:16 +01:00
parent ad62f85166
commit f7fb7cbe03
11 changed files with 94 additions and 22 deletions

View File

@@ -0,0 +1,11 @@
---
- name: Generate the forgejo-namespace.yaml from template
ansible.builtin.template:
src: "forgejo-namespace.yaml.j2"
dest: "/root/ocp4/openshift-apps/forgejo/forgejo-namespace.yaml"
mode: "0770"
- name: Deploy the forgejo-namespace.yaml config
kubernetes.core.k8s:
state: present
src: "/root/ocp4/openshift-apps/forgejo/forgejo-namespace.yaml"

View File

@@ -1,11 +0,0 @@
---
- name: Generate the forgejo-namespace.yml from template
ansible.builtin.template:
src: "forgejo-namespace.yml.j2"
dest: "/root/ocp4/openshift-apps/forgejo/forgejo-namespace.yml"
mode: "0770"
- name: Deploy the forgejo-namespace.yml config
kubernetes.core.k8s:
state: present
src: "/root/ocp4/openshift-apps/forgejo/forgejo-namespace.yml"

View File

@@ -0,0 +1,11 @@
---
- name: Generate the forgejo-runnerhost-vm.yaml from template
ansible.builtin.template:
src: "forgejo-runnerhost-vm.yaml.j2"
dest: "/root/ocp4/openshift-apps/forgejo/forgejo-runnerhost-vm.yaml"
mode: "0770"
- name: Deploy the forgejo-runnerhost-vm.yaml config
kubernetes.core.k8s:
state: present
src: "/root/ocp4/openshift-apps/forgejo/forgejo-runnerhost-vm.yaml"

View File

@@ -0,0 +1,12 @@
---
- name: Ensures /root/ocp4/openshift-apps/forgejo/ dir exists
ansible.builtin.file:
path: "/root/ocp4/openshift-apps/forgejo/"
state: directory
- include_tasks: create-forgejo-namespace.yaml
- include_tasks: create-forgejo-pvc.yaml
- include_tasks: create-postgres-operator-config.yaml
#- include_tasks: deploy-valkey.yaml
- include_tasks: call-helm.yaml
- include_tasks: create-forgejo-runnerhost-vm.yaml

View File

@@ -1,11 +0,0 @@
---
- name: Ensures /root/ocp4/openshift-apps/forgejo/ dir exists
ansible.builtin.file:
path: "/root/ocp4/openshift-apps/forgejo/"
state: directory
- include_tasks: create-forgejo-namespace.yml
- include_tasks: create-forgejo-pvc.yml
- include_tasks: create-postgres-operator-config.yml
#- include_tasks: deploy-valkey.yml
- include_tasks: call-helm.yml

View File

@@ -0,0 +1,60 @@
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
annotations:
name: forgejo-runnerhost-vm
namespace: forgejo
spec:
dataVolumeTemplates:
- metadata:
creationTimestamp: null
name: forgejo-runnerhost-vm-volume
spec:
sourceRef:
kind: DataSource
name: fedora
namespace: openshift-virtualization-os-images
storage:
resources:
requests:
storage: 30Gi
instancetype:
kind: virtualmachineclusterinstancetype
name: u1.xlarge
preference:
kind: virtualmachineclusterpreference
name: fedora
runStrategy: Always
template:
metadata:
creationTimestamp: null
labels:
network.kubevirt.io/headlessService: headless
spec:
architecture: amd64
domain:
devices:
autoattachPodInterface: false
interfaces:
- macAddress: 02:79:58:00:00:00
masquerade: {}
name: default
machine:
type: pc-q35-rhel9.6.0
resources: {}
networks:
- name: default
pod: {}
subdomain: headless
volumes:
- dataVolume:
name: fedora-forgejo-runnerhost-volume
name: rootdisk
- cloudInitNoCloud:
userData: |
#cloud-config
chpasswd:
expire: false
password: japx-h11n-xufh
user: fedora
name: cloudinitdisk