# - Ansible List # - # - Python lists have a truthiness of False when empty. So you # - can use: # - when: # - # - Example: # - root_user: {} or # - root_user: # - - value1 # - - value2 # - # - Check if list 'root_user' is empty: # - when: root_user # - Ansible Array /Scalar # - # - use: # - when is defined and .lenght > 0 # - # - Example: # - apt_lxc_host_pkgs: [] # - apt_lxc_host_pkgs: # - - bridge-utils # - - lxc # - - btrfs-tools # - - lua5.3 # - # - Check if list 'apt_lxc_host_pkgs'' is empty: # - when: apt_lxc_host_pkgs is defined and apt_lxc_host_pkgs.length > 0