Skip to content

Commit

Permalink
an unoderly commit but now i can create and destroy groups of vms
Browse files Browse the repository at this point in the history
  • Loading branch information
lanefu committed May 23, 2024
1 parent d83c31f commit 9b7c089
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 6 deletions.
9 changes: 9 additions & 0 deletions cockpit-vmhost.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- hosts:
- cockpit_vmhost

tasks:
- name: cockpit role
import_role:
name: lanefu.armlab.cockpit
tags:
- cockpit
38 changes: 38 additions & 0 deletions host_vars/nasbo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## kvm-provision vars
armlab_provision_image_folder: /mnt/zfs/crucial/images
armlab_provision_machines_base: /mnt/zfs/crucial/machines

## zfs role vars
debian_use_backports: no
debian_release: "trixie"
debian_headers_package: "linux-headers-edge-rockchip-rk3588"
zfs_enable_iscsi: no
zfs_enable_nfs: yes
zfs_create_pools: yes
zfs_create_filesystems: yes
zfs_pools:
- name: NVME-SMALL-TANK
action: create
devices:
- nvme-PCIe_SSD_511220920241000311
- nvme-PCIe_SSD_511220920241000287
type: mirror
state: present
- name: NVME-BIG-TANK
action: create
devices:
- nvme-CT500P3SSD8_2234E6580C25
- nvme-CT500P3SSD8_2234E6580C2A
type: mirror
state: present
zfs_filesystems:
- name: crucial
pool: NVME-BIG-TANK
mountpoint: /mnt/zfs/crucial
quota: 100G
state: present
- name: cheapo
pool: NVME-SMALL-TANK
mountpoint: /mnt/zfs/cheapo
quota: 200G
state: present
28 changes: 23 additions & 5 deletions inventory/hosts.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
lab-nas:
lab_nas:
hosts:
nanopc-cm3588-nas:
debian_use_backports: no
debian_release: "trixie"
debian_headers_package: "linux-headers-edge-rockchip-rk3588"
nasbo:

cockpit_vmhost:
children:
lab_nas:
hosts:
ronny-1:

nasbo_k8s_nodes:
hosts:
ksmall-1:
ksmall-2:
ksmall-3:

ronny_1_k8s_nodes:
hosts:
kmedium-1:
kmedium-2:

k8s_nodes:
children:
nasbo_k8s_nodes:
ronny_1_k8s_nodes:
2 changes: 1 addition & 1 deletion lab-nas.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- hosts:
- lab-nas
- lab_nas

tasks:
- name: zfs role
Expand Down
38 changes: 38 additions & 0 deletions provision_k8s_nodes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---

### will have to do a play per host
- hosts:
- nasbo

tasks:
- name: build nasbo k8s vms
include_role:
name: lanefu.armlab.provision_kvm_guest
vars:
armlab_provision_image_folder: /mnt/zfs/crucial/images
armlab_provision_machine_folder: /mnt/zfs/crucial/machines/ksmall
armlab_provision_image_size: 40G
armlab_provision_hostname: "{{ item }}"
loop: "{{ groups['nasbo_k8s_nodes']}}"
tags:
- provision
- kvm

- hosts:
- ronny-1

tasks:
- name: build ronny_1 k8s vms
include_role:
name: lanefu.armlab.provision_kvm_guest
vars:
armlab_provision_image_folder: /mnt/cheapo/images
armlab_provision_machine_folder: /mnt/cheapo/machines/kmedium
armlab_provision_image_size: 40G
armlab_provision_smp: 4
armlab_provision_memory: 4000
armlab_provision_hostname: "{{ item }}"
loop: "{{ groups['ronny_1_k8s_nodes']}}"
tags:
- provision
- kvm
9 changes: 9 additions & 0 deletions provision_vm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- hosts:
- nasbo

tasks:
- name: cockpit role
import_role:
name: lanefu.armlab.provision_kvm_guest
tags:
- provision
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ansible-core~=2.16
lxml~=5.2
25 changes: 25 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
---
roles:
- name: xanmanning.k3s
version: v3.4.4
- name: githubixx.iscsi_target
version: 2.0.0
- name: githubixx.ansible_role_wireguard
version: 16.0.2
- name: robertdebock.kubectl
version: 2.1.5
- name: robertdebock.update
version: 3.1.8
- name: robertdebock.terraform
version: 4.1.7
- name: geerlingguy.helm
version: 1.0.1
collections:
- name: ansible.posix
- name: ansible.utils
- name: community.general
- name: community.libvirt
version: 1.3.0
- name: kubernetes.core
version: 3.0.1
- name: containers.podman
version: 1.13.0
- name: devsec.hardening
version: 9.0.1
- name: kubevirt.core
version: 1.3.2

0 comments on commit 9b7c089

Please sign in to comment.