[TOOL-5002] rewrite of Ansible detection

This commit is contained in:
Michael Boelen 2017-08-17 20:06:41 +02:00
parent 83da68fdb5
commit 5be81289ee
No known key found for this signature in database
GPG Key ID: 26141F77A09D7F04
1 changed files with 12 additions and 11 deletions

View File

@ -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