diff --git a/roles/install_agent/vars/main.yml b/roles/install_agent/vars/main.yml index b73ff5c..149b780 100644 --- a/roles/install_agent/vars/main.yml +++ b/roles/install_agent/vars/main.yml @@ -1,9 +1,9 @@ --- # vars file for install_agent -pkg_format: "{% if ansible_facts.pkg_mgr in ['yum', 'dnf', 'zypper'] %}rpm{% - elif ansible_facts.pkg_mgr == 'apt' %}deb{% - elif ansible_facts.os_family == 'Windows' and not win_use_exe %}msi{% - elif ansible_facts.os_family == 'Windows' and win_use_exe %}exe{% +pkg_format: "{% if ansible_facts.pkg_mgr | default([]) in ['yum', 'dnf', 'zypper'] %}rpm{% + elif ansible_facts.pkg_mgr | default('') == 'apt' %}deb{% + elif ansible_facts.os_family | default('') == 'Windows' and not win_use_exe %}msi{% + elif ansible_facts.os_family | default('') == 'Windows' and win_use_exe %}exe{% else %}unknown{% endif %}" pkg_arch: "{% if ansible_facts.architecture | regex_search('x86_64|64-bit') %}64_bit{% elif ansible_facts.architecture | regex_search('i386|32-bit') %}32_bit{%