Pull correct tasks definitions from v1.0.0

This commit is contained in:
Eric Meehan 2025-07-31 10:00:20 -04:00
parent ee1dd815e9
commit 237e337430
11 changed files with 53 additions and 27 deletions

View File

@ -1,3 +1,4 @@
name: alpha-worker-13
vcpu:
placement: static
value: 2

View File

@ -1,3 +1,4 @@
name: alpha-worker-14
vcpu:
placement: static
value: 2

View File

@ -1,3 +1,4 @@
name: alpha-worker-15
vcpu:
placement: static
value: 2

View File

@ -1,3 +1,4 @@
name: alpha-worker-16
vcpu:
placement: static
value: 2

View File

@ -1,3 +1,4 @@
name: alpha-worker-17
vcpu:
placement: static
value: 2

1
host_vars/evm.yaml Normal file
View File

@ -0,0 +1 @@
name: evm

View File

@ -13,4 +13,5 @@ libvirt_guests:
- alpha-worker-15
- alpha-worker-16
- alpha-worker-17
- evm
nfs_exports: ["/data *(rw,sync,no_root_squash)"]

View File

@ -15,6 +15,9 @@ all:
vms:
children:
user:
hosts:
evm:
clusters:
children:
control_planes:

View File

@ -55,9 +55,19 @@
line: 'net.ipv6.conf.all.forwarding = 1'
state: present
- name: Copy interfaces template
template:
src: interfaces.j2
dest: /etc/network/interfaces
- name: Reload sysctl configuration
command: sysctl --system
- name: Reload network service
service:
name: networking
state: restarted
- name: Define libvirt networks
community.libvirt.virt_net:
name: "{{ item.name }}"
@ -77,51 +87,50 @@
autostart: true
loop: "{{ libvirt_networks }}"
- name: Ensure that a network is active (needs to be defined and built first)
community.libvirt.virt_net:
state: active
name: "{{ item.name }}"
loop: "{{ libvirt_networks }}"
- name: Download base image for guests
- name: Download base image
get_url:
url: https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2
dest: /var/lib/libvirt/images/debian-12-generic-amd64.qcow2
force: true
- name: Copy base image
copy:
src: /var/lib/libvirt/images/debian-12-generic-amd64.qcow2
remote_src: true
dest: "/var/lib/libvirt/images/{{ item }}.qcow2"
force: true
loop: "{{ libvirt_guests }}"
- name: Create cloud-config directory for guests
- name: Resize images
command: "qemu-img resize -f qcow2 /var/lib/libvirt/images/{{ item }}.qcow2 16G"
loop: "{{ libvirt_guests }}"
- name: Create cloud-config directory
file:
path: "/var/lib/libvirt/configs/{{ item }}"
path: "/tmp/{{ item }}"
state: directory
loop: "{{ libvirt_guests }}"
- name: Copy cloud-config templates for guests
- name: Copy cloud-config user-data template
template:
src: user-data.j2
dest: "/var/lib/libvirt/configs/{{ domain.name }}/user-data"
dest: "/tmp/{{ domain.name }}/user-data"
force: true
loop: "{{ libvirt_guests }}"
vars:
domain: "{{ hostvars[item] }}"
- name: Copy cloud-config templates for guests
- name: Copy cloud-config meta-data template
template:
src: meta-data.j2
dest: "/var/lib/libvirt/configs/{{ domain.name }}/meta-data"
dest: "/tmp/{{ domain.name }}/meta-data"
force: true
loop: "{{ libvirt_guests }}"
vars:
domain: "{{ hostvars[item] }}"
- name: Generate iso for guests
command: "genisoimage -output /var/lib/libvirt/images/{{ item }}.iso -volid cidata -joliet -rock /var/lib/libvirt/configs/{{ item }}/user-data /var/lib/libvirt/configs/{{ item }}/meta-data"
loop: "{{ libvirt_guests }}"
- name: Copy logging config for guests
copy:
src: 05_logging.cfg
dest: "/var/lib/libvirt/configs/{{ item }}/05_logging.cfg"
- name: Generate iso
command: "genisoimage -output /var/lib/libvirt/images/{{ item }}.iso -volid cidata -joliet -rock /tmp/{{ item }}/user-data /tmp/{{ item }}/meta-data"
loop: "{{ libvirt_guests }}"
- name: Define libvirt virtual machine
@ -138,12 +147,20 @@
command: create
loop: "{{ libvirt_guests }}"
- name: Autostart libvirt virtual machine
- name: Autostart libvirt virtual machines
community.libvirt.virt:
name: "{{ item }}"
autostart: true
loop: "{{ libvirt_guests }}"
- name: Wait for guest initialization
wait_for:
timeout: 300
- name: Reset libvirt virtual machines for filesystem resize
command: "virsh reset {{ item }}"
loop: "{{ libvirt_guests }}"
- name: Wait for manual tasks
hosts: localhost
tasks:
@ -158,6 +175,7 @@
- alpha-worker-15
- alpha-worker-16
- alpha-worker-17
- evm
become: true
vars_files:
- ../secrets.yaml
@ -216,7 +234,7 @@
- role: geerlingguy.kubernetes
- name: Deploy base Kubernetes resources
hosts: alpha_control_plane
hosts: alpha-control-plane
become: true
tasks:
- name: Deploy NFS Provisioner

@ -1 +1 @@
Subproject commit 410e87d127cdc942f01bbed09b6a6c1ba041d237
Subproject commit 5de5270b7346a6b4a3c69fbea3aa56116f158547

View File

@ -4,6 +4,4 @@
vars_files:
- ../secrets.yaml
roles:
- role: ericomeehan.matrix-stack
vars:
server_name: eom.dev
- role: ericomeehan.mastodon