new hypervisor role
This commit is contained in:
parent
1df2adffdb
commit
590a50cd1a
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -22,5 +22,6 @@
|
||||
"vs-kubernetes.local-tunnel-debug-provider": "",
|
||||
"checkForMinikubeUpgrade": true,
|
||||
"imageBuildTool": "Docker"
|
||||
}
|
||||
},
|
||||
"ansible.python.interpreterPath": "/usr/bin/python3"
|
||||
}
|
0
ansible/roles/hypervisor_qcow/tasks/main.yaml
Normal file
0
ansible/roles/hypervisor_qcow/tasks/main.yaml
Normal 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
|
Loading…
Reference in New Issue
Block a user