rhjhunt.libvirt_vm
libvirt-vm
Ansible-Rolle zur Installation einer libvirt- virtuellen Maschine auf einem RHEL/CentOS KVM-Hypervisor.
Anforderungen
- Ansible 2.9 oder höher
- Red Hat Enterprise Linux (RHEL) oder CentOS 7 oder 8
Rollenvariablen
Die folgenden Variablen werden für diese Rolle unterstützt.
Rollenvariable | Erforderlich | Standard | Beschreibung |
---|---|---|---|
libvirt_vm_ip | :x: | Öffentliche IP der libvirt-VM | |
libvirt_vm_hostname | :heavy_check_mark: | Der FQDN der VM | |
libvirt_vm_root_pwd | :heavy_check_mark: | Passwort des Root-Benutzers | |
libvirt_vm_base_img | :heavy_check_mark: | Name des Basisbildes | |
libvirt_vm_storage_pool | :x: | default |
libvirt-Speicherpool |
libvirt_vm_network | :heavy_check_mark: | Netzwerktyp für die libvirt-VM | |
libvirt_vm_vcpus | :x: | 1 |
Anzahl der vCPUs für die VM |
libvirt_vm_ram | :x: | 1024 |
Menge an RAM in Megabyte |
libvirt_vm_os_image_name | :x: | {{ libvirt_vm_hostname }} |
Name des VM-Images |
libvirt_vm_os_image_size | :x: | 10G |
Größe des OS-Images der VM |
libvirt_vm_os_variant | :x: | rhel8.1 |
libvirt OS-Variante |
libvirt_vm_nics | :heavy_check_mark: | siehe Beispiel-Playbook |
Wörterbuch zur Definition der VM-NIC |
Abhängigkeiten
Keine
Beispiel-Playbook
- hosts: hypervisor
tags: provision
vars:
libvirt_vm_hostname: "vm.example.com"
libvirt_vm_root_pwd: "Pa$$w0rD!"
libvirt_vm_base_img: rhel-guest-image-8.qcow2
libvirt_vm_storage_pool: "default"
libvirt_vm_network: "bridge=br0,model=virtio"
libvirt_vm_vcpus: "2"
libvirt_vm_ram: "4096"
libvirt_vm_os_image_name: "{{ libvirt_vm_hostname }}"
libvirt_vm_os_image_size: "20G"
libvirt_vm_os_variant: "rhel8.1"
libvirt_vm_nics:
- name: eth0
bootproto: static
onboot: yes
ip: "{{ libvirt_vm_ip }}"
prefix: "24"
gateway: "192.168.122.1"
dns_server: "192.168.122.1"
tasks:
- name: Erstelle eine libvirt-VM
include_role:
name: rhjhunt.libvirt_vm
Die libvirt-VM kann auch eine DHCP-Adresse zugewiesen bekommen.
- hosts: hypervisor
tags: provision
vars:
libvirt_vm_hostname: "vm.example.com"
libvirt_vm_root_pwd: "Pa$$w0rD!"
libvirt_vm_base_img: rhel-guest-image-8.qcow2
libvirt_vm_storage_pool: "default"
libvirt_vm_network: "bridge=br0,model=virtio"
libvirt_vm_vcpus: "2"
libvirt_vm_ram: "4096"
libvirt_vm_os_image_name: "{{ libvirt_vm_hostname }}"
libvirt_vm_os_image_size: "20G"
libvirt_vm_os_variant: "rhel8.1"
libvirt_vm_nics:
- name: eth0
bootproto: dhcp
onboot: yes
tasks:
- name: Erstelle eine libvirt-VM
include_role:
name: rhjhunt.libvirt_vm
Lizenz
Autoreninformation
Jacob Hunt jhunt@redhat.com
Installieren
ansible-galaxy install rhjhunt.libvirt_vm
Lizenz
gpl-3.0
Downloads
73
Besitzer