Skip to content

Commit ea4779d

Browse files
committed
set FQCN on all calls
1 parent 978b3ad commit ea4779d

File tree

12 files changed

+53
-51
lines changed

12 files changed

+53
-51
lines changed

.github/workflows/molecule.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
sudo apt update
3434
sudo apt -y install python3-setuptools python3 python3-pip
3535
pip3 install wheel
36+
pip3 install ansible-compat==0.5.0
3637
pip3 install ansible molecule testinfra yamllint ansible-lint flake8 molecule-vagrant
3738
3839
- name: molecule lint

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ install:
3333
- vagrant plugin install vagrant-libvirt
3434
- pip install wheel pyopenssl
3535
- pip install netaddr python-vagrant yamllint testinfra flake8
36+
- pip install ansible-compat==0.5.0 # see https://github.com/ansible-community/molecule/issues/3404
3637
- pip install ansible ansible-lint
3738
- pip install molecule molecule-vagrant python-vagrant
3839
- sudo chmod o+rwx /var/run/libvirt/libvirt-sock

tasks/config.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Configure services - runs after the install stage
33

44
- name: Create directory for libvirt socket
5-
file:
5+
ansible.builtin.file:
66
state: directory
77
path: "{{ libvirt_host_socket_dir }}"
88
owner: root
@@ -12,7 +12,7 @@
1212
when: libvirt_host_socket_dir | length > 0
1313

1414
- name: Process lineinfile rules
15-
lineinfile: "{{ rule.args }}"
15+
ansible.builtin.lineinfile: "{{ rule.args }}"
1616
become: true
1717
loop: "{{ libvirt_host_lineinfile_extra_rules | default([]) }}"
1818
loop_control:
@@ -22,7 +22,7 @@
2222
- restart libvirt
2323

2424
- name: Ensure configuration files exist
25-
template:
25+
ansible.builtin.template:
2626
src: "{{ item.src }}"
2727
dest: "{{ item.dest }}"
2828
owner: root
@@ -47,7 +47,7 @@
4747
- restart libvirt
4848

4949
- name: Create systemd drop-in directory for socket listen address
50-
file:
50+
ansible.builtin.file:
5151
path: "/etc/systemd/system/{{ item.service }}.d"
5252
state: directory
5353
owner: root
@@ -64,7 +64,7 @@
6464
_libvirt_listen_stream: "{{ item.listen_address }}"
6565

6666
- name: Configure socket listen address
67-
template:
67+
ansible.builtin.template:
6868
src: socket.j2
6969
dest: "/etc/systemd/system/{{ item.service }}.d/listen-address.conf"
7070
owner: root
@@ -84,7 +84,7 @@
8484
- restart libvirt
8585

8686
- name: Create directory for TLS certificates and keys
87-
file:
87+
ansible.builtin.file:
8888
path: "{{ item }}"
8989
state: directory
9090
owner: root
@@ -101,7 +101,7 @@
101101
- libvirt_host_tls_listen | bool
102102

103103
- name: Copy TLS certificates and keys
104-
copy:
104+
ansible.builtin.copy:
105105
content: "{{ _libvirt_loop_item.content }}"
106106
dest: "{{ _libvirt_loop_item.dest }}"
107107
owner: root
@@ -119,7 +119,7 @@
119119
notify: restart libvirt
120120

121121
- name: Ensure libvirt SASL user exists
122-
shell:
122+
ansible.builtin.shell:
123123
cmd: >
124124
set -o pipefail &&
125125
echo {{ item.password }} |
@@ -132,10 +132,10 @@
132132
when: libvirt_host_enable_sasl_support | bool
133133

134134
- name: Flush handlers
135-
meta: flush_handlers
135+
ansible.builtin.meta: flush_handlers
136136

137137
- name: Ensure the libvirt daemon is started and enabled
138-
service:
138+
ansible.builtin.service:
139139
name: "{{ item.service }}"
140140
state: "{{ item.enabled | bool | ternary('started', 'stopped') }}"
141141
enabled: "{{ item.enabled | bool }}"

tasks/install-client.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: Ensure libvirt client packages are installed
3-
package:
3+
ansible.builtin.package:
44
name: "{{ libvirt_host_libvirt_packages_client | select | list }}"
55
state: present
66
register: result

tasks/install-daemon.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
#
99
# The core team had a a change of heart and it is actually being preserved:
1010
# https://github.com/ansible/ansible/pull/43798
11-
yum_repository: "{{ item }}"
11+
ansible.builtin.yum_repository: "{{ item }}"
1212
loop: "{{ libvirt_host_custom_yum_repos | default([]) }}"
1313
become: true
1414

1515
- name: Ensure libvirt packages are installed
16-
package:
16+
ansible.builtin.package:
1717
name: "{{ libvirt_host_libvirt_packages | select | list }}"
1818
state: present
1919
register: result
@@ -23,7 +23,7 @@
2323

