KVM host initial playbook

This commit is contained in:
Sherif Nagy 2020-12-10 17:38:37 +00:00
parent a9a483b546
commit ff54f8249e
Signed by untrusted user who does not match committer: sherif
GPG Key ID: 9F610DDEC6338F94
3 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,4 @@
[kvmhosts]
kvm001.rockylinux.org ansible_host=10.100.2.110
kvm002.rockylinux.org ansible_host=10.100.2.111
kvm003.rockylinux.org ansible_host=10.100.2.112

View File

@ -0,0 +1,6 @@
---
# Check virtualization is enabled
- name: Check for CPU Virtualization
shell: "lscpu | grep -i virtualization"
register: result
failed_when: "result.rc != 0"

View File

@ -0,0 +1,25 @@
---
# Install KVM packages
- name: Installing KVM Packages
package:
name: "{{ item }}"
state: present
with_items:
- qemu-kvm
- libvirt
- libvirt-python
- libguestfs-tools
- virt-install
- name: Enable and Start libvirtd
systemd:
name: libvirtd
state: started
enabled: yes
- name: Verify KVM module is loaded
shell: "lsmod | grep -i kvm"
register: result
failed_when: "result.rc != 0"