Role - kubeinit_libvirt

Role Documentation

Please, refer to the kubeinit_libvirt role official docs for further information.

Role Defaults

This section highlights all of the defaults and variables set within the “kubeinit_libvirt” role.

# All variables intended for modification should be placed in this file.

# All variables within this role should have a prefix of "kubeinit_libvirt_"
kubeinit_libvirt_debug: '{{ (ansible_verbosity | int) >= 2 | bool }}'
kubeinit_libvirt_hide_sensitive_logs: true

kubeinit_libvirt_reboot_hypervisors_after_package_update: false
kubeinit_libvirt_reboot_guests_after_package_update: false

kubeinit_libvirt_target_image_dir: /var/lib/libvirt/images

# Setting the variable kubeinit_libvirt_cloud_user_create
# to true will create a toor user with passwordless access
# It will also set the root password to the value of the
# variable kubeinit_libvirt_cloud_user_password
kubeinit_libvirt_cloud_user_create: false
kubeinit_libvirt_cloud_user: toor
kubeinit_libvirt_cloud_user_password: asdfasdf

kubeinit_libvirt_source_keystore_dir: /home/{{ kubeinit_libvirt_cloud_user }}/.ssh
kubeinit_libvirt_source_pubkey_file: id_{{ kubeinit_ssh_keytype }}.pub

kubeinit_libvirt_centos_release: '20220808.1'
kubeinit_libvirt_debian_release: '11'
kubeinit_libvirt_debian_codename: bullseye

kubeinit_libvirt_cloud_images:
  cdk:
    uri: https://cloud-images.ubuntu.com/focal/current/
    image: focal-server-cloudimg-amd64.img
  rke:
    uri: https://cloud-images.ubuntu.com/jammy/current/
    image: jammy-server-cloudimg-amd64.img
  kid:
    uri: https://cloud.debian.org/images/cloud/bullseye/daily/latest/
    image: debian-{{ kubeinit_libvirt_debian_release }}-genericcloud-amd64-daily.qcow2
  eks:
    uri: https://cloud.centos.org/centos/9-stream/x86_64/images/
    image: CentOS-Stream-GenericCloud-9-{{ kubeinit_libvirt_centos_release }}.x86_64.qcow2
  k8s:
    uri: https://cloud.centos.org/centos/9-stream/x86_64/images/
    image: CentOS-Stream-GenericCloud-9-{{ kubeinit_libvirt_centos_release }}.x86_64.qcow2
  okd:
    uri: https://cloud.centos.org/centos/9-stream/x86_64/images/
    image: CentOS-Stream-GenericCloud-9-{{ kubeinit_libvirt_centos_release }}.x86_64.qcow2
  ocp:
    uri: https://cloud.centos.org/centos/9-stream/x86_64/images/
    image: CentOS-Stream-GenericCloud-9-{{ kubeinit_libvirt_centos_release }}.x86_64.qcow2

kubeinit_libvirt_extra_cloud_images:
- description: Windows Server 2022 preview (EVAL)
  uri: https://software-static.download.prss.microsoft.com/sg/download/888969d5-f34g-4e03-ac9d-1f9786c66749/
  image: SERVER_EVAL_x64FRE_en-us.iso
- description: VirtIO drivers for Windows guests
  uri: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.217-1/
  image: virtio-win-0.1.217.iso

kubeinit_libvirt_destroy_all_guests: false

kubeinit_libvirt_hypervisor_tmp_dir: /tmp

kubeinit_libvirt_ovn_encapsulation: geneve
kubeinit_libvirt_ovn_switch: sw0
kubeinit_libvirt_ovn_northbound_port: 6641
kubeinit_libvirt_ovn_southbound_port: 6642

kubeinit_libvirt_hypervisor_dependencies:
  centos:
  - libguestfs-tools-c
  - python3-libselinux
  - libvirt
  - libvirt-daemon
  - libvirt-daemon-kvm
  - libvirt-client
  - qemu-kvm
  - virt-install
  - virt-top
  - virt-viewer
  - libguestfs-tools
  - lvm2
  - python3-libvirt
  - python3-lxml
  - python3-netaddr
  - curl
  - binutils
  - qt5-qtbase
  - gcc
  - make
  - patch
  - libgomp
  - glibc-headers
  - glibc-devel
  - kernel-headers
  - kernel-devel
  - bash-completion
  - nano
  - wget
  - python3-pip
  - iptables-services
  - net-tools
  - xz
  - perl-XML-XPath
  - jq
  debian:
  - sudo
  - numad
  - qemu
  - qemu-kvm
  - qemu-system
  - libvirt-clients
  - libvirt-daemon-system
  - libvirt-daemon
  - virt-manager
  - bridge-utils
  - libguestfs-tools
  - genisoimage
  - virtinst
  - libosinfo-bin
  - python3
  - python3-pip
  - python3-libvirt
  - python3-lxml
  - python3-netaddr
  - nano
  - wget
  - xz-utils
  - inetutils-ping
  - libxml-xpath-perl
  - jq

Tasks files

This section highlights all the documentation available in the tasks files.

Molecule Scenarios

Molecule is being used to test the “kubeinit_libvirt” role. The following section highlights the drivers in service and provides an example playbook showing how the role is leveraged.

Scenario: default

Driver: docker
Example default playbook
- name: Converge
  hosts: all
  # roles:
  #   - role: "kubeinit_libvirt"
  tasks:
  - name: Message for "kubeinit_libvirt"
    ansible.builtin.debug:
      msg: Finishing molecule for "kubeinit_libvirt"