Convert SNMP configuration to composable services format
authorSteven Hardy <shardy@redhat.com>
Tue, 24 May 2016 17:40:45 +0000 (18:40 +0100)
committerEmilien Macchi <emilien@redhat.com>
Wed, 29 Jun 2016 19:43:50 +0000 (15:43 -0400)
Change-Id: I7265b0781acefd4a0de687b0465144e57bcc079f
Partially-Implements: blueprint composable-services-within-roles

overcloud-resource-registry-puppet.yaml
overcloud.yaml
puppet/compute.yaml
puppet/controller.yaml
puppet/manifests/overcloud_compute.pp
puppet/manifests/overcloud_controller.pp
puppet/manifests/overcloud_controller_pacemaker.pp
puppet/manifests/overcloud_object.pp
puppet/services/snmp.yaml [new file with mode: 0644]

index e4fc8a0..ba5b1eb 100644 (file)
@@ -161,6 +161,7 @@ resource_registry:
   OS::TripleO::Services::Ntp: puppet/services/time/ntp.yaml
   OS::TripleO::Services::SwiftProxy: puppet/services/swift-proxy.yaml
   OS::TripleO::Services::SwiftStorage: puppet/services/swift-storage.yaml
+  OS::TripleO::Services::Snmp: puppet/services/snmp.yaml
 
 parameter_defaults:
   EnablePackageInstall: false
index 0abc512..6f64b20 100644 (file)
@@ -258,14 +258,6 @@ parameters:
     description: The password for Redis
     type: string
     hidden: true
-  SnmpdReadonlyUserName:
-    default: ro_snmp_user
-    description: The user name for SNMPd with readonly rights running on all Overcloud nodes
-    type: string
-  SnmpdReadonlyUserPassword:
-    description: The user password for SNMPd with readonly rights running on all Overcloud nodes
-    type: string
-    hidden: true
   StorageVirtualFixedIPs:
     default: []
     description: >
@@ -589,6 +581,7 @@ parameters:
       - OS::TripleO::Services::Ntp
       - OS::TripleO::Services::SwiftProxy
       - OS::TripleO::Services::SwiftStorage
+      - OS::TripleO::Services::Snmp
     description: A list of service resources (configured in the Heat
                  resource_registry) which represent nested stacks
                  for each service that should get installed on the Controllers.
@@ -598,6 +591,7 @@ parameters:
     default:
       - OS::TripleO::Services::NovaCompute
       - OS::TripleO::Services::Ntp
+      - OS::TripleO::Services::Snmp
     description: A list of service resources (configured in the Heat
                  resource_registry) which represent nested stacks
                  for each service that should get installed on the Compute Nodes.
@@ -655,6 +649,7 @@ parameters:
     default:
       - OS::TripleO::Services::Ntp
       - OS::TripleO::Services::SwiftStorage
+      - OS::TripleO::Services::Snmp
     description: A list of service resources (configured in the Heat
                  resource_registry) which represent nested stacks
                  for each service that should get installed on the ObjectStorage nodes.
@@ -873,8 +868,6 @@ resources:
           RabbitClientUseSSL: {get_param: RabbitClientUseSSL}
           RabbitClientPort: {get_param: RabbitClientPort}
           RedisPassword: {get_param: RedisPassword}
-          SnmpdReadonlyUserName: {get_param: SnmpdReadonlyUserName}
-          SnmpdReadonlyUserPassword: {get_param: SnmpdReadonlyUserPassword}
           RedisVirtualIP: {get_attr: [RedisVirtualIP, ip_address]}
           RedisVirtualIPUri: {get_attr: [RedisVirtualIP, ip_address_uri]}
           SwiftHashSuffix: {get_param: SwiftHashSuffix}
@@ -976,8 +969,6 @@ resources:
           RabbitUserName: {get_param: RabbitUserName}
           RabbitClientUseSSL: {get_param: RabbitClientUseSSL}
           RabbitClientPort: {get_param: RabbitClientPort}
-          SnmpdReadonlyUserName: {get_param: SnmpdReadonlyUserName}
-          SnmpdReadonlyUserPassword: {get_param: SnmpdReadonlyUserPassword}
           ServiceNetMap: {get_param: ServiceNetMap}
           TimeZone: {get_param: TimeZone}
           EndpointMap: {get_attr: [EndpointMap, endpoint_map]}
