Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2017-08-17 21:06:41 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2017-08-17 21:06:41 +0300
commit5be81289eea3657d7d647dbc64a90fbafe407bfb (patch)
tree7549d7d427783d3e73cfd5a721912f6d361f8a82 /include/tests_tooling
parent83da68fdb5c974012620a5a1edf7d09ef16b4741 (diff)
[TOOL-5002] rewrite of Ansible detection
Diffstat (limited to 'include/tests_tooling')
-rw-r--r--include/tests_tooling23
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