Move installing libvirt to system

This commit is contained in:
Wojciech Kozlowski 2023-07-16 17:37:55 +02:00
parent 1ca5f2c591
commit 55b8a0c419
4 changed files with 12 additions and 52 deletions

View File

@ -1,46 +0,0 @@
---
- name: "libvirt : install libvirt"
ansible.builtin.apt:
name:
- "dnsmasq"
- "libvirt-daemon-system"
- "netcat"
- "qemu-system"
install_recommends: false
register: music_rip_libvirt_install
- name: "libvirt : install zfs storage driver for libvirt"
ansible.builtin.apt:
name:
- "libvirt-daemon-driver-storage-zfs"
when:
"'zfs' in group_names"
register: music_rip_libvirt_zfs_install
- name: "libvirt : enable libvirtd"
ansible.builtin.systemd:
name: "libvirtd"
enabled: true
- name: "libvirt : start libvirtd"
ansible.builtin.systemd:
name: "libvirtd"
state: "started"
register: music_rip_libvirt_start
- name: "libvirt : restart libvirtd"
ansible.builtin.systemd:
name: "libvirtd"
state: "restarted"
when:
(music_rip_libvirt_install.changed or
(music_rip_libvirt_zfs_install is defined and
music_rip_libvirt_zfs_install.changed)) and
not music_rip_libvirt_start.changed
- name: "libvirt : add {{ music_user_name }} to group \"libvirt\""
ansible.builtin.user:
name: "{{ music_user_name }}"
groups: "libvirt"
append: true

View File

@ -8,8 +8,3 @@
ansible.builtin.import_tasks: "include/samba.yml" ansible.builtin.import_tasks: "include/samba.yml"
tags: tags:
- "music:rip:samba" - "music:rip:samba"
- name: "play:music : role:rip : tasks:libvirt"
ansible.builtin.import_tasks: "include/libvirt.yml"
tags:
- "music:rip:libvirt"

View File

@ -101,6 +101,17 @@
vars: vars:
system_base_user_become_user: "{{ system_base_ssh_user }}" system_base_user_become_user: "{{ system_base_ssh_user }}"
- name: "system : yggdrasil"
hosts: "yggdrasil"
roles:
- role: "system/extra/libvirt"
tags:
- "system:extra"
- "system:extra:libvirt"
vars:
system_extra_libvirt_user_name: "{{ system_base_ssh_user }}"
system_extra_libvirt_install_zfs_driver: "{{ 'zfs' in group_names }}"
- name: "system : asgard:&zfs" - name: "system : asgard:&zfs"
hosts: "asgard:&zfs" hosts: "asgard:&zfs"
roles: roles:

2
roles

@ -1 +1 @@
Subproject commit 403b65f81280ec1e4d9a3b9d2816b3f3b42587f8 Subproject commit c4af7178b2bfda71c58bad3be09576f53a6d7603