network and serial complete
This commit is contained in:
8
ansible/roles/hypervisor_qcow/tasks/libvirt_dir.yaml
Normal file
8
ansible/roles/hypervisor_qcow/tasks/libvirt_dir.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
|
||||
- name: Format and mount the libvirt disk if it is not root
|
||||
when: hypervisor.device not in (ansible_mounts | json_query('[?mount == `/`].device'))
|
||||
ansible.builtin.include_tasks:
|
||||
file: libvirt_mount.yaml
|
||||
|
||||
|
@ -1,41 +1,5 @@
|
||||
---
|
||||
|
||||
- name: Clear systemd-networkd config directory
|
||||
ansible.builtin.file:
|
||||
path: "/etc/systemd/network/"
|
||||
state: "{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
with_items:
|
||||
- absent
|
||||
- directory
|
||||
|
||||
- name: Create systemd-networkd config files
|
||||
ansible.builtin.template:
|
||||
src: "{{ item.src }}"
|
||||
dest: /etc/systemd/network/"{{ item.name }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
loop: "{{ systemd_networkd_configs }}"
|
||||
|
||||
- name: Disable non-systemd networking services
|
||||
ansible.builtin.service:
|
||||
name: "{{ item }}"
|
||||
state: stopped
|
||||
enabled: false
|
||||
loop: "{{ default_network_services[ansible_os_family] }}"
|
||||
|
||||
- name: Enable systemd networking
|
||||
ansible.builtin.service:
|
||||
name: "{{ item }}"
|
||||
state: started
|
||||
enabled: true
|
||||
loop:
|
||||
- systemd-networkd
|
||||
- systemd-resolved
|
||||
|
||||
- name: Install libvirt packages (Arch)
|
||||
when: ansible_os_distribution == 'Archlinux'
|
||||
community.general.pacman:
|
||||
@ -74,3 +38,13 @@
|
||||
community.libvirt.virt_net:
|
||||
name: default
|
||||
state: absent
|
||||
|
||||
- name: Setup libvirt storage (qcow)
|
||||
when: hypervisor.storage == 'dir'
|
||||
ansible.builtin.include_tasks:
|
||||
file: libvirt_dir.yaml
|
||||
|
||||
- name: Setup libvirt storage (zfs)
|
||||
when: hypervisor.storage == 'zfs'
|
||||
ansible.builtin.include_tasks:
|
||||
file: libvirt_zfs.yaml
|
||||
|
Reference in New Issue
Block a user