2424
# NOTE: QEMU emulators are available in EPEL on CentOS 7.
2525
- name: Ensure the EPEL repository is enabled
26-
yum:
26+
ansible.builtin.yum:
2727
name: epel-release
2828
state: present
2929
register: result
@@ -36,7 +36,7 @@
3636
- libvirt_host_qemu_emulators | length > 0
3737

3838
- name: Ensure QEMU emulator packages are installed
39-
package:
39+
ansible.builtin.package:
4040
name: "{{ package }}"
4141
state: present
4242
loop: "{{ libvirt_host_qemu_emulators | flatten(levels=1) }}"

tasks/main.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
2-
- import_tasks: prelude.yml
3-
- import_tasks: validate.yml
2+
- ansible.builtin.include_tasks: prelude.yml
3+
- ansible.builtin.include_tasks: validate.yml
44
- name: Include install-daemon.yml
5-
include_tasks: install-daemon.yml
5+
ansible.builtin.include_tasks: install-daemon.yml
66
when: libvirt_host_install_daemon | bool
77
- name: Include install-client.yml
8-
include_tasks: install-client.yml
8+
ansible.builtin.include_tasks: install-client.yml
99
when:
1010
- not libvirt_host_install_daemon | bool
1111
- libvirt_host_install_client | bool
1212
- name: Run post-install stage
13-
include_tasks: "{{ post_install_path }}"
13+
ansible.builtin.include_tasks: "{{ post_install_path }}"
1414
with_first_found:
1515
- files:
1616
- post-install-{{ ansible_facts.distribution }}.yml
@@ -19,14 +19,14 @@
1919
loop_control:
2020
loop_var: post_install_path
2121
- name: Include config.yml
22-
include_tasks: config.yml
22+
ansible.builtin.include_tasks: config.yml
2323
when: libvirt_host_install_daemon | bool
2424
- name: Include client-config.yml
25-
include_tasks: client-config.yml
25+
ansible.builtin.include_tasks: client-config.yml
2626
when: libvirt_host_install_client | bool
2727
- name: Include pools.yml
28-
include_tasks: pools.yml
28+
ansible.builtin.include_tasks: pools.yml
2929
when: libvirt_host_pools | length > 0
3030
- name: Include networks.yml
31-
include_tasks: networks.yml
31+
ansible.builtin.include_tasks: networks.yml
3232
when: libvirt_host_networks | length > 0

tasks/networks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: Ensure libvirt networks are defined
3-
virt_net:
3+
community.libvirt.virt_net:
44
name: "{{ item.name }}"
55
command: define
66
xml: "{{ item.xml | default(lookup('template', 'network.xml.j2')) }}"
@@ -9,15 +9,15 @@
99
become: True
1010

1111
- name: Ensure libvirt networks are started on boot
12-
virt_net:
12+
community.libvirt.virt_net:
1313
name: "{{ item.name }}"
1414
autostart: yes
1515
uri: "{{ libvirt_host_uri | default(omit, true) }}"
1616
with_items: "{{ libvirt_host_networks }}"
1717
become: True
1818

1919
- name: Ensure libvirt networks are active
20-
virt_net:
20+
community.libvirt.virt_net:
2121
name: "{{ item.name }}"
2222
state: active
2323
uri: "{{ libvirt_host_uri | default(omit, true) }}"

tasks/pools.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
- name: Include lvm role to create VG
3-
include_role:
3+
ansible.builtin.include_role:
44
name: mrlesmithjr.manage-lvm
55
when:
66
- manage_lvm is defined
77
- manage_lvm
88
- libvirt_host_pools | map(attribute='type') | select('match', '^lvm2$') | join(',') | length > 0
99

1010
- name: Ensure libvirt dir storage pool directories exist
11-
file:
11+
ansible.builtin.file:
1212
path: "{{ item.path }}"
1313
owner: "{{ item.owner }}"
1414
group: "{{ item.group }}"
@@ -19,15 +19,15 @@
1919
become: True
2020

2121
- name: include rbd.yml
22-
include_tasks:
22+
ansible.builtin.include_tasks:
2323
file: rbd.yml
2424
apply:
2525
become: True
2626
when: item.type == "rbd"
2727
loop: "{{ libvirt_host_pools | flatten(levels=1) }}"
2828

2929
- name: Ensure libvirt storage pools are defined
30-
virt_pool:
30+
community.libvirt.virt_pool:
3131
name: "{{ item.name }}"
3232
command: define
3333
xml: "{{ item.xml | default(lookup('template', 'pool.xml.j2')) }}"
@@ -36,7 +36,7 @@
3636
become: True
3737

3838
- name: Check libvirt directory storage pool status
39-
virt_pool:
39+
community.libvirt.virt_pool:
4040
name: "{{ item.name }}"
4141
command: status
4242
uri: "{{ libvirt_host_uri | default(omit, true) }}"
@@ -46,7 +46,7 @@
4646
register: pool_status
4747

4848
- name: Ensure libvirt directory storage pools are built
49-
virt_pool:
49+
community.libvirt.virt_pool:
5050
name: "{{ item.item.name }}"
5151
command: build
5252
uri: "{{ libvirt_host_uri | default(omit, true) }}"
@@ -57,15 +57,15 @@
5757
become: True
5858

