Add os variant support to kvm guest install
This commit is contained in:
parent
143688d988
commit
ef741895a5
2 changed files with 25 additions and 0 deletions
22
group_vars/rocky8.yml
Normal file
22
group_vars/rocky8.yml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
---
|
||||||
|
# default resources for new vm
|
||||||
|
dsk_size: 20
|
||||||
|
mem_size: 2048
|
||||||
|
num_cpus: 2
|
||||||
|
|
||||||
|
# extra args for virt-install
|
||||||
|
ks_file: "{{ boot_url }}/ks/rocky8.ks"
|
||||||
|
ipcmd: >-
|
||||||
|
{% if network_interfaces[0]['proto'] is defined %}
|
||||||
|
{% if network_interfaces[0]['proto'] == 'static' %}
|
||||||
|
{% set int=network_interfaces[0] %}
|
||||||
|
{% if int['ipaddr'] is defined and int['gateway'] is defined %}
|
||||||
|
nameserver=8.8.8.8
|
||||||
|
ip={{ int['ipaddr'] }}::{{ int['gateway'] }}:{{ int['netmask'] }}::eth0:none
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
virt_install_os_args: >
|
||||||
|
--location https://download.rockylinux.org/pub/rocky/8/BaseOS/x86_64/os
|
||||||
|
--extra-args "inst.ks={{ ks_file }} console=ttyS0 net.ifnames=0 bootdev=eth0 {{ ipcmd }}"
|
||||||
|
virt_install_os_variant: centos8
|
|
@ -92,6 +92,9 @@
|
||||||
--vcpus "sockets=1,cores={{ num_cpus }},threads=1,placement=auto" \
|
--vcpus "sockets=1,cores={{ num_cpus }},threads=1,placement=auto" \
|
||||||
--memory {{ mem_size }} --cpu host-passthrough \
|
--memory {{ mem_size }} --cpu host-passthrough \
|
||||||
--disk {{ os_disk_image }},{{ dsk_opts }},size={{ dsk_size }} \
|
--disk {{ os_disk_image }},{{ dsk_opts }},size={{ dsk_size }} \
|
||||||
|
{% if virt_install_os_variant is defined -%}
|
||||||
|
--os-variant {{ virt_install_os_variant }} \
|
||||||
|
{% endif -%}
|
||||||
{% if inject -%}
|
{% if inject -%}
|
||||||
--initrd-inject {{ tmpdir.path }}/include.ks \
|
--initrd-inject {{ tmpdir.path }}/include.ks \
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue