Skip to content

Commit

Permalink
feat: hostgroups and compute profile for VMs per libvirt host added (#…
Browse files Browse the repository at this point in the history
…168)

* feat: hostgroups and compute profile for VMs per libvirt host added

* chore: smol adjustment in description of image repo

* fix: typo

* feat: new tasks compute_profiles and subnets added to main
  • Loading branch information
smirta authored Jul 27, 2024
1 parent 3d536ff commit 5632105
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 5 deletions.
3 changes: 1 addition & 2 deletions roles/content/tasks/products.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,5 @@
virt-customize -a
Downloads/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2 --install
subscription-manager --run-command "echo -e 'network:\n config:
disabled\n' > /etc/cloud/cloud.cfg"
subscription-manager
content_type: file
24 changes: 21 additions & 3 deletions roles/foreman/tasks/host_groups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,10 @@
parent: RaBe Core/RaBe Base/EL9/AlmaLinux 9
organization: RaBe
location: Randweg
domain: dmz.int.rabe.ch
subnet: dmz
domain: dmz-admin.int.rabe.ch
subnet: dmz-admin
ansible_roles:
- redhat.rhel_system_roles.network
- radiorabe.foreman_libvirt.libvirt
- radiorabe.common.download_file
parameters:
Expand Down Expand Up @@ -157,4 +158,21 @@
parent: Bond bond0
controller: dmz
port_type: bridge

- name: AlmaLinux 9 DMZ server-008 VMs
description: AlmaLinux 9 virtual machines to be run on server-008
parent: RaBe Core/RaBe Base/EL9/AlmaLinux 9
organization: RaBe
location: Randweg
domain: dmz.int.rabe.ch
subnet: dmz
compute_resource: server-008.dmz-admin.int.rabe
compute_profile: 1-Small
- name: AlmaLinux 9 DMZ server-009 VMs
description: AlmaLinux 9 virtual machines to be run on server-009
parent: RaBe Core/RaBe Base/EL9/AlmaLinux 9
organization: RaBe
location: Randweg
domain: dmz.int.rabe.ch
subnet: dmz
compute_resource: server-009.dmz-admin.int.rabe
compute_profile: 1-Small
114 changes: 114 additions & 0 deletions roles/infrastructure/tasks/compute_profiles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
- name: 'RaBe Foreman Infrastructure : Configure Compute Profiles'
ansible.builtin.include_role:
name: theforeman.foreman.compute_profiles
vars:
foreman_compute_profiles:
- name: 1-Small
compute_attributes:
- compute_resource: server-008.dmz-admin.int.rabe.ch
vm_attrs:
cpus: 1
memory: 2147483648
image_id: /var/lib/libvirt/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2
volumes_attributes:
0:
pool_name: default
capacity: 10G
allocation: 10G
format_type: qcow2
interfaces_attributes:
0:
type: bridge
network: dmz
model: virtio
- name: 2-Medium
compute_attributes:
- compute_resource: server-008.dmz-admin.int.rabe.ch
vm_attrs:
cpus: 2
memory: 4294967296
image_id: /var/lib/libvirt/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2
volumes_attributes:
0:
pool_name: default
capacity: 10G
allocation: 10G
format_type: qcow2
interfaces_attributes:
0:
type: bridge
network: dmz
model: virtio
- name: 3-Large
compute_attributes:
- compute_resource: server-008.dmz-admin.int.rabe.ch
vm_attrs:
cpus: 4
memory: 8589934592
image_id: /var/lib/libvirt/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2
volumes_attributes:
0:
pool_name: default
capacity: 10G
allocation: 10G
format_type: qcow2
interfaces_attributes:
0:
type: bridge
network: dmz
model: virtio
- name: 1-Small
compute_attributes:
- compute_resource: server-009.dmz-admin.int.rabe.ch
vm_attrs:
cpus: 1
memory: 2147483648
image_id: /var/lib/libvirt/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2
volumes_attributes:
0:
pool_name: default
capacity: 10G
allocation: 10G
format_type: qcow2
interfaces_attributes:
0:
type: bridge
network: dmz
model: virtio
- name: 2-Medium
compute_attributes:
- compute_resource: server-009.dmz-admin.int.rabe.ch
vm_attrs:
cpus: 2
memory: 4294967296
image_id: /var/lib/libvirt/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2
volumes_attributes:
0:
pool_name: default
capacity: 10G
allocation: 10G
format_type: qcow2
interfaces_attributes:
0:
type: bridge
network: dmz
model: virtio
- name: 3-Large
compute_attributes:
- compute_resource: server-009.dmz-admin.int.rabe.ch
vm_attrs:
cpus: 4
memory: 8589934592
image_id: /var/lib/libvirt/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2
volumes_attributes:
0:
pool_name: default
capacity: 10G
allocation: 10G
format_type: qcow2
interfaces_attributes:
0:
type: bridge
network: dmz
model: virtio
10 changes: 10 additions & 0 deletions roles/infrastructure/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
tags:
- role::rabe_foreman.infrastructure
- role::rabe_foreman.infrastructure:domains
- name: 'RaBe Foreman Infrastructure : Compute Profiles'
ansible.builtin.import_tasks: compute_profiles.yaml
tags:
- role::rabe_foreman.infrastructure
- role::rabe_foreman.infrastructure:compute_profiles
- name: 'RaBe Foreman Infrastructure : Compute Resources'
ansible.builtin.import_tasks: compute_resources.yaml
tags:
Expand All @@ -14,6 +19,11 @@
tags:
- role::rabe_foreman.infrastructure
- role::rabe_foreman.infrastructure:realms
- name: 'RaBe Foreman Infrastructure : Subnets'
ansible.builtin.import_tasks: subnets.yaml
tags:
- role::rabe_foreman.infrastructure
- role::rabe_foreman.infrastructure:subnets
- name: 'RaBe Foreman Infrastructure : Bootdisk'
ansible.builtin.import_tasks: bootdisk.yaml
tags:
Expand Down

0 comments on commit 5632105

Please sign in to comment.