Skip to content

Commit f29191b

Browse files
committed
use fcqn following the ansible lint guidelines
1 parent ea4779d commit f29191b

File tree

9 files changed

+21
-19
lines changed

9 files changed

+21
-19
lines changed

handlers/main.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
22

33
- name: reload systemd
4-
systemd:
4+
ansible.builtin.systemd:
55
daemon_reload: true
66
become: true
77

88
# The socket units cannot be stopped or started if libvirt is running.
99
- name: stop libvirt
10-
service:
10+
ansible.builtin.service:
1111
name: libvirtd
1212
state: stopped
1313
become: true
1414
listen:
1515
- restart libvirt
1616

1717
- name: start libvirtd sockets
18-
service:
18+
ansible.builtin.service:
1919
name: "{{ item.service }}"
2020
state: "{{ item.enabled | bool | ternary('started', 'stopped') }}"
2121
become: true
@@ -26,11 +26,11 @@
2626
- restart libvirt
2727

2828
- name: start libvirt
29-
service:
29+
ansible.builtin.service:
3030
name: libvirtd
3131
state: started
3232
become: true
3333

3434
- name: reload libvirt qemu apparmor profile template
35-
command: apparmor_parser -r /etc/apparmor.d/libvirt/TEMPLATE.qemu
35+
ansible.builtin.command: apparmor_parser -r /etc/apparmor.d/libvirt/TEMPLATE.qemu
3636
become: true

molecule/default/converge.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
- role: tcharl.ansible_role_libvirt_host
3131
tasks:
3232
- name: "Post converge - Install vagrant"
33-
package:
33+
ansible.builtin.package:
3434
name:
3535
- qemu
3636
- libvirt
@@ -46,27 +46,27 @@
4646
become: true
4747

4848
- name: Start libvirtd
49-
service:
49+
ansible.builtin.service:
5050
name: libvirtd
5151
state: started
5252
become: true
5353

5454
- name: Copy vagrant file
55-
copy:
55+
ansible.builtin.copy:
5656
src: Vagrantfile
5757
dest: /home/vagrant/Vagrantfile
5858
owner: vagrant
5959
group: vagrant
6060
mode: '0644'
6161

6262
- name: Execute Vagrant as daemon
63-
command:
63+
ansible.builtin.command:
6464
cmd: "daemonize -e /home/vagrant/myvmerr.log -o /home/vagrant/myvm.log -c /home/vagrant -E VAGRANT_LOG=info /usr/bin/vagrant up --provider=libvirt"
6565
chdir: /home/vagrant
6666
creates: /home/vagrant/myvm.log
6767

6868
- name: Wait until the string "auth" is in the vagrant log
69-
wait_for:
69+
ansible.builtin.wait_for:
7070
path: /home/vagrant/myvmerr.log
7171
search_regex: SSH\sis\sready
7272
timeout: 1800

molecule/default/molecule.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ lint: |
1212
set -e
1313
yamllint .
1414
flake8
15-
ANSIBLE_ROLES_PATH=${MOLECULE_PROJECT_DIRECTORY}/../community ANSIBLE_COLLECTIONS_PATH=${MOLECULE_PROJECT_DIRECTORY}/../community-collections ansible-lint
15+
ANSIBLE_ROLES_PATH=${MOLECULE_PROJECT_DIRECTORY}/..:${MOLECULE_PROJECT_DIRECTORY}/../community:${ANSIBLE_ROLES_PATH} ANSIBLE_COLLECTIONS_PATH=${MOLECULE_PROJECT_DIRECTORY}/../community-collections:${ANSIBLE_COLLECTIONS_PATH} ansible-lint
1616
platforms:
1717
- name: Fedora-Molecule-libvirt-host
1818
box: fedora/35-cloud-base
Binary file not shown.
Binary file not shown.

molecule/kvm/converge.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
- role: tcharl.ansible_role_libvirt_host
2727
tasks:
2828
- name: "Post converge - Install vagrant"
29-
package:
29+
ansible.builtin.package:
3030
name:
3131
- qemu
3232
- libvirt
@@ -42,27 +42,27 @@
4242
become: true
4343

4444
- name: Start libvirtd
45-
service:
45+
ansible.builtin.service:
4646
name: libvirtd
4747
state: started
4848
become: true
4949

5050
- name: Copy vagrant file
51-
copy:
51+
ansible.builtin.copy:
5252
src: Vagrantfile
5353
dest: /home/vagrant/Vagrantfile
5454
owner: vagrant
5555
group: vagrant
5656
mode: '0644'
5757

5858
- name: Execute Vagrant as daemon
59-
command:
59+
ansible.builtin.command:
6060
cmd: "daemonize -e /home/vagrant/myvmerr.log -o /home/vagrant/myvm.log -c /home/vagrant -E VAGRANT_LOG=info /usr/bin/vagrant up --provider=libvirt"
6161
chdir: /home/vagrant
6262
creates: /home/vagrant/myvm.log
6363

6464
- name: Wait until the string "auth" is in the vagrant log
65-
wait_for:
65+
ansible.builtin.wait_for:
6666
path: /home/vagrant/myvmerr.log
6767
search_regex: SSH\sis\sready
6868
timeout: 1800

tasks/client-config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: Ensure client configuration files exist
3-
template:
3+
ansible.builtin.template:
44
src: "{{ item.src }}"
55
dest: "{{ item.dest }}"
66
owner: "{{ item.owner }}"

templates/network.xml.j2

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<network {% if item.ipv6 is defined %}ipv6='yes'{% endif %} connections='1'>
22
<name>{{ item.name }}</name>
3-
<forward mode='{{ item.mode }}'/>
3+
{% if item.mode is defined %}<forward mode='{{ item.mode }}'/>{% endif %}
44
<bridge name='{{ item.bridge }}'{% if item.zone is defined %} zone='{{ item.zone }}'{% endif %}/>
5-
{% if item.mode == 'route' or item.mode == 'nat' %}
5+
{% if item.mode is not defined or item.mode in ['route', 'nat'] %}
66
<domain name='{{ item.domain|default(item.name) }}'/>
77
<ip address='{{ item.ip }}' netmask='{{ item.netmask }}'>
88
{% if item.dhcp_start is defined and item.dhcp_end is defined %}

vars/RedHat.yml

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ libvirt_host_packages_efi_by_version:
2323
- qemu-kvm-ev # Need smm support for secure boot
2424
8:
2525
- edk2-ovmf
26+
35: [] # fedora
2627

2728
libvirt_host_packages_efi: >-
2829
{{ libvirt_host_packages_efi_by_version[ansible_facts.distribution_major_version | int] }}
@@ -53,6 +54,7 @@ libvirt_host_custom_yum_repos_efi_by_version:
5354
baseurl: http://mirror.centos.org/$contentdir/$releasever/virt/$basearch/kvm-common/
5455
gpgcheck: yes
5556
8: []
57+
35: [] # Fedora :-)
5658

5759
libvirt_host_custom_yum_repos: >-
5860
{{ libvirt_host_custom_yum_repos_efi_by_version[ansible_facts.distribution_major_version | int] }}

0 commit comments

Comments
 (0)