Update storage and Keycloak config
This commit is contained in:
@@ -19,11 +19,16 @@ sno_vm_name: "sno-{{ ocp_cluster_name }}"
|
||||
sno_cpu: 8
|
||||
sno_memory_mb: 32768
|
||||
sno_disk_gb: 120
|
||||
sno_bridge: vmbr0
|
||||
sno_vlan: 40
|
||||
sno_mac: ""
|
||||
sno_pvc_disk_gb: 100
|
||||
sno_vnet: ocp
|
||||
sno_mac: "" # populated after VM creation; set here to pin MAC
|
||||
sno_vm_id: 0
|
||||
|
||||
sno_storage_ip: ""
|
||||
sno_storage_ip_prefix_length: 24
|
||||
sno_storage_vnet: storage
|
||||
sno_storage_mac: "" # populated after VM creation; set here to pin MAC
|
||||
|
||||
# --- Installer ---
|
||||
sno_install_dir: "/tmp/sno-{{ ocp_cluster_name }}"
|
||||
sno_iso_filename: agent.x86_64.iso
|
||||
|
||||
@@ -62,17 +62,34 @@ argument_specs:
|
||||
description: Primary disk size in gigabytes.
|
||||
type: int
|
||||
default: 120
|
||||
sno_bridge:
|
||||
description: Proxmox network bridge for the VM NIC.
|
||||
sno_vnet:
|
||||
description: Proxmox SDN VNet name for the primary (OCP) NIC.
|
||||
type: str
|
||||
default: vmbr0
|
||||
sno_vlan:
|
||||
description: VLAN tag for the VM NIC.
|
||||
type: int
|
||||
default: 40
|
||||
default: ocp
|
||||
sno_mac:
|
||||
description: >-
|
||||
MAC address to assign. Leave empty for auto-assignment by Proxmox.
|
||||
MAC address for the primary NIC. Leave empty for auto-assignment by Proxmox.
|
||||
Set here to pin the MAC across VM recreations.
|
||||
type: str
|
||||
default: ""
|
||||
sno_storage_ip:
|
||||
description: >-
|
||||
IP address for the secondary storage NIC. Leave empty to skip storage
|
||||
interface configuration in agent-config.
|
||||
type: str
|
||||
default: ""
|
||||
sno_storage_ip_prefix_length:
|
||||
description: Prefix length for the storage NIC IP address.
|
||||
type: int
|
||||
default: 24
|
||||
sno_storage_vnet:
|
||||
description: Proxmox SDN VNet name for the secondary storage NIC.
|
||||
type: str
|
||||
default: storage
|
||||
sno_storage_mac:
|
||||
description: >-
|
||||
MAC address for the storage NIC. Leave empty for auto-assignment by Proxmox.
|
||||
Set here to pin the MAC across VM recreations.
|
||||
type: str
|
||||
default: ""
|
||||
sno_vm_id:
|
||||
|
||||
@@ -8,7 +8,14 @@
|
||||
__sno_deploy_net0: >-
|
||||
virtio{{
|
||||
'=' + sno_mac if sno_mac | length > 0 else ''
|
||||
}},bridge={{ sno_bridge }},tag={{ sno_vlan }}
|
||||
}},bridge={{ sno_vnet }}
|
||||
|
||||
- name: Build net1 (storage) string
|
||||
ansible.builtin.set_fact:
|
||||
__sno_deploy_net1: >-
|
||||
virtio{{
|
||||
'=' + sno_storage_mac if sno_storage_mac | length > 0 else ''
|
||||
}},bridge={{ sno_storage_vnet }}
|
||||
|
||||
- name: Create SNO VM in Proxmox
|
||||
community.proxmox.proxmox_kvm:
|
||||
@@ -34,11 +41,13 @@
|
||||
pre_enrolled_keys: false
|
||||
scsi:
|
||||
scsi0: "{{ proxmox_storage }}:{{ sno_disk_gb }},format=raw,iothread=1,cache=writeback"
|
||||
scsi1: "{{ proxmox_storage }}:{{ sno_pvc_disk_gb }},format=raw,iothread=1,cache=writeback"
|
||||
scsihw: virtio-scsi-single
|
||||
ide:
|
||||
ide2: none,media=cdrom
|
||||
net:
|
||||
net0: "{{ __sno_deploy_net0 }}"
|
||||
net1: "{{ __sno_deploy_net1 }}"
|
||||
boot: "order=scsi0;ide2"
|
||||
onboot: true
|
||||
state: present
|
||||
@@ -73,10 +82,20 @@
|
||||
cacheable: true
|
||||
when: sno_mac | length == 0
|
||||
|
||||
- name: Extract storage MAC address from VM config
|
||||
ansible.builtin.set_fact:
|
||||
sno_storage_mac: >-
|
||||
{{ __sno_deploy_vm_info.proxmox_vms[0].config.net1
|
||||
| regex_search('([0-9A-Fa-f]{2}(?::[0-9A-Fa-f]{2}){5})', '\1')
|
||||
| first }}
|
||||
cacheable: true
|
||||
when: sno_storage_mac | length == 0
|
||||
|
||||
- name: Display VM details
|
||||
ansible.builtin.debug:
|
||||
msg:
|
||||
- "VM Name : {{ sno_vm_name }}"
|
||||
- "VM ID : {{ sno_vm_id }}"
|
||||
- "MAC : {{ sno_mac }}"
|
||||
- "VM Name : {{ sno_vm_name }}"
|
||||
- "VM ID : {{ sno_vm_id }}"
|
||||
- "MAC (net0) : {{ sno_mac }}"
|
||||
- "MAC (net1) : {{ sno_storage_mac }}"
|
||||
verbosity: 1
|
||||
|
||||
@@ -11,6 +11,10 @@ hosts:
|
||||
interfaces:
|
||||
- name: primary
|
||||
macAddress: "{{ sno_mac }}"
|
||||
{% if sno_storage_ip | length > 0 %}
|
||||
- name: storage
|
||||
macAddress: "{{ sno_storage_mac }}"
|
||||
{% endif %}
|
||||
networkConfig:
|
||||
interfaces:
|
||||
- name: primary
|
||||
@@ -23,6 +27,18 @@ hosts:
|
||||
- ip: {{ sno_ip }}
|
||||
prefix-length: {{ sno_prefix_length }}
|
||||
dhcp: false
|
||||
{% if sno_storage_ip | length > 0 %}
|
||||
- name: storage
|
||||
type: ethernet
|
||||
state: up
|
||||
mac-address: "{{ sno_storage_mac }}"
|
||||
ipv4:
|
||||
enabled: true
|
||||
address:
|
||||
- ip: {{ sno_storage_ip }}
|
||||
prefix-length: {{ sno_storage_ip_prefix_length }}
|
||||
dhcp: false
|
||||
{% endif %}
|
||||
dns-resolver:
|
||||
config:
|
||||
server:
|
||||
|
||||
Reference in New Issue
Block a user