index 7a86325..1bc0e0f 100644 (file)
@@ -254,14 +254,6 @@ parameters:
     default: 5672
     description: Set rabbit subscriber port, change this if using SSL
     type: number
-  SnmpdReadonlyUserName:
-    default: ro_snmp_user
-    description: The user name for SNMPd with readonly rights running on all Overcloud nodes
-    type: string
-  SnmpdReadonlyUserPassword:
-    description: The user password for SNMPd with readonly rights running on all Overcloud nodes
-    type: string
-    hidden: true
   UpgradeLevelNovaCompute:
     type: string
     description: Nova Compute upgrade level
@@ -541,8 +533,6 @@ resources:
                 ceilometer::agent::auth::auth_password: {get_input: ceilometer_password}
                 ceilometer::agent::auth::auth_url: {get_input: ceilometer_agent_auth_url}
                 ceilometer_compute_agent: {get_input: ceilometer_compute_agent}
-                snmpd_readonly_user_name: {get_input: snmpd_readonly_user_name}
-                snmpd_readonly_user_password: {get_input: snmpd_readonly_user_password}
                 nova::glance_api_servers: {get_input: glance_api_servers}
                 neutron::debug: {get_input: debug}
                 neutron::rabbit_password: {get_input: rabbit_password}
@@ -616,8 +606,6 @@ resources:
         ceilometer_password: {get_param: CeilometerPassword}
         ceilometer_compute_agent: {get_param: CeilometerComputeAgent}
         ceilometer_agent_auth_url: {get_param: [EndpointMap, KeystoneInternal, uri]}
-        snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
-        snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
         glance_api_servers: {get_param: [EndpointMap, GlanceInternal, uri]}
         neutron_flat_networks:
           str_replace:
index 6e703b9..fba8ba1 100644 (file)
@@ -326,14 +326,6 @@ parameters:
     type: string
     default: ''  # Has to be here because of the ignored empty value bug
     description: An IP address which is wrapped in brackets in case of IPv6
-  SnmpdReadonlyUserName:
-    default: ro_snmp_user
-    description: The user name for SNMPd with readonly rights running on all Overcloud nodes
-    type: string
-  SnmpdReadonlyUserPassword:
-    description: The user password for SNMPd with readonly rights running on all Overcloud nodes
-    type: string
-    hidden: true
   SwiftHashSuffix:
     description: A random string to be used as a salt when hashing to determine mappings
       in the ring.
@@ -697,8 +689,6 @@ resources:
         ceilometer_internal_url: {get_param: [EndpointMap, CeilometerInternal, uri]}
         ceilometer_admin_url: {get_param: [EndpointMap, CeilometerAdmin, uri]}
         ceilometer_agent_auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
-        snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
-        snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
         nova_enable_db_purge: {get_param: NovaEnableDBPurge}
         nova_ipv6: {get_param: NovaIPv6}
         corosync_ipv6: {get_param: CorosyncIPv6}
index da84927..f0987c7 100644 (file)
@@ -194,16 +194,6 @@ if hiera('step') >= 4 {
   include ::ceilometer::agent::compute
   include ::ceilometer::agent::auth
 
-  $snmpd_user = hiera('snmpd_readonly_user_name')
-  snmp::snmpv3_user { $snmpd_user:
-    authtype => 'MD5',
-    authpass => hiera('snmpd_readonly_user_password'),
-  }
-  class { '::snmp':
-    agentaddress => ['udp:161','udp6:[::1]:161'],
-    snmpd_config => [ join(['createUser ', hiera('snmpd_readonly_user_name'), ' MD5 "', hiera('snmpd_readonly_user_password'), '"']), join(['rouser ', hiera('snmpd_readonly_user_name')]), 'proc  cron', 'includeAllDisks  10%', 'master agentx', 'trapsink localhost public', 'iquerySecName internalUser', 'rouser internalUser', 'defaultMonitors yes', 'linkUpDownNotifications yes' ],
-  }
-
   hiera_include('compute_classes')
   package_manifest{ '/var/lib/tripleo/installed-packages/overcloud_compute': ensure => present }
 
index 8c14f91..b79eca4 100644 (file)
@@ -294,16 +294,6 @@ if hiera('step') >= 4 {
       default: { fail('Unrecognized gnocchi_backend parameter.') }
   }
 
-  $snmpd_user = hiera('snmpd_readonly_user_name')
-  snmp::snmpv3_user { $snmpd_user:
-    authtype => 'MD5',
-    authpass => hiera('snmpd_readonly_user_password'),
-  }
-  class { '::snmp':
-    agentaddress => ['udp:161','udp6:[::1]:161'],
-    snmpd_config => [ join(['createUser ', hiera('snmpd_readonly_user_name'), ' MD5 "', hiera('snmpd_readonly_user_password'), '"']), join(['rouser ', hiera('snmpd_readonly_user_name')]), 'proc  cron', 'includeAllDisks  10%', 'master agentx', 'trapsink localhost public', 'iquerySecName internalUser', 'rouser internalUser', 'defaultMonitors yes', 'linkUpDownNotifications yes' ],
-  }
-
   hiera_include('controller_classes')
 
 } #END STEP 4
