1
0

new hypervisor role

This commit is contained in:
michael 2023-08-09 15:49:23 +10:00
parent 1df2adffdb
commit 590a50cd1a
14 changed files with 9 additions and 30 deletions

View File

@ -22,5 +22,6 @@
"vs-kubernetes.local-tunnel-debug-provider": "",
"checkForMinikubeUpgrade": true,
"imageBuildTool": "Docker"
}
},
"ansible.python.interpreterPath": "/usr/bin/python3"
}

View File

@ -1,50 +1,28 @@
---
- name: install libvirt server packages
- name: Install libvirt server packages
become: true
community.general.pacman:
name: "{{ libvirt_server_packages }}"
state: latest
state: present
update_cache: true
when:
- ansible_os_family == 'Arch'
- name: add user to libvirt group
- name: Add user to libvirt group
become: true
ansible.builtin.user:
name: "{{ ansible_user }}"
groups: libvirt
append: true
- name: start and enable libvirt service
- name: Start and enable libvirt service
become: true
ansible.builtin.service:
name: libvirtd.service
state: started
enabled: yes
enabled: true
- name: set cluster network variables
set_fact:
libvirt_network_name: "{{ libvirt_cluster_network_name }}"
libvirt_network_domain: "{{ libvirt_cluster_network_name }}"
- name: define vm cluster network
community.libvirt.virt_net:
name: "{{ libvirt_cluster_network_name }}"
command: define
xml: '{{ lookup("template", "network.xml.j2") }}'
- name: build vm cluster network
community.libvirt.virt_net:
name: "{{ libvirt_cluster_network_name }}"
command: create
- name: start vm cluster network
community.libvirt.virt_net:
name: "{{ libvirt_cluster_network_name }}"
state: active
autostart: true
- name: remove default libvirt network
- name: Remove default libvirt network
community.libvirt.virt_net:
name: default
state: absent