Skip to content

Commit

Permalink
Merge pull request #762 from ncharles/ust_7362/adapt_techniques_to_pr…
Browse files Browse the repository at this point in the history
…event_syslog_configuration_when_reports_are_disabled

Fixes #7362: Adapt Techniques to prevent syslog configuration when re…
  • Loading branch information
peckpeck committed Nov 6, 2015
2 parents 6570730 + a59eb21 commit 4a08631
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion techniques/system/common/1.0/nxlog_activation.st
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ bundle agent nxlog_enable

methods:

windows::
windows.!reports_disabled::

"any" usebundle => nxlog_install;
"any" usebundle => nxlog_configure;
Expand Down
19 changes: 13 additions & 6 deletions techniques/system/common/1.0/promises.st
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ bundle common va
"check_red_button_status",
"check_cf_processes",
"check_uuid",
"check_log_system",
"check_rsyslog_version",
"configure_rudder_reporting_system",
"garbage_collection",
"setup_cronjob",
"check_cron_daemon",
Expand All @@ -88,8 +87,7 @@ bundle common va
"setup_cronjob",
"check_cron_daemon",
"check_binaries_freshness",
"check_log_system",
"check_rsyslog_version",
"configure_rudder_reporting_system",
"nxlog_enable",
"check_zypper",
"check_uuid",
Expand Down Expand Up @@ -185,10 +183,11 @@ bundle common rudder_roles


# on changes only, we only reports on repaired or error message
"changes_only" expression => strcmp("&RUDDER_REPORT_MODE&", "changes-only");
"changes_only" expression => strcmp("&RUDDER_REPORT_MODE&", "changes-only");
"reports_disabled" expression => strcmp("&RUDDER_REPORT_MODE&", "reports-disabled");

# full compliance is the default mode
"full_compliance" not => "changes_only";
"full_compliance" not => "changes_only|reports_disabled";
}

#########################################################
Expand Down Expand Up @@ -455,6 +454,14 @@ bundle agent check_uuid
comment => "Setting the uuid variable in a machine";
}
bundle agent configure_rudder_reporting_system {
methods:
!reports_disabled::
"configure_syslog" usebundle => check_log_system;
"configure_reporting" usebundle => check_rsyslog_version;
}
#######################################################
# Check the log system, and configure it accordingly
# This only works with unix flavoured system
Expand Down
8 changes: 4 additions & 4 deletions techniques/system/distributePolicy/1.0/rsyslogConf.st
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ bundle agent install_rsyslogd {

files:

policy_server::
policy_server.!reports_disabled::

"/etc/rsyslog.d/rudder.conf"
create => "true",
Expand All @@ -62,7 +62,7 @@ bundle agent install_rsyslogd {
classes => classes_generic("rudder_rsyslog_historical_conf_purged"),
comment => "Deleting historical rudder-agent.conf file if it is there";

policy_server.debian::
policy_server.debian.!reports_disabled::
"/etc/rsyslog.d/pgsql.conf"
edit_line => comment_all(),
edit_defaults => noempty_backup,
Expand All @@ -71,7 +71,7 @@ bundle agent install_rsyslogd {

packages:

policy_server.!SuSE.!redhat::
policy_server.!SuSE.!redhat.!reports_disabled::
"rsyslog"
package_policy => "add",
package_method => generic,
Expand All @@ -84,7 +84,7 @@ bundle agent install_rsyslogd {
classes => cf2_if_else("rsyslog_pgsql_installed", "cant_install_rsyslog_pgsql"),
comment => "Installing rsyslog_pgsql using apt backports";

policy_server.!SuSE.redhat::
policy_server.!SuSE.redhat.!reports_disabled::
"rsyslog"
package_policy => "add",
package_method => rudder_yum,
Expand Down

0 comments on commit 4a08631

Please sign in to comment.