Finish role libvirt
This commit is contained in:
parent
0e4a0b0237
commit
66439ea6df
4 changed files with 35 additions and 9 deletions
|
@ -117,12 +117,3 @@ gaming:
|
||||||
- lib32-gst-plugins-base-libs
|
- lib32-gst-plugins-base-libs
|
||||||
- vulkan-icd-loader
|
- vulkan-icd-loader
|
||||||
- lib32-vulkan-icd-loader
|
- lib32-vulkan-icd-loader
|
||||||
|
|
||||||
libvirt:
|
|
||||||
- run:
|
|
||||||
- sudo systemctl start libvirtd.service && sudo systemctl enable libvirtd.service
|
|
||||||
- run:
|
|
||||||
- virsh pool-define-as libvirt-pool dir - - - - "/home/${USER}/.local/libvirt/images";
|
|
||||||
virsh pool-build libvirt-pool &&
|
|
||||||
virsh pool-start libvirt-pool &&
|
|
||||||
virsh pool-autostart libvirt-pool
|
|
||||||
|
|
7
roles/libvirt/handlers/main.yml
Normal file
7
roles/libvirt/handlers/main.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
- name: Enable libvirtd service
|
||||||
|
systemd:
|
||||||
|
name: libvirtd
|
||||||
|
enabled: true
|
||||||
|
state: started
|
||||||
|
scope: system
|
|
@ -33,3 +33,18 @@
|
||||||
backrefs: true
|
backrefs: true
|
||||||
backup: true
|
backup: true
|
||||||
when: "'libvirt libvirt_guest' not in nsswitch_content"
|
when: "'libvirt libvirt_guest' not in nsswitch_content"
|
||||||
|
notify: Enable libvirtd service
|
||||||
|
|
||||||
|
- name: Define session pool
|
||||||
|
virt_pool:
|
||||||
|
command: define
|
||||||
|
name: libvirt-pool
|
||||||
|
uri: "qemu:///session"
|
||||||
|
xml: "{{ lookup('template', 'libvirt-pool.xml.j2') }}"
|
||||||
|
|
||||||
|
- name: Start session pool
|
||||||
|
virt_pool:
|
||||||
|
state: active
|
||||||
|
autostart: true
|
||||||
|
name: libvirt-pool
|
||||||
|
uri: "qemu:///session"
|
||||||
|
|
13
roles/libvirt/templates/libvirt-pool.xml.j2
Normal file
13
roles/libvirt/templates/libvirt-pool.xml.j2
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<pool type='dir'>
|
||||||
|
<name>libvirt-pool</name>
|
||||||
|
<source>
|
||||||
|
</source>
|
||||||
|
<target>
|
||||||
|
<path>/home/{{ ansible_facts['env']['USER'] }}/.local/libvirt/images</path>
|
||||||
|
<permissions>
|
||||||
|
<mode>0711</mode>
|
||||||
|
<owner>1000</owner>
|
||||||
|
<group>1000</group>
|
||||||
|
</permissions>
|
||||||
|
</target>
|
||||||
|
</pool>
|
Loading…
Add table
Reference in a new issue