Fix linter issues
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
d5ee4dc2f6
commit
70ec9068e8
6 changed files with 45 additions and 47 deletions
|
|
@ -1,3 +1,2 @@
|
|||
---
|
||||
qemu_default_network_interface: brdefaults
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
- name: Restart libvirt
|
||||
service: name="{{ libvirt_service }}" state=restarted
|
||||
|
||||
ansible.builtin.service:
|
||||
name: "{{ libvirt_service }}"
|
||||
state: restarted
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
- name: Define libvirt-latest CentOS repo
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: CentOS-libvirt-latest.repo.j2
|
||||
dest: /etc/yum.repos.d/CentOS-libvirt-latest.repo
|
||||
owner: root
|
||||
|
|
@ -8,13 +8,13 @@
|
|||
mode: 0644
|
||||
|
||||
- name: Retreive CentOS SIG Virtualization key
|
||||
get_url:
|
||||
ansible.builtin.get_url:
|
||||
url: https://www.centos.org/keys/RPM-GPG-KEY-CentOS-SIG-Virtualization
|
||||
dest: /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization
|
||||
mode: 0644
|
||||
|
||||
- name: install repo packages
|
||||
package:
|
||||
ansible.builtin.package:
|
||||
name: "centos-release-qemu-ev"
|
||||
state: present
|
||||
update_cache: yes
|
||||
update_cache: true
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
---
|
||||
- name: Include vars for {{ ansible_os_family }}
|
||||
include_vars: "{{ ansible_os_family }}.yml"
|
||||
ansible.builtin.include_vars: "{{ ansible_os_family }}.yml"
|
||||
|
||||
- name: "Ensure system is hardware virtualization capability"
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: "qemu-kvm requires hypervisor capability"
|
||||
when: "ansible_virtualization_type != 'kvm'"
|
||||
|
||||
- name: Include tasks for {{ ansible_os_family }}
|
||||
include_tasks: "{{ ansible_os_family }}.yml"
|
||||
ansible.builtin.include_tasks: "{{ ansible_os_family }}.yml"
|
||||
when:
|
||||
- ansible_distribution == 'CentOS'
|
||||
- ansible_distribution_major_version == '7'
|
||||
|
|
@ -63,14 +63,14 @@
|
|||
# state: mounted
|
||||
|
||||
- name: install packages
|
||||
package:
|
||||
ansible.builtin.package:
|
||||
name: "{{ libvirt_kvm_packages }}"
|
||||
state: present
|
||||
update_cache: yes
|
||||
update_cache: true
|
||||
notify: Restart libvirt
|
||||
|
||||
- name: Allow hypervisor in VM
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: kvm.conf.j2
|
||||
dest: /etc/modprobe.d/kvm.conf
|
||||
owner: root
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
mode: 0644
|
||||
|
||||
- name: Install OpenVSwitch
|
||||
include_role:
|
||||
ansible.builtin.include_role:
|
||||
name: openvswitch
|
||||
# vars:
|
||||
# openvswitch_brname: "{{ libvirt_brname }}"
|
||||
|
|
@ -87,25 +87,25 @@
|
|||
register: install_openvswitch
|
||||
|
||||
- name: Restart libvirt_kvm after openvswitch installation
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
name: "{{ libvirt_service }}"
|
||||
state: restarted
|
||||
|
||||
# - name: Add OpenVSwitch bridge
|
||||
# openvswitch_bridge:
|
||||
# openvswitch.openvswitch.openvswitch_bridge:
|
||||
# bridge: '{{ qemu_default_network_interface }}'
|
||||
# parent: '{{ openvswitch_interface }}'
|
||||
# state: present
|
||||
|
||||
- name: Enable libvirt deamon
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
name: "{{ libvirt_service }}"
|
||||
state: started
|
||||
enabled: yes
|
||||
enabled: true
|
||||
|
||||
- name: Add defaults networks
|
||||
virt_net:
|
||||
command: define
|
||||
community.libvirt.virt_net:
|
||||
ansible.builtin.command: define
|
||||
name: '{{ item }}'
|
||||
xml: '{{ lookup ("template", "networks/" + item + ".xml.j2") }}'
|
||||
with_items:
|
||||
|
|
@ -113,15 +113,15 @@
|
|||
- private
|
||||
|
||||
- name: Enable defaults networks on boot
|
||||
virt_net:
|
||||
community.libvirt.virt_net:
|
||||
name: '{{ item }}'
|
||||
autostart: yes
|
||||
autostart: true
|
||||
with_items:
|
||||
- default
|
||||
- private
|
||||
|
||||
- name: Activate defaults networks now if it doesn't already up
|
||||
virt_net:
|
||||
community.libvirt.virt_net:
|
||||
name: '{{ item }}'
|
||||
state: active
|
||||
with_items:
|
||||
|
|
@ -129,8 +129,8 @@
|
|||
- private
|
||||
|
||||
- name: Add OpenVSwitch networks
|
||||
virt_net:
|
||||
command: define
|
||||
community.libvirt.virt_net:
|
||||
ansible.builtin.command: define
|
||||
name: '{{ item.name }}'
|
||||
xml: '{{ lookup ("template", "networks/openvswitch.xml.j2") }}'
|
||||
with_items:
|
||||
|
|
@ -140,7 +140,7 @@
|
|||
- libvirt_openvswitch|bool
|
||||
|
||||
- name: Activate OpenVSwitch networks now if it doesn't already up
|
||||
virt_net:
|
||||
community.libvirt.virt_net:
|
||||
name: '{{ item.name }}'
|
||||
state: active
|
||||
with_items:
|
||||
|
|
@ -150,12 +150,11 @@
|
|||
- libvirt_openvswitch|bool
|
||||
|
||||
- name: Enable OpenVSwitch networks on boot
|
||||
virt_net:
|
||||
community.libvirt.virt_net:
|
||||
name: '{{ item.name }}'
|
||||
autostart: yes
|
||||
autostart: true
|
||||
with_items:
|
||||
- '{{ virtual_network }}'
|
||||
when:
|
||||
- virtual_network is defined
|
||||
- libvirt_openvswitch|bool
|
||||
|
||||
|
|
|
|||
|
|
@ -31,4 +31,3 @@ libvirt_kvm_packages:
|
|||
# - virt-backup
|
||||
# - virt-install
|
||||
libvirt_service: libvirtd
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue