Fuel plugin to collect Logging Monitoring and Alerting metrics
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

openstack.pp 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # Copyright 2016 Mirantis, Inc.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  4. # not use this file except in compliance with the License. You may obtain
  5. # a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  11. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  12. # License for the specific language governing permissions and limitations
  13. # under the License.
  14. #
  15. define lma_collector::collectd::openstack (
  16. $user,
  17. $password,
  18. $tenant,
  19. $keystone_url,
  20. $timeout = 20,
  21. $max_retries = 2,
  22. $pacemaker_master_resource = undef,
  23. ) {
  24. include lma_collector::params
  25. include lma_collector::collectd::python_openstack_base
  26. $service = $title
  27. $supported_services = ['nova', 'nova_services',
  28. 'cinder', 'cinder_services', 'glance', 'keystone',
  29. 'neutron', 'neutron_agents']
  30. if ! member($supported_services, $service) {
  31. fail("service '${service}' is not supported")
  32. }
  33. validate_integer($timeout)
  34. validate_integer($max_retries)
  35. $config = {
  36. 'Username' => "\"${user}\"",
  37. 'Password' => "\"${password}\"",
  38. 'Tenant' => "\"${tenant}\"",
  39. 'KeystoneUrl' => "\"${keystone_url}\"",
  40. 'Timeout' => "\"${timeout}\"",
  41. 'MaxRetries' => "\"${max_retries}\"",
  42. }
  43. if $pacemaker_master_resource {
  44. $real_config = merge($config, {'DependsOnResource' => "\"${pacemaker_master_resource}\""})
  45. } else {
  46. $real_config = $config
  47. }
  48. lma_collector::collectd::python { "openstack_${title}":
  49. config => $real_config,
  50. }
  51. }