File tree Expand file tree Collapse file tree 8 files changed +14
-16
lines changed Expand file tree Collapse file tree 8 files changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -40,27 +40,27 @@ libvirt_host_var_prefix: ""
4040
4141# Where the Unix Domain sockets are stored
4242libvirt_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
4949libvirt_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
5656libvirt_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
6262libvirt_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
Original file line number Diff line number Diff line change 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 }}"
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 :
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 :
Original file line number Diff line number Diff line change 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 :
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 11# {{ ansible_managed }}
2- {% if libvirt_host_socket_dir | length > 0 %}
2+ {% if libvirt_host_socket_dir is truthy %}
33unix_sock_dir = "{{ libvirt_host_socket_dir }}"
44{% endif %}
55{% for key , value in libvirt_host_libvirtd_conf .items () %}
Original file line number Diff line number Diff 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 }}"
You can’t perform that action at this time.
0 commit comments