5959
- name: Ensure libvirt storage pools are active
60-
virt_pool:
60+
community.libvirt.virt_pool:
6161
name: "{{ item.name }}"
6262
state: active
6363
uri: "{{ libvirt_host_uri | default(omit, true) }}"
6464
loop: "{{ libvirt_host_pools | flatten(levels=1) }}"
6565
become: True
6666

6767
- name: Ensure libvirt storage pools are started on boot
68-
virt_pool:
68+
community.libvirt.virt_pool:
6969
name: "{{ item.name }}"
7070
autostart: yes
7171
uri: "{{ libvirt_host_uri | default(omit, true) }}"

tasks/post-install-Debian.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
# skip being set to true. This is undeseriable so we have to
99
# put it behind an include (a block doesn't work).
1010
- name: Check if /etc/default/libvirt-bin exists
11-
stat:
11+
ansible.builtin.stat:
1212
path: /etc/default/libvirt-bin
1313
register: libvirt_bin_stat
1414
tags: vars
1515

1616
- name: Determine path to libvirt environment file
17-
set_fact:
17+
ansible.builtin.set_fact:
1818
libvirt_host_lineinfile_extra_rules:
1919
- args:
2020
path: "{{ libvirt_env_path }}"
@@ -27,7 +27,7 @@
2727
tags: vars
2828

2929
- name: Configure libvirt QEMU apparmor profile template
30-
lineinfile:
30+
ansible.builtin.lineinfile:
3131
path: "/etc/apparmor.d/libvirt/TEMPLATE.qemu"
3232
insertbefore: "^}"
3333
line: " {{ item.path }}/** rwk,"

tasks/prelude.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This file is intended to be included at the beginning of a playbook.
33

44
- name: gather os specific variables
5-
include_vars: "{{ item }}"
5+
ansible.builtin.include_vars: "{{ item }}"
66
with_first_found:
77
- "{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml"
88
- "{{ ansible_facts.distribution }}.yml"

tasks/rbd.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
---
22

33
- name: Install additional packages for rbd support
4-
package:
4+
ansible.builtin.package:
55
name: "{{ libvirt_host_packages_rbd_volume_pool | flatten(levels=1) }}"
66
state: present
77
notify: restart libvirt
88

99
- name: Create temporary file for Ceph secret
10-
tempfile:
10+
ansible.builtin.tempfile:
1111
state: file
1212
suffix: .xml
1313
register: secret_tempfile
1414

1515
- name: Send Ceph secret
16-
template:
16+
ansible.builtin.template:
1717
mode: 0640
1818
src: ceph_secret.xml.j2
1919
dest: "{{ secret_tempfile.path }}"
2020

2121
- name: Define Ceph secret
22-
command: "virsh secret-define {{ secret_tempfile.path }}"
22+
ansible.builtin.command: "virsh secret-define {{ secret_tempfile.path }}"
2323
changed_when: false
2424

2525
- name: Set Ceph secret value
26-
command: "virsh secret-set-value {{ item.name | to_uuid }} {{ item.passphrase }}"
26+
ansible.builtin.command: "virsh secret-set-value {{ item.name | to_uuid }} {{ item.passphrase }}"
2727
changed_when: false
2828

2929
- name: Delete temporary file
30-
file:
30+
ansible.builtin.file:
3131
path: "{{ secret_tempfile.path }}"
3232
state: absent
3333

3434
- name: Flush handlers
35-
meta: flush_handlers
35+
ansible.builtin.meta: flush_handlers

tasks/validate.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
- name: Verify that Virtualization Technology (VT) is enabled
3-
command: grep -c -E 'svm|vmx' /proc/cpuinfo
3+
ansible.builtin.command: grep -c -E 'svm|vmx' /proc/cpuinfo
44
check_mode: False
55
changed_when: False
66
failed_when: False
77
register: result
88

99
- name: Set a fact about whether Virtualization Technology (VT) is enabled
10-
set_fact:
10+
ansible.builtin.set_fact:
1111
libvirt_host_vt_enabled: "{{ result.rc == 0 }}"
1212

1313
- name: Notify if Virtualization Technology (VT) is disabled
14-
debug:
14+
ansible.builtin.debug:
1515
msg: >
1616
Virtualization Technology (VT) is currently disabled. Please enable VT
1717
before running this role again.
@@ -20,7 +20,7 @@
2020
- not libvirt_host_vt_enabled
2121

2222
- name: Fail if Virtualization Technology (VT) is disabled
23-
fail:
23+
ansible.builtin.fail:
2424
msg: >
2525
Virtualization Technology (VT) is currently disabled. Please enable VT
2626
before running this role again.
@@ -29,7 +29,7 @@
2929
- not libvirt_host_vt_enabled
3030

3131
- name: Fail if SASL password is not defined
32-
fail:
32+
ansible.builtin.fail:
3333
msg: >
3434
One or more SASL passwords in 'libvirt_host_sasl_credentials' are not
3535
defined

0 commit comments

Comments
 (0)