Add support to provision OpenBSD KVM guests
This commit is contained in:
parent
d9f009565c
commit
fc25e0a108
2 changed files with 14 additions and 2 deletions
|
@ -14,3 +14,6 @@ tls_bundle: "{{ tls_certs }}/cert.pem"
|
||||||
dsk_size: 10
|
dsk_size: 10
|
||||||
mem_size: 256
|
mem_size: 256
|
||||||
num_cpus: 1
|
num_cpus: 1
|
||||||
|
|
||||||
|
# extra args for virt-install
|
||||||
|
virt_install_os_args: --cdrom https://www.foo.sh/ks/openbsd/openbsd.iso
|
||||||
|
|
|
@ -13,6 +13,9 @@
|
||||||
dsk_opts: bus=virtio,cache=none,device=disk,format=raw
|
dsk_opts: bus=virtio,cache=none,device=disk,format=raw
|
||||||
base: /srv/libvirt/hdd/{{ inventory_hostname }}
|
base: /srv/libvirt/hdd/{{ inventory_hostname }}
|
||||||
|
|
||||||
|
inject: >-
|
||||||
|
{% if not '--cdrom' in virt_install_os_args %}{{ true }}{% endif %}
|
||||||
|
|
||||||
virt_install_disks: >-
|
virt_install_disks: >-
|
||||||
{% if datadisks is defined %}
|
{% if datadisks is defined %}
|
||||||
{% for i in range(datadisks|count) %}
|
{% for i in range(datadisks|count) %}
|
||||||
|
@ -44,7 +47,9 @@
|
||||||
state: directory
|
state: directory
|
||||||
register: tmpdir
|
register: tmpdir
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
when: inventory_hostname not in result.list_vms
|
when:
|
||||||
|
- inventory_hostname not in result.list_vms
|
||||||
|
- inject is defined
|
||||||
|
|
||||||
- name: create inject file
|
- name: create inject file
|
||||||
copy:
|
copy:
|
||||||
|
@ -57,7 +62,9 @@
|
||||||
%end
|
%end
|
||||||
dest: "{{ tmpdir.path }}/include.ks"
|
dest: "{{ tmpdir.path }}/include.ks"
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
when: inventory_hostname not in result.list_vms
|
when:
|
||||||
|
- inventory_hostname not in result.list_vms
|
||||||
|
- inject is defined
|
||||||
|
|
||||||
- name: run virt-install
|
- name: run virt-install
|
||||||
command: >
|
command: >
|
||||||
|
@ -69,7 +76,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 inject -%}
|
||||||
--initrd-inject {{ tmpdir.path }}/include.ks \
|
--initrd-inject {{ tmpdir.path }}/include.ks \
|
||||||
|
{% endif -%}
|
||||||
{{ virt_install_disks }} \
|
{{ virt_install_disks }} \
|
||||||
{{ virt_install_network }} \
|
{{ virt_install_network }} \
|
||||||
{{ virt_install_os_args }}
|
{{ virt_install_os_args }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue