Skip to content

Commit 9a947f7

Browse files
authored
Merge pull request #79 from stackhpc/update/ansible-12
Update for Ansible 12
2 parents e1c1f93 + 9be6371 commit 9a947f7

File tree

8 files changed

+14
-16
lines changed

8 files changed

+14
-16
lines changed

defaults/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,27 @@ libvirt_host_var_prefix: ""
4040

4141
# Where the Unix Domain sockets are stored
4242
libvirt_host_socket_dir: >-
43-
{%- if libvirt_host_var_prefix -%}
43+
{%- if libvirt_host_var_prefix is truthy -%}
4444
/var/run/{{ libvirt_host_var_prefix }}
4545
{%- endif -%}
4646
4747
# Path to PID file which prevents mulitple instances of the daemon from
4848
# spawning
4949
libvirt_host_pid_path: >-
50-
{%- if libvirt_host_var_prefix -%}
50+
{%- if libvirt_host_var_prefix is truthy -%}
5151
/var/run/{{ libvirt_host_var_prefix }}.pid
5252
{%- endif -%}
5353
5454
# Command line arguments passed to libvirtd by the init system when
5555
# libvirtd is started - quotes will be added
5656
libvirt_host_libvirtd_args: >-
57-
{%- if libvirt_host_pid_path -%}
57+
{%- if libvirt_host_pid_path is truthy -%}
5858
-p {{ libvirt_host_pid_path }}
5959
{%- endif %}
6060
6161
# The libvirt connnection URI
6262
libvirt_host_uri: >-
63-
{%- if libvirt_host_socket_dir -%}
63+
{%- if libvirt_host_socket_dir is truthy -%}
6464
qemu+unix:///system?socket={{ libvirt_host_socket_dir }}/libvirt-sock
6565
{%- endif %}
6666

tasks/config.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
group: root
1010
mode: 0755
1111
become: true
12-
when: libvirt_host_socket_dir | length > 0
12+
when: libvirt_host_socket_dir is truthy
1313

1414
- name: Process lineinfile rules
1515
lineinfile: "{{ rule.args }}"
@@ -56,8 +56,7 @@
5656
become: true
5757
loop: "{{ _libvirt_socket_services | selectattr('enabled') }}"
5858
when:
59-
- item.listen_address is not none
60-
- item.listen_address | length > 0
59+
- item.listen_address is truthy
6160
loop_control:
6261
label: "{{ item.service }}"
6362
vars:
@@ -73,8 +72,7 @@
7372
become: true
7473
loop: "{{ _libvirt_socket_services | selectattr('enabled') }}"
7574
when:
76-
- item.listen_address is not none
77-
- item.listen_address | length > 0
75+
- item.listen_address is truthy
7876
loop_control:
7977
label: "{{ item.service }}"
8078
vars:

tasks/install-daemon.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
when:
3434
- ansible_facts.os_family == "RedHat"
3535
- ansible_facts.distribution_major_version | int == 7
36-
- libvirt_host_qemu_emulators | length > 0
36+
- libvirt_host_qemu_emulators is truthy
3737

3838
- name: Ensure QEMU emulator packages are installed
3939
package:

tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
when: libvirt_host_install_client | bool
2727
- name: Include pools.yml
2828
include_tasks: pools.yml
29-
when: libvirt_host_pools | length > 0
29+
when: libvirt_host_pools is truthy
3030
- name: Include networks.yml
3131
include_tasks: networks.yml
32-
when: libvirt_host_networks | length > 0
32+
when: libvirt_host_networks is truthy

tasks/post-install-Debian.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
insertafter: '^#libvirtd_opts='
2222
regexp: '^libvirtd_opts='
2323
line: "libvirtd_opts={{ libvirt_host_libvirtd_args }}"
24-
condition: "{{ libvirt_host_libvirtd_args | length > 0 }}"
24+
condition: "{{ libvirt_host_libvirtd_args is truthy }}"
2525
vars:
2626
libvirt_env_path: "{{ '/etc/default/libvirt-bin' if libvirt_bin_stat.stat.exists else '/etc/default/libvirtd' }}"
2727
tags: vars

tasks/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@
3535
defined
3636
when:
3737
- libvirt_host_enable_sasl_support | bool
38-
- libvirt_host_sasl_credentials | rejectattr('password') | length > 0
38+
- libvirt_host_sasl_credentials | rejectattr('password') is truthy

templates/libvirtd.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# {{ ansible_managed }}
2-
{% if libvirt_host_socket_dir | length > 0 %}
2+
{% if libvirt_host_socket_dir is truthy %}
33
unix_sock_dir = "{{ libvirt_host_socket_dir }}"
44
{% endif %}
55
{% for key, value in libvirt_host_libvirtd_conf.items() %}

vars/RedHat.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ libvirt_host_lineinfile_extra_rules:
7070
insertafter: '^#LIBVIRTD_ARGS='
7171
regexp: '^LIBVIRTD_ARGS='
7272
line: LIBVIRTD_ARGS="{{ libvirt_host_libvirtd_args }}"
73-
condition: "{{ libvirt_host_libvirtd_args != '' }}"
73+
condition: "{{ libvirt_host_libvirtd_args is truthy }}"

0 commit comments

Comments
 (0)