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": "", "vs-kubernetes.local-tunnel-debug-provider": "",
"checkForMinikubeUpgrade": true, "checkForMinikubeUpgrade": true,
"imageBuildTool": "Docker" "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 become: true
community.general.pacman: community.general.pacman:
name: "{{ libvirt_server_packages }}" name: "{{ libvirt_server_packages }}"
state: latest state: present
update_cache: true update_cache: true
when: when:
- ansible_os_family == 'Arch' - ansible_os_family == 'Arch'
- name: add user to libvirt group - name: Add user to libvirt group
become: true become: true
ansible.builtin.user: ansible.builtin.user:
name: "{{ ansible_user }}" name: "{{ ansible_user }}"
groups: libvirt groups: libvirt
append: true append: true
- name: start and enable libvirt service - name: Start and enable libvirt service
become: true become: true
ansible.builtin.service: ansible.builtin.service:
name: libvirtd.service name: libvirtd.service
state: started state: started
enabled: yes enabled: true
- name: set cluster network variables - name: Remove default libvirt network
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
community.libvirt.virt_net: community.libvirt.virt_net:
name: default name: default
state: absent state: absent