Merge pull request #4 from SherifNagy/kvmhosts-playbook

KVM host initial playbook
This commit is contained in:
Louis Abel 2020-12-10 10:50:36 -07:00 committed by GitHub
commit 9a62020a48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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"