index 84a8cb6..e095c96 100644 (file)
@@ -534,16 +534,6 @@ MYSQL_HOST=localhost\n",
     enabled        => false,
   }
 
-  $snmpd_user = hiera('snmpd_readonly_user_name')
-  snmp::snmpv3_user { $snmpd_user:
-    authtype => 'MD5',
-    authpass => hiera('snmpd_readonly_user_password'),
-  }
-  class { '::snmp':
-    agentaddress => ['udp:161','udp6:[::1]:161'],
-    snmpd_config => [ join(['createUser ', hiera('snmpd_readonly_user_name'), ' MD5 "', hiera('snmpd_readonly_user_password'), '"']), join(['rouser ', hiera('snmpd_readonly_user_name')]), 'proc  cron', 'includeAllDisks  10%', 'master agentx', 'trapsink localhost public', 'iquerySecName internalUser', 'rouser internalUser', 'defaultMonitors yes', 'linkUpDownNotifications yes' ],
-  }
-
   hiera_include('controller_classes')
 
 } #END STEP 4
index 5b6a9e5..cb0ea7c 100644 (file)
@@ -26,16 +26,6 @@ if hiera('step') >= 1 {
 }
 
 if hiera('step') >= 4 {
-  $snmpd_user = hiera('snmpd_readonly_user_name')
-  snmp::snmpv3_user { $snmpd_user:
-    authtype => 'MD5',
-    authpass => hiera('snmpd_readonly_user_password'),
-  }
-  class { '::snmp':
-    agentaddress => ['udp:161','udp6:[::1]:161'],
-    snmpd_config => [ join(['createUser ', hiera('snmpd_readonly_user_name'), ' MD5 "', hiera('snmpd_readonly_user_password'), '"']), join(['rouser ', hiera('snmpd_readonly_user_name')]), 'proc  cron', 'includeAllDisks  10%', 'master agentx', 'trapsink localhost public', 'iquerySecName internalUser', 'rouser internalUser', 'defaultMonitors yes', 'linkUpDownNotifications yes' ],
-  }
-
   hiera_include('object_classes')
 }
 
diff --git a/puppet/services/snmp.yaml b/puppet/services/snmp.yaml
new file mode 100644 (file)
index 0000000..24ee293
--- /dev/null
@@ -0,0 +1,31 @@
+heat_template_version: 2016-04-08
+
+description: >
+  SNMP client configured with Puppet, to facilitate Ceilometer Hardware
+  monitoring in the undercloud. This service is required to enable hardware
+  monitoring.
+
+parameters:
+  EndpointMap:
+    default: {}
+    description: Mapping of service endpoint -> protocol. Typically set
+                 via parameter_defaults in the resource registry.
+    type: json
+  SnmpdReadonlyUserName:
+    default: ro_snmp_user
+    description: The user name for SNMPd with readonly rights running on all Overcloud nodes
+    type: string
+  SnmpdReadonlyUserPassword:
+    description: The user password for SNMPd with readonly rights running on all Overcloud nodes
+    type: string
+    hidden: true
+
+outputs:
+  role_data:
+    description: Role data for the SNMP services
+    value:
+      config_settings:
+        snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
+        snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
+      step_config: |
+        include ::tripleo::profile::base::snmp