Add libvirt installation and setup to music/rip

This commit is contained in:
Wojciech Kozlowski 2023-02-23 22:43:37 +01:00
parent 68fb1a88e6
commit f632ec4b69
5 changed files with 55 additions and 2 deletions

View File

@ -23,6 +23,8 @@ system_mail_smtp_pass: "{{ vault_system_mail_smtp_pass }}"
system_base_additional_ssh_users: system_base_additional_ssh_users:
- "music" - "music"
system_base_udp_ports: system_base_udp_ports:
- 67 # dhcp (libvirt)
- 68 # dhcp (libvirt)
- 137 # samba - 137 # samba
- 138 # samba - 138 # samba
system_base_tcp_ports: system_base_tcp_ports:

View File

@ -0,0 +1,46 @@
---
- 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

@ -10,7 +10,7 @@
- name: "rip : set default shell" - name: "rip : set default shell"
ansible.builtin.user: ansible.builtin.user:
name: "{{ music_user_name }}" name: "{{ music_user_name }}"
shell: "/usr/bin/rbash" shell: "/usr/bin/bash"
- block: - block:

View File

@ -13,3 +13,8 @@
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"

2
roles

@ -1 +1 @@
Subproject commit 5d8a2e3f43fb408f2a58efb5d56d874c7b713c19 Subproject commit b22e1ba3d01252f487105de76a90eb6af402b809