check for isdir

This commit is contained in:
Antonio J. Delgado 2022-10-21 21:24:27 +03:00
parent 8963ab4064
commit ab2a75d6ab

View file

@ -23,11 +23,12 @@
when:
- which_puppet.stdout != ""
- which_puppet_stat.stat.executable
- not which_puppet_stat.stat.isdir
- name: Set fact for puppet path to estimated path when not found
set_fact:
puppet_cmd: "/usr/local/bin/puppet"
when: which_puppet.stdout == "" or not which_puppet_stat.stat.executable
when: which_puppet.stdout == "" or not which_puppet_stat.stat.executable or which_puppet_stat.isdir
- name: Obtain puppet configuration directory
shell: "{{ puppet_cmd }} config print confdir"