From 5be81289eea3657d7d647dbc64a90fbafe407bfb Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Thu, 17 Aug 2017 20:06:41 +0200 Subject: [TOOL-5002] rewrite of Ansible detection --- include/tests_tooling | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/include/tests_tooling b/include/tests_tooling index 6f6c2833..26eee608 100644 --- a/include/tests_tooling +++ b/include/tests_tooling @@ -53,18 +53,19 @@ Display --indent 2 --text "- Checking automation tooling" # Ansible - LIST="~/.ansible ~/.ansible-retry ${ROOTDIR}etc/ansible ${ROOTDIR}root/.ansible ${ROOTDIR}tmp/.ansible ${ROOTDIR}var/log/ansible.log" + FOUND=0 + LIST="~/.ansible ~/.ansible-retry ${ROOTDIR}etc/ansible ${ROOTDIR}root/.ansible ${ROOTDIR}tmp/.ansible" + for ITEM in ${LIST}; do if DirectoryExists ${ITEM}; then FOUND=1; fi; done + LIST="${ROOTDIR}var/log/ansible.log" + for ITEM in ${LIST}; do if FileExists ${ITEM}; then FOUND=1; fi; done - for ITEM in ${LIST}; do - if FileIsReadable ${ITEM}; then - LogText "Result: found a possible trace of Ansible" - AUTOMATION_TOOL_FOUND=1 - ANSIBLE_ARTIFACT_FOUND=1 - Report "automation_tool_running[]=ansible" - Display --indent 4 --text "- Ansible artifact" --result "${STATUS_FOUND}" --color GREEN - break - fi - done + if [ ${FOUND} -eq 1 ]; then + LogText "Result: found a possible trace of Ansible" + AUTOMATION_TOOL_FOUND=1 + ANSIBLE_ARTIFACT_FOUND=1 + Report "automation_tool_running[]=ansible" + Display --indent 4 --text "- Ansible artifact" --result "${STATUS_FOUND}" --color GREEN + fi # Cfengine if [ ! -z "${CFAGENTBINARY}" ]; then -- cgit v1.2.3