From 2d72fe18d3e4f1a7137865c118e9d103699c929c Mon Sep 17 00:00:00 2001 From: Alexander Lobodzinski Date: Tue, 8 Sep 2015 14:19:11 +0200 Subject: Detect automation with Cfengine 3 --- include/tests_tooling | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/tests_tooling b/include/tests_tooling index 302a28d9..a8797263 100644 --- a/include/tests_tooling +++ b/include/tests_tooling @@ -20,6 +20,8 @@ PUPPET_MASTER_RUNNING=0 SALT_MASTER_RUNNING=0 SALT_MINION_RUNNING=0 + CF3_MASTER_RUNNING=0 + CF3_MINION_RUNNING=0 # ################################################################################# # @@ -44,6 +46,24 @@ AUTOMATION_TOOL_FOUND=1 Display --indent 4 --text "Found: Cfengine (cfagent)" --result FOUND --color GREEN fi + # Cfengine 3 + CF3_LOCATIONS="/var/cfengine/bin" + for I in ${CF3_LOCATIONS}; do + if [ -d ${I} ]; then + if [ -e ${I}/cf-agent ]; then + logtext "Result: found Cfengine3 agent (cf-agent) in ${I}" + AUTOMATION_TOOL_FOUND=1 + Display --indent 4 --text "Found: Cfengine (agent)" --result FOUND --color GREEN + fi + IsRunning "cf-server" + if [ ${RUNNING} -eq 1 ]; then + logtext "Result: found cfengine server" + CF3_MASTER_RUNNING=1 + report "automation_tool_running[]=cf-server" + Display --indent 4 --text "Found: Cfengine (server)" --result FOUND --color GREEN + fi + fi + done CHEF_LOCATIONS="/opt/chef/bin /opt/chef-server/sv /opt/chefdk/bin" for I in ${CHEF_LOCATIONS}; do -- cgit v1.2.3 From 66ff2a92292552219940857420b7cca830b126ce Mon Sep 17 00:00:00 2001 From: Alexander Lobodzinski Date: Tue, 8 Sep 2015 14:28:24 +0200 Subject: Fixed typos --- include/tests_tooling | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/include/tests_tooling b/include/tests_tooling index a8797263..3da4d60c 100644 --- a/include/tests_tooling +++ b/include/tests_tooling @@ -20,8 +20,8 @@ PUPPET_MASTER_RUNNING=0 SALT_MASTER_RUNNING=0 SALT_MINION_RUNNING=0 - CF3_MASTER_RUNNING=0 - CF3_MINION_RUNNING=0 + CF3_AGENT_FOUND=0 + CF3_SERVER_RUNNING=0 # ################################################################################# # @@ -53,14 +53,15 @@ if [ -e ${I}/cf-agent ]; then logtext "Result: found Cfengine3 agent (cf-agent) in ${I}" AUTOMATION_TOOL_FOUND=1 - Display --indent 4 --text "Found: Cfengine (agent)" --result FOUND --color GREEN + CF3_AGENT_FOUND=1 + Display --indent 4 --text "Found: Cfengine (cf-agent)" --result FOUND --color GREEN fi IsRunning "cf-server" if [ ${RUNNING} -eq 1 ]; then - logtext "Result: found cfengine server" - CF3_MASTER_RUNNING=1 + logtext "Result: found Cfengine3 server" + CF3_SERVER_RUNNING=1 report "automation_tool_running[]=cf-server" - Display --indent 4 --text "Found: Cfengine (server)" --result FOUND --color GREEN + Display --indent 4 --text "Found: Cfengine (cf-server)" --result FOUND --color GREEN fi fi done @@ -137,6 +138,8 @@ # ################################################################################# # + report "cf3_server=${CF3_SERVER_RUNNING}" + report "cf3_agent=${CF3_AGENT_INSTALLED}" report "puppet_master=${PUPPET_MASTER_RUNNING}" report "salt_master=${SALT_MASTER_RUNNING}" report "salt_minion=${SALT_MINION_RUNNING}" -- cgit v1.2.3