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