mirror of
https://github.com/rocky-linux/infrastructure
synced 2024-11-22 13:11:29 +00:00
KVM host initial playbook
This commit is contained in:
parent
a9a483b546
commit
ff54f8249e
4
ansible/inventory/kvmhostsinventory
Normal file
4
ansible/inventory/kvmhostsinventory
Normal 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
|
6
ansible/role-rocky-check-virt.yml
Normal file
6
ansible/role-rocky-check-virt.yml
Normal 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"
|
25
ansible/role-rocky-install-kvm-hosts.yml
Normal file
25
ansible/role-rocky-install-kvm-hosts.yml
Normal 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"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user