Add libvirt installation and setup to music/rip
This commit is contained in:
parent
68fb1a88e6
commit
f632ec4b69
@ -23,6 +23,8 @@ system_mail_smtp_pass: "{{ vault_system_mail_smtp_pass }}"
|
||||
system_base_additional_ssh_users:
|
||||
- "music"
|
||||
system_base_udp_ports:
|
||||
- 67 # dhcp (libvirt)
|
||||
- 68 # dhcp (libvirt)
|
||||
- 137 # samba
|
||||
- 138 # samba
|
||||
system_base_tcp_ports:
|
||||
|
46
playbooks/roles/music/rip/tasks/include/libvirt.yml
Normal file
46
playbooks/roles/music/rip/tasks/include/libvirt.yml
Normal 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
|
@ -10,7 +10,7 @@
|
||||
- name: "rip : set default shell"
|
||||
ansible.builtin.user:
|
||||
name: "{{ music_user_name }}"
|
||||
shell: "/usr/bin/rbash"
|
||||
shell: "/usr/bin/bash"
|
||||
|
||||
- block:
|
||||
|
||||
|
@ -13,3 +13,8 @@
|
||||
ansible.builtin.import_tasks: "include/samba.yml"
|
||||
tags:
|
||||
- "music:rip:samba"
|
||||
|
||||
- name: "play:music : role:rip : tasks:libvirt"
|
||||
ansible.builtin.import_tasks: "include/libvirt.yml"
|
||||
tags:
|
||||
- "music:rip:libvirt"
|
||||
|
2
roles
2
roles
@ -1 +1 @@
|
||||
Subproject commit 5d8a2e3f43fb408f2a58efb5d56d874c7b713c19
|
||||
Subproject commit b22e1ba3d01252f487105de76a90eb6af402b809
|
Loading…
Reference in New Issue
Block a user