From 3bd7d7d76aceb3e1c13ed8a81cc8919814b02773 Mon Sep 17 00:00:00 2001 From: Swann Croiset Date: Mon, 9 Jan 2017 13:21:24 +0100 Subject: [PATCH] Implicitly configure Nagios outputs if available Change-Id: Ibf5b4c2239004a4fa8e99bcaaf2949a5155543ed --- .../puppet/manifests/hiera_override.pp | 30 ++++++++----------- environment_config.yaml | 6 ---- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/deployment_scripts/puppet/manifests/hiera_override.pp b/deployment_scripts/puppet/manifests/hiera_override.pp index 25bc0f9b3..49d2c0efa 100644 --- a/deployment_scripts/puppet/manifests/hiera_override.pp +++ b/deployment_scripts/puppet/manifests/hiera_override.pp @@ -143,25 +143,21 @@ if ($plugin_data) { } } - if $plugin_data['alerting_mode'] { - # Infrastructure Alerting - $lma_infra_alerting = hiera('lma_infrastructure_alerting', {}) - $infra_alerting_nodes = get_nodes_hash_by_roles($network_metadata, ['infrastructure_alerting', 'primary-infrastructure_alerting']) - $infra_alerting_nodes_count = count($infra_alerting_nodes) - $infra_vip_name = 'infrastructure_alerting_mgmt_vip' - if $network_metadata['vips'][$infra_vip_name] { - $nagios_server = $network_metadata['vips'][$infra_vip_name]['ipaddr'] - } else { - $nagios_server = undef - } + # Infrastructure Alerting + $lma_infra_alerting = hiera('lma_infrastructure_alerting', {}) + $infra_alerting_nodes = get_nodes_hash_by_roles($network_metadata, ['infrastructure_alerting', 'primary-infrastructure_alerting']) + $infra_alerting_nodes_count = count($infra_alerting_nodes) + $infra_vip_name = 'infrastructure_alerting_mgmt_vip' + if $network_metadata['vips'][$infra_vip_name] { + $nagios_server = $network_metadata['vips'][$infra_vip_name]['ipaddr'] $nagios_password = $lma_infra_alerting['nagios_password'] - if $infra_alerting_nodes_count > 0 or $nagios_server { - $nagios_is_deployed = true - } else { - $nagios_is_deployed = false - } } else { - $nagios_is_deployed = false + $nagios_server = undef + } + if $infra_alerting_nodes_count > 0 and $nagios_server { + $nagios_is_deployed = true + } else { + $nagios_is_deployed = false } $hiera_file = '/etc/hiera/plugins/lma_collector.yaml' diff --git a/environment_config.yaml b/environment_config.yaml index a100b297b..773b74dc2 100644 --- a/environment_config.yaml +++ b/environment_config.yaml @@ -87,9 +87,3 @@ attributes: type: "password" regex: *not_empty_parameter restrictions: *disable_influxdb_parameters - - alerting_mode: - type: "checkbox" - weight: 90 - value: true - label: "Alerts sent to the StackLight Infrastructure Alerting plugin (Nagios) if deployed."