diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2017-08-17 21:06:41 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2017-08-17 21:06:41 +0300 |
commit | 5be81289eea3657d7d647dbc64a90fbafe407bfb (patch) | |
tree | 7549d7d427783d3e73cfd5a721912f6d361f8a82 /include | |
parent | 83da68fdb5c974012620a5a1edf7d09ef16b4741 (diff) |
[TOOL-5002] rewrite of Ansible detection
Diffstat (limited to 'include')
-rw-r--r-- | include/tests_tooling | 23 |
1 files 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 |