Skip to content

Commit

Permalink
Fixes #13983: Remove template in system techniques
Browse files Browse the repository at this point in the history
  • Loading branch information
peckpeck committed Dec 17, 2018
1 parent c28fd4f commit 10f5c1a
Show file tree
Hide file tree
Showing 29 changed files with 295 additions and 233 deletions.
20 changes: 20 additions & 0 deletions techniques/system/common/1.0/common.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Common variable for common system technique
bundle common system_common {
vars:
"directiveId" string => "&TRACKINGKEY&";
"sharedfiles_folder" string => "&SHARED_FILES_FOLDER&";
"community_port" string => "&COMMUNITYPORT&";
"uuid" string => "&UUID&";
"davuser" string => "&DAVUSER&";
"davpw" string => "&DAVPASSWORD&";
"rudder_configuration_repository"
string => "&CONFIGURATION_REPOSITORY_FOLDER&";
"heartbeat_interval" string => "&RUDDER_HEARTBEAT_INTERVAL&";
"rudder_node_config_id" string => "&RUDDER_NODE_CONFIG_ID&";


classes:
&if(INITIAL)&
"initial_promises" expression => "any", scope => "namespace";
&endif&
}
4 changes: 2 additions & 2 deletions techniques/system/common/1.0/cron-setup.st
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ bundle agent check_cron_daemon
"any" usebundle => _classes_success("service_restart_${service_name}");

pass3.!aix::
"any" usebundle => rudder_common_reports_generic("Common", "service_restart_${service_name}", "&TRACKINGKEY&", "CRON Daemon", "None", "Cron daemon status");
"any" usebundle => rudder_common_reports_generic("Common", "service_restart_${service_name}", "${system_common.directiveId}", "CRON Daemon", "None", "Cron daemon status");

aix::
"any" usebundle => rudder_common_report("Common", "result_na", "&TRACKINGKEY&", "CRON Daemon", "None", "CRON is not a service on AIX: CRON verifications skipped");
"any" usebundle => rudder_common_report("Common", "result_na", "${system_common.directiveId}", "CRON Daemon", "None", "CRON is not a service on AIX: CRON verifications skipped");

processes:

Expand Down
2 changes: 1 addition & 1 deletion techniques/system/common/1.0/failsafe.st
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ body common control
{
bundlesequence => { "check_uuid", "init_files", "update_action" };

inputs => { "common/1.0/update.cf" };
inputs => { "common/1.0/common.cf", "common/1.0/update.cf" };
output_prefix => "rudder";

protocol_version => "2";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ bundle agent internal_security
methods:

security_sanitization_ok.!security_sanitization_repaired::
"any" usebundle => rudder_common_report("Common", "result_success", "&TRACKINGKEY&", "Security parameters", "None", "The internal environment security is acceptable");
"any" usebundle => rudder_common_report("Common", "result_success", "${system_common.directiveId}", "Security parameters", "None", "The internal environment security is acceptable");

security_sanitization_repaired::
"any" usebundle => rudder_common_report("Common", "result_repaired", "&TRACKINGKEY&", "Security parameters", "None", "Some internal security parameters were adjusted");
"any" usebundle => rudder_common_report("Common", "result_repaired", "${system_common.directiveId}", "Security parameters", "None", "Some internal security parameters were adjusted");

security_sanitization_failed::
"any" usebundle => rudder_common_report("Common", "result_error", "&TRACKINGKEY&", "Security parameters", "None", "The internal environment security is NOT acceptable!");
"any" usebundle => rudder_common_report("Common", "result_error", "${system_common.directiveId}", "Security parameters", "None", "The internal environment security is NOT acceptable!");
}
24 changes: 18 additions & 6 deletions techniques/system/common/1.0/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<SYSTEM>true</SYSTEM>

<TMLS>
<TML name="monitoring" />
<TML name="cf-serverd"/>
<TML name="rudder-lib" />
<TML name="internal-security" />
<TML name="cron-setup" />
<TML name="site"/>
<TML name="update"/>
<TML name="failsafe">
<OUTPATH>failsafe.cf</OUTPATH>
<INCLUDED>false</INCLUDED>
Expand Down Expand Up @@ -53,12 +48,29 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<OUTPATH>run_interval</OUTPATH>
<INCLUDED>false</INCLUDED>
</TML>
<TML name="restart-services"/>
<TML name="rudder-groups"/>
<TML name="hooks"/>
</TMLS>

<FILES>
<FILE name="site.cf">
<INCLUDED>true</INCLUDED>
</FILE>
<FILE name="update.cf">
<INCLUDED>true</INCLUDED>
</FILE>
<FILE name="monitoring.cf">
<INCLUDED>true</INCLUDED>
</FILE>
<FILE name="restart-services.cf">
<INCLUDED>true</INCLUDED>
</FILE>
<FILE name="rudder-lib.cf">
<INCLUDED>true</INCLUDED>
</FILE>
<FILE name="internal-security.cf">
<INCLUDED>true</INCLUDED>
</FILE>
<FILE name="rudder-stdlib.cf">
<INCLUDED>true</INCLUDED>
</FILE>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ bundle agent monitoring_hook_post
"reporting" usebundle => enable_reporting;

csv_exists::
"reporting" usebundle => rudder_common_reports_generic("Common", "sharedfile_to_node_rudder_monitoring_csv", "&TRACKINGKEY&", "Monitoring", "None", "Share Rudder monitoring information with the server");
"reporting" usebundle => rudder_common_reports_generic("Common", "sharedfile_to_node_rudder_monitoring_csv", "${system_common.directiveId}", "Monitoring", "None", "Share Rudder monitoring information with the server");

!csv_exists::
"reporting" usebundle => rudder_common_report("Common", "result_na", "&TRACKINGKEY&", "Monitoring", "None", "No Rudder monitoring information to share with the server");
"reporting" usebundle => rudder_common_report("Common", "result_na", "${system_common.directiveId}", "Monitoring", "None", "No Rudder monitoring information to share with the server");
}
Loading

0 comments on commit 10f5c1a

Please sign in to comment.