├── .gitignore ├── .gitreview ├── .pdkignore ├── .zuul.yaml ├── CHANGELOG.md ├── CONTRIBUTING.rst ├── Gemfile ├── LICENSE ├── README.md ├── Rakefile ├── bindep.txt ├── doc └── requirements.txt ├── examples └── site.pp ├── lib └── puppet │ ├── provider │ ├── gnocchi_api_paste_ini │ │ └── ini_setting.rb │ ├── gnocchi_api_uwsgi_config │ │ └── ini_setting.rb │ └── gnocchi_config │ │ └── openstackconfig.rb │ └── type │ ├── gnocchi_api_paste_ini.rb │ ├── gnocchi_api_uwsgi_config.rb │ └── gnocchi_config.rb ├── manifests ├── api.pp ├── client.pp ├── config.pp ├── cors.pp ├── db.pp ├── db │ ├── mysql.pp │ ├── postgresql.pp │ └── sync.pp ├── deps.pp ├── healthcheck.pp ├── init.pp ├── keystone │ ├── auth.pp │ └── authtoken.pp ├── logging.pp ├── metricd.pp ├── params.pp ├── policy.pp ├── statsd.pp ├── storage.pp ├── storage │ ├── ceph.pp │ ├── file.pp │ ├── incoming │ │ ├── file.pp │ │ └── redis.pp │ ├── s3.pp │ └── swift.pp └── wsgi │ ├── apache.pp │ └── uwsgi.pp ├── metadata.json ├── releasenotes ├── notes │ ├── Adds-enable-proxy-header-parsing-3f3da693df01b5ec.yaml │ ├── access_log_env_var-60037442d322f7e8.yaml │ ├── add-log_file-for-logging-b978d0ad122b36ed.yaml │ ├── add-metric-delay-c4b5db22171d9165.yaml │ ├── add-metricd-processing-delay-76c234b0727f092a.yaml │ ├── add-middlewares-configuration-fdb6048123cc848f.yaml │ ├── add-openstackclient-client-ab8c46a274ff4349.yaml │ ├── add-s3-driver-c73d167c81a8b33c.yaml │ ├── add-sync_db-to-gnocchi-db-class-d3fed198a27b15e0.yaml │ ├── add-use_journal-option-for-logging-8c99500f64320163.yaml │ ├── add_db_sync_timeout-8363be2e21ddc1e8.yaml │ ├── add_watch_log_file-option-89d790e542d4d081.yaml │ ├── added_python_rados_package-0427154d398c9d75.yaml │ ├── apache-headers-0091ba375bd625f6.yaml │ ├── api-operation_timeout-909cae1732afee42.yaml │ ├── api-paste_config-590218f4261661c7.yaml │ ├── api_paste-b94e191896840944.yaml │ ├── api_paste_ini-separator-3e39be7a841c71ad.yaml │ ├── authtoken-c0b1d26fc3156482.yaml │ ├── authtoken_manage_memcache_package-a83630efd64e36a0.yaml │ ├── centos-9-support-bde5553b64716c60.yaml │ ├── ceph_secret-8e8fbccd416b0883.yaml │ ├── ceph_timeout-770ca9c5ff60a976.yaml │ ├── client-04f70664e363425c.yaml │ ├── config-api-paste_ini-7ce01cbf1b62d666.yaml │ ├── configure_service-7f4d0478b7e74711.yaml │ ├── cradox-e10fb8c46ec2935a.yaml │ ├── db_upgrade-2eff712611fa34ba.yaml │ ├── default-metricd-to-safer-value-529c85e617105424.yaml │ ├── deprecate-api-middlewares-20287ca86b384799.yaml │ ├── deprecate-gnocchi-database_connection-65d47012e2bd0579.yaml │ ├── deprecate-oslo-log-params-12ed30a5db0e5baf.yaml │ ├── deprecate-storage-options-bff9a8cde960a8bc.yaml │ ├── deprecate-watch_log_file-f29924b2bcb809f1.yaml │ ├── deprecate_auth_uri_parameter-91324d12d87e4618.yaml │ ├── deprecate_ensure_package_parameter-8a3583e991345fd3.yaml │ ├── deprecate_pki_related_parameters-8d707b64e754d061.yaml │ ├── deprecate_revocation_cache_time_parameter-f2b545e59754e5ba.yaml │ ├── deprecate_signing_dir_parameter-6135a83f34551ef9.yaml │ ├── deprecate_statsd_options-87315a345ef19816.yaml │ ├── deprecated-manage-cradox-6a4052d270c5180e.yaml │ ├── disable-apache-ssl-c2c62907caa34749.yaml │ ├── dont-include-logging-init-46f9d159f3456994.yaml │ ├── drop-fedora-2a73195edf824a0f.yaml │ ├── drop-influxdb-classes-d2e4d3d02290ce9d.yaml │ ├── drop_qpid-1774ee36bab4e8e9.yaml │ ├── external_install_mgmt_hook-6717235a692f234d.yaml │ ├── file-incoming-driver-166fa94e9253781e.yaml │ ├── fix-s3-and-install-boto3-49991c1b453c2168.yaml │ ├── gnocchi-api-deprecated-options-782e19fefaff5f5f.yaml │ ├── gnocchi-api-remove-deprecated-host-port-workers-8bbe2e5ddf6b7072.yaml │ ├── hc-enable_by_file_paths-40231ad5bbc4ae0f.yaml │ ├── healthcheck-0465f924bd2f4dbe.yaml │ ├── healthcheck-allowed_source_ranges-b1c11b198c0ad1b9.yaml │ ├── healthcheck-ignore_proxied_requests-7922bce837a45541.yaml │ ├── httpd-logs-piped-syslog-96f86098dbfb38cc.yaml │ ├── influxdb-889413086f27c7e4.yaml │ ├── install-redis-ded395c27ee7dfc3.yaml │ ├── keystone-auth-name-c23eaad41284ac43.yaml │ ├── keystone-authtoken-interface-c06d43b518a9dd80.yaml │ ├── keystone-authtoken-service_type-4a4662738bfc44c9.yaml │ ├── keystone_auth-557bfe055fd9101d.yaml │ ├── log-json-514a919eec6e2b8e.yaml │ ├── max_request_body_size-99d457dd976374cc.yaml │ ├── metricd-dd917b15aa827654.yaml │ ├── metricd-opts-78c846cee9222e7d.yaml │ ├── metricd_workers-6fe3da8ec2927909.yaml │ ├── migrate-policy-format-from-json-to-yaml-790e4f7ef2d7e68c.yaml │ ├── openstack_db_tag-8b0893929fcd6617.yaml │ ├── os_workers_for_worker_count-3517788058682645.yaml │ ├── oslo-db-options-1af29036e647d8c9.yaml │ ├── oslo_policy-enforce_scope-3cf4ea69a6f5a91f.yaml │ ├── policy-dirs-3a09b80e991f9745.yaml │ ├── policy-enforce_new_defaults-f33654b6eb02c4f2.yaml │ ├── policy_default_rule-c2f38a50dc3f2636.yaml │ ├── policy_purge_config-842778b72b5916f8.yaml │ ├── prepare-to-change-apache-ssl-95eb9428664d7a5b.yaml │ ├── puppet-8-9f211baa0b2cbb0e.yaml │ ├── puppet4-mysql-func-4d364d08e159b230.yaml │ ├── pymysql-e57bf1f0289dd426.yaml │ ├── release-note-ubuntu-py3-4f70daa32cd6f04e.yaml │ ├── remove-api-middleware-298f14aedeb92362.yaml │ ├── remove-api-paste-712235bf18a47855.yaml │ ├── remove-auth-uri-b751d103ac62f67d.yaml │ ├── remove-centos-8-7bc984364b2c1250.yaml │ ├── remove-deprecated-db-init-62110da4e2d86881.yaml │ ├── remove-manage-cradox-72d292874c5fb286.yaml │ ├── remove-metricd-cleanup_delay-7cfd91487f8d4c43.yaml │ ├── remove-puppet-6-f6f8cef93b77dc20.yaml │ ├── remove-storage-options-22a1f994f8713794.yaml │ ├── remove-swift-auth_tenant_name-32010b83e506b70c.yaml │ ├── remove-watch_log_file-2be7a59d3036fddb.yaml │ ├── remove_deprecated_ensure_package_option-b6afaafe8e6bf9fd.yaml │ ├── remove_deprecated_keystone_revocation_cache_time_option-8a0d0250946f08bf.yaml │ ├── remove_deprecated_keystone_signing_dir_option-9910df26a9798db6.yaml │ ├── remove_deprecated_logging_options-7601c56e6cc49f3c.yaml │ ├── remove_deprecated_pki_related_options-8d7fe0e0c58fc48e.yaml │ ├── remove_old_authtoken_options-2ea2763a69ea5f76.yaml │ ├── remove_verbose-6f796fb4c2fde1e3.yaml │ ├── rspec-puppet-facts-ee600fc22f33e93f.yaml │ ├── service_token_roles-9955b67a04160949.yaml │ ├── service_token_roles_required-a35dbab612e8d796.yaml │ ├── statsd-creator-4dd4b95ac66cef5a.yaml │ ├── statsd-flush_delay-optional-e1aa6d8aac600191.yaml │ ├── statsd-host-and-port-57b290e8dd57ed6f.yaml │ ├── storage-ceph-package_ensure-36b77ea422e5c628.yaml │ ├── storage-swift-keystone-v3-params-e07787e87f7999fc.yaml │ ├── storage-swift_project_name-5c00b6eea8e4b009.yaml │ ├── swift-opts-57734ccd24e882f1.yaml │ ├── swift_container_prefix-ea1aaa526fbd2a54.yaml │ ├── switch_to_oslo-3eef147d9c6214e8.yaml │ ├── system_scope-keystone-dfb7566a1f8b1eab.yaml │ ├── tune-workers-and-thread-defaults-8eaabb88ae5a7d79.yaml │ ├── ubuntu-jammy-3786c2e486535113.yaml │ ├── ubuntu-noble-f02beb5b1e030d06.yaml │ ├── use-reno-1caaec4ba5aa4285.yaml │ ├── uwsgi-55ad851a66baa5e9.yaml │ ├── verbose-deprecation-586c044e066c05d9.yaml │ └── wsgi_process_options-c96a71aca0c2e1e5.yaml └── source │ ├── 2023.1.rst │ ├── 2023.2.rst │ ├── 2024.1.rst │ ├── 2024.2.rst │ ├── 2025.1.rst │ ├── _static │ └── .placeholder │ ├── conf.py │ ├── index.rst │ ├── mitaka.rst │ ├── newton.rst │ ├── ocata.rst │ ├── pike.rst │ ├── queens.rst │ ├── rocky.rst │ ├── stein.rst │ ├── train.rst │ ├── unreleased.rst │ ├── ussuri.rst │ ├── victoria.rst │ ├── wallaby.rst │ ├── xena.rst │ ├── yoga.rst │ └── zed.rst ├── setup.cfg ├── setup.py ├── spec ├── acceptance │ ├── 10_basic_gnocchi_spec.rb │ └── 99_gnocchi_config_spec.rb ├── classes │ ├── gnocchi_api_spec.rb │ ├── gnocchi_client_spec.rb │ ├── gnocchi_config_spec.rb │ ├── gnocchi_cors_spec.rb │ ├── gnocchi_db_mysql_spec.rb │ ├── gnocchi_db_postgresql_spec.rb │ ├── gnocchi_db_spec.rb │ ├── gnocchi_db_sync_spec.rb │ ├── gnocchi_healthcheck_spec.rb │ ├── gnocchi_init_spec.rb │ ├── gnocchi_keystone_auth_spec.rb │ ├── gnocchi_keystone_authtoken_spec.rb │ ├── gnocchi_logging_spec.rb │ ├── gnocchi_metricd_spec.rb │ ├── gnocchi_policy_spec.rb │ ├── gnocchi_statsd_spec.rb │ ├── gnocchi_storage_ceph_spec.rb │ ├── gnocchi_storage_file_spec.rb │ ├── gnocchi_storage_incoming_file_spec.rb │ ├── gnocchi_storage_incoming_redis_spec.rb │ ├── gnocchi_storage_s3_spec.rb │ ├── gnocchi_storage_spec.rb │ ├── gnocchi_storage_swift_spec.rb │ ├── gnocchi_wsgi_apache_spec.rb │ └── gnocchi_wsgi_uwsgi_spec.rb ├── shared_examples.rb ├── spec_helper.rb ├── spec_helper_acceptance.rb └── unit │ ├── provider │ ├── gnocchi_api_paste_ini │ │ └── ini_setting_spec.rb │ ├── gnocchi_api_uwsgi_config │ │ └── ini_setting_spec.rb │ └── gnocchi_config │ │ └── openstackconfig_spec.rb │ └── type │ ├── gnocchi_api_paste_ini_spec.rb │ ├── gnocchi_api_uwsgi_config_spec.rb │ └── gnocchi_config_spec.rb └── tox.ini /.gitignore: -------------------------------------------------------------------------------- 1 | # Add patterns in here to exclude files created by tools integrated with this 2 | # repository, such as test frameworks from the project's recommended workflow, 3 | # rendered documentation and package builds. 4 | # 5 | # Don't add patterns to exclude files created by preferred personal tools 6 | # (editors, IDEs, your operating system itself even). These should instead be 7 | # maintained outside the repository, for example in a ~/.gitignore file added 8 | # with: 9 | # 10 | # git config --global core.excludesfile '~/.gitignore' 11 | 12 | pkg/ 13 | Gemfile.lock 14 | vendor/ 15 | spec/fixtures/ 16 | .vagrant/ 17 | .bundle/ 18 | coverage/ 19 | .idea/ 20 | *.iml 21 | /openstack 22 | /log 23 | 24 | # Files created by releasenotes build 25 | releasenotes/build 26 | .tox 27 | -------------------------------------------------------------------------------- /.gitreview: -------------------------------------------------------------------------------- 1 | [gerrit] 2 | host=review.opendev.org 3 | port=29418 4 | project=openstack/puppet-gnocchi.git 5 | -------------------------------------------------------------------------------- /.pdkignore: -------------------------------------------------------------------------------- 1 | # common list used in puppetlabs repos 2 | .git/ 3 | .*.sw[op] 4 | .metadata 5 | .yardoc 6 | .yardwarns 7 | *.iml 8 | /.bundle/ 9 | /.idea/ 10 | /.vagrant/ 11 | /coverage/ 12 | /bin/ 13 | /doc/ 14 | /Gemfile.local 15 | /Gemfile.lock 16 | /junit/ 17 | /log/ 18 | /pkg/ 19 | /spec/fixtures/manifests/ 20 | /spec/fixtures/modules/* 21 | /tmp/ 22 | /vendor/ 23 | /convert_report.txt 24 | /update_report.txt 25 | .DS_Store 26 | .project 27 | .envrc 28 | /inventory.yaml 29 | /spec/fixtures/litmus_inventory.yaml 30 | /.fixtures.yml 31 | /Gemfile 32 | /.gitattributes 33 | /.gitignore 34 | /.pdkignore 35 | /.puppet-lint.rc 36 | /Rakefile 37 | /rakelib/ 38 | /.rspec 39 | /..yml 40 | /.yardopts 41 | /spec/ 42 | /.vscode/ 43 | /.sync.yml 44 | /.devcontainer/ 45 | # OpenStack-specific files 46 | /bindep.txt 47 | /.gitreview 48 | /releasenotes/ 49 | /setup.cfg 50 | /setup.py 51 | /tox.ini 52 | /.zuul.yaml 53 | -------------------------------------------------------------------------------- /.zuul.yaml: -------------------------------------------------------------------------------- 1 | - project: 2 | templates: 3 | - puppet-openstack-check-jobs 4 | - puppet-openstack-module-unit-jobs 5 | - puppet-openstack-integration-jobs-scenario001 6 | - puppet-openstack-integration-jobs-scenario002 7 | - puppet-openstack-litmus-jobs 8 | - release-notes-jobs-python3 9 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 8.0.0 and beyond 2 | 3 | From 8.0.0 release and beyond, release notes are published on 4 | [docs.openstack.org](https://docs.openstack.org/releasenotes/puppet-gnocchi/). 5 | 6 | ##2015-11-25 - 7.0.0 7 | ###Summary 8 | 9 | - Initial release of the puppet-gnocchi module 10 | -------------------------------------------------------------------------------- /CONTRIBUTING.rst: -------------------------------------------------------------------------------- 1 | The source repository for this project can be found at: 2 | 3 | https://opendev.org/openstack/puppet-gnocchi 4 | 5 | Pull requests submitted through GitHub are not monitored. 6 | 7 | To start contributing to OpenStack, follow the steps in the contribution guide 8 | to set up and use Gerrit: 9 | 10 | https://docs.openstack.org/contributors/code-and-documentation/quick-start.html 11 | 12 | Bugs should be filed on Launchpad: 13 | 14 | https://bugs.launchpad.net/puppet-gnocchi 15 | 16 | For more specific information about contributing to this repository, see the 17 | Puppet OpenStack contributor guide: 18 | 19 | https://docs.openstack.org/puppet-openstack-guide/latest/contributor/contributing.html 20 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source ENV['GEM_SOURCE'] || "https://rubygems.org" 2 | 3 | group :development, :test, :system_tests do 4 | spec_helper_dir = '/home/zuul/src/opendev.org/openstack/puppet-openstack_spec_helper' 5 | if File.directory?(spec_helper_dir) 6 | if ENV['ZUUL_PROJECT'] == 'openstack/puppet-openstack_spec_helper' 7 | gem 'puppet-openstack_spec_helper', 8 | :path => '../..', 9 | :require => 'false' 10 | else 11 | gem 'puppet-openstack_spec_helper', 12 | :path => spec_helper_dir, 13 | :require => 'false' 14 | end 15 | else 16 | spec_helper_version = ENV['ZUUL_BRANCH'] || "master" 17 | gem 'puppet-openstack_spec_helper', 18 | :git => 'https://opendev.org/openstack/puppet-openstack_spec_helper', 19 | :ref => spec_helper_version, 20 | :require => 'false' 21 | end 22 | end 23 | 24 | if facterversion = ENV['FACTER_GEM_VERSION'] 25 | gem 'facter', facterversion, :require => false 26 | else 27 | gem 'facter', :require => false 28 | end 29 | 30 | if puppetversion = ENV['PUPPET_GEM_VERSION'] 31 | gem 'puppet', puppetversion, :require => false 32 | else 33 | gem 'puppet', :require => false 34 | end 35 | 36 | # vim:ft=ruby 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Team and repository tags 2 | ======================== 3 | 4 | [![Team and repository tags](https://governance.openstack.org/tc/badges/puppet-gnocchi.svg)](https://governance.openstack.org/tc/reference/tags/index.html) 5 | 6 | 7 | 8 | puppet-gnocchi 9 | ============== 10 | 11 | #### Table of Contents 12 | 13 | 1. [Overview - What is the gnocchi module?](#overview) 14 | 2. [Module Description - What does the module do?](#module-description) 15 | 3. [Setup - The basics of getting started with gnocchi](#setup) 16 | 4. [Implementation - An under-the-hood peek at what the module is doing](#implementation) 17 | 5. [Limitations - OS compatibility, etc.](#limitations) 18 | 6. [Development - Guide for contributing to the module](#development) 19 | 7. [Contributors - Those with commits](#contributors) 20 | 8. [Release Notes - Release notes for the project](#release-notes) 21 | 9. [Repository - The project source code repository](#repository) 22 | 23 | Overview 24 | -------- 25 | 26 | The gnocchi module is a part of [OpenStack](https://opendev.org/openstack), an effort by the OpenStack infrastructure team to provide continuous integration testing and code review for OpenStack and OpenStack community projects as part of the core software. The module itself is used to flexibly configure and manage the management service for OpenStack. 27 | 28 | Module Description 29 | ------------------ 30 | 31 | Setup 32 | ----- 33 | 34 | **What the gnocchi module affects:** 35 | 36 | * [Gnocchi](https://gnocchi.xyz/), the HTTP API to store metrics and index resources for OpenStack 37 | (OpenStack Datapoint Service). 38 | 39 | ### Installing gnocchi 40 | 41 | puppet module install openstack/gnocchi 42 | 43 | Implementation 44 | -------------- 45 | 46 | ### gnocchi 47 | 48 | gnocchi is a combination of Puppet manifest and ruby code to delivery configuration and extra functionality through types and providers. 49 | 50 | ### Types 51 | 52 | #### gnocchi_config 53 | 54 | The `gnocchi_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/gnocchi/gnocchi.conf` file. 55 | 56 | ```puppet 57 | gnocchi_config { 'DEFAULT/debug' : 58 | value => true, 59 | } 60 | ``` 61 | 62 | This will write `debug=true` in the `[DEFAULT]` section. 63 | 64 | ##### name 65 | 66 | Section/setting name to manage from `gnocchi.conf` 67 | 68 | ##### value 69 | 70 | The value of the setting to be defined. 71 | 72 | ##### secret 73 | 74 | Whether to hide the value from Puppet logs. Defaults to `false`. 75 | 76 | ##### ensure_absent_val 77 | 78 | If value is equal to ensure_absent_val then the resource will behave as if `ensure => absent` was specified. Defaults to `` 79 | 80 | Limitations 81 | ----------- 82 | 83 | ### Load balancing Gnocchi MySQL with HAProxy 84 | 85 | #### Issue 86 | 87 | MySQL client/server interaction causes an issue where the HAProxy server will keep a connection in TIME_WAIT. When Gnocchi is processing data it will generate a lot of connections to MySQL and [exhaust all available tcp ports](http://blog.haproxy.com/2012/12/12/haproxy-high-mysql-request-rate-and-tcp-source-port-exhaustion/) for a given IP address. If the HAProxy VIP is shared with other components, this can cause them to be unavailable too. Tuning of HAProxy instance is essential when using Gnocchi with a MySQL behind an HAProxy. 88 | 89 | The sysctl parameters need tuning. 90 | 91 | * net.ipv4.tcp_tw_reuse = 1 92 | * net.core.somaxconn = 4096 93 | * net.ipv4.tcp_max_syn_backlog = 60000 94 | 95 | Additionally, HAProxy can be configured to use different source IP addresses on each backend to help further mitigate the issue. 96 | 97 | Development 98 | ----------- 99 | 100 | Developer documentation for the entire puppet-openstack project. 101 | 102 | * https://docs.openstack.org/puppet-openstack-guide/latest/ 103 | 104 | Contributors 105 | ------------ 106 | 107 | The github [contributor graph](https://github.com/openstack/puppet-gnocchi/graphs/contributors). 108 | 109 | Release Notes 110 | ------------- 111 | 112 | * https://docs.openstack.org/releasenotes/puppet-gnocchi 113 | 114 | Repository 115 | ---------- 116 | 117 | * https://opendev.org/openstack/puppet-gnocchi 118 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'puppet-openstack_spec_helper/rake_tasks' 2 | -------------------------------------------------------------------------------- /bindep.txt: -------------------------------------------------------------------------------- 1 | # This is a cross-platform list tracking distribution packages needed by tests; 2 | # see https://docs.openstack.org/infra/bindep/ for additional information. 3 | 4 | libxml2-devel [test platform:rpm] 5 | libxml2-dev [test platform:dpkg] 6 | libxslt-devel [test platform:rpm] 7 | libxslt1-dev [test platform:dpkg] 8 | ruby-devel [test platform:rpm] 9 | ruby-dev [test platform:dpkg] 10 | zlib1g-dev [test platform:dpkg] 11 | zlib-devel [test platform:rpm] 12 | puppet [build] 13 | -------------------------------------------------------------------------------- /doc/requirements.txt: -------------------------------------------------------------------------------- 1 | # This is required for the docs build jobs 2 | sphinx>=3.5.1 # BSD 3 | openstackdocstheme>=2.2.7 # Apache-2.0 4 | 5 | # This is required for the releasenotes build jobs 6 | reno>=3.2.0 # Apache-2.0 7 | -------------------------------------------------------------------------------- /examples/site.pp: -------------------------------------------------------------------------------- 1 | # This is an example of site.pp to deploy Gnocchi 2 | 3 | class { 'gnocchi::keystone::auth': 4 | admin_url => 'http://10.0.0.1:8041', 5 | internal_url => 'http://10.0.0.1:8041', 6 | public_url => 'http://10.0.0.1:8041', 7 | password => 'verysecrete', 8 | region => 'OpenStack' 9 | } 10 | 11 | class { 'gnocchi': 12 | database_connection => 'mysql+pymysql://gnocchi:secrete@10.0.0.1/gnocchi?charset=utf8', 13 | } 14 | 15 | class { 'gnocchi::api': 16 | bind_host => '10.0.0.1', 17 | identity_uri => 'https://identity.openstack.org:5000', 18 | keystone_password => 'verysecrete' 19 | } 20 | 21 | class { 'gnocchi::statsd': 22 | resource_id => '07f26121-5777-48ba-8a0b-d70468133dd9', 23 | archive_policy_name => 'high', 24 | flush_delay => '100', 25 | } 26 | 27 | include gnocchi::client 28 | -------------------------------------------------------------------------------- /lib/puppet/provider/gnocchi_api_paste_ini/ini_setting.rb: -------------------------------------------------------------------------------- 1 | Puppet::Type.type(:gnocchi_api_paste_ini).provide( 2 | :ini_setting, 3 | :parent => Puppet::Type.type(:openstack_config).provider(:ini_setting) 4 | ) do 5 | 6 | def self.file_path 7 | '/etc/gnocchi/api-paste.ini' 8 | end 9 | 10 | end 11 | -------------------------------------------------------------------------------- /lib/puppet/provider/gnocchi_api_uwsgi_config/ini_setting.rb: -------------------------------------------------------------------------------- 1 | Puppet::Type.type(:gnocchi_api_uwsgi_config).provide( 2 | :ini_setting, 3 | :parent => Puppet::Type.type(:openstack_config).provider(:ini_setting) 4 | ) do 5 | 6 | def self.file_path 7 | '/etc/gnocchi/gnocchi-api-uwsgi.ini' 8 | end 9 | 10 | end 11 | -------------------------------------------------------------------------------- /lib/puppet/provider/gnocchi_config/openstackconfig.rb: -------------------------------------------------------------------------------- 1 | Puppet::Type.type(:gnocchi_config).provide( 2 | :openstackconfig, 3 | :parent => Puppet::Type.type(:openstack_config).provider(:ruby) 4 | ) do 5 | 6 | def self.file_path 7 | '/etc/gnocchi/gnocchi.conf' 8 | end 9 | 10 | end 11 | -------------------------------------------------------------------------------- /lib/puppet/type/gnocchi_api_paste_ini.rb: -------------------------------------------------------------------------------- 1 | Puppet::Type.newtype(:gnocchi_api_paste_ini) do 2 | 3 | ensurable 4 | 5 | newparam(:name, :namevar => true) do 6 | desc 'Section/setting name to manage from /etc/gnocchi/api-paste.ini' 7 | newvalues(/\S+\/\S+/) 8 | end 9 | 10 | newproperty(:value) do 11 | desc 'The value of the setting to be defined.' 12 | munge do |value| 13 | value = value.to_s.strip 14 | value.capitalize! if value =~ /^(true|false)$/i 15 | value 16 | end 17 | 18 | def is_to_s( currentvalue ) 19 | if resource.secret? 20 | return '[old secret redacted]' 21 | else 22 | return currentvalue 23 | end 24 | end 25 | 26 | def should_to_s( newvalue ) 27 | if resource.secret? 28 | return '[new secret redacted]' 29 | else 30 | return newvalue 31 | end 32 | end 33 | end 34 | 35 | newparam(:secret, :boolean => true) do 36 | desc 'Whether to hide the value from Puppet logs. Defaults to `false`.' 37 | 38 | newvalues(:true, :false) 39 | 40 | defaultto false 41 | end 42 | 43 | newparam(:ensure_absent_val) do 44 | desc 'A value that is specified as the value property will behave as if ensure => absent was specified' 45 | defaultto('') 46 | end 47 | 48 | newparam(:key_val_separator) do 49 | desc 'The separator string to use between each setting name and value.' 50 | defaultto('=') 51 | end 52 | 53 | autorequire(:anchor) do 54 | ['gnocchi::install::end'] 55 | end 56 | 57 | end 58 | -------------------------------------------------------------------------------- /lib/puppet/type/gnocchi_api_uwsgi_config.rb: -------------------------------------------------------------------------------- 1 | Puppet::Type.newtype(:gnocchi_api_uwsgi_config) do 2 | 3 | ensurable 4 | 5 | newparam(:name, :namevar => true) do 6 | desc 'Section/setting name to manage from /etc/gnocchi/gnocchi-api-uwsgi.ini' 7 | newvalues(/\S+\/\S+/) 8 | end 9 | 10 | newproperty(:value) do 11 | desc 'The value of the setting to be defined.' 12 | munge do |value| 13 | value = value.to_s.strip 14 | value.capitalize! if value =~ /^(true|false)$/i 15 | value 16 | end 17 | newvalues(/^[\S ]*$/) 18 | end 19 | 20 | newparam(:ensure_absent_val) do 21 | desc 'A value that is specified as the value property will behave as if ensure => absent was specified' 22 | defaultto('') 23 | end 24 | 25 | autorequire(:anchor) do 26 | ['gnocchi::install::end'] 27 | end 28 | 29 | end 30 | -------------------------------------------------------------------------------- /lib/puppet/type/gnocchi_config.rb: -------------------------------------------------------------------------------- 1 | Puppet::Type.newtype(:gnocchi_config) do 2 | 3 | ensurable 4 | 5 | newparam(:name, :namevar => true) do 6 | desc 'Section/setting name to manage from gnocchi.conf' 7 | newvalues(/\S+\/\S+/) 8 | end 9 | 10 | newproperty(:value, :array_matching => :all) do 11 | desc 'The value of the setting to be defined.' 12 | def insync?(is) 13 | return true if @should.empty? 14 | return false unless is.is_a? Array 15 | return false unless is.length == @should.length 16 | return ( 17 | is & @should == is or 18 | is & @should.map(&:to_s) == is 19 | ) 20 | end 21 | munge do |value| 22 | value = value.to_s.strip 23 | value.capitalize! if value =~ /^(true|false)$/i 24 | value 25 | end 26 | 27 | def is_to_s( currentvalue ) 28 | if resource.secret? 29 | return '[old secret redacted]' 30 | else 31 | return currentvalue 32 | end 33 | end 34 | 35 | def should_to_s( newvalue ) 36 | if resource.secret? 37 | return '[new secret redacted]' 38 | else 39 | return newvalue 40 | end 41 | end 42 | end 43 | 44 | newparam(:secret, :boolean => true) do 45 | desc 'Whether to hide the value from Puppet logs. Defaults to `false`.' 46 | 47 | newvalues(:true, :false) 48 | 49 | defaultto false 50 | end 51 | 52 | newparam(:ensure_absent_val) do 53 | desc 'A value that is specified as the value property will behave as if ensure => absent was specified' 54 | defaultto('') 55 | end 56 | 57 | autorequire(:anchor) do 58 | ['gnocchi::install::end'] 59 | end 60 | 61 | end 62 | -------------------------------------------------------------------------------- /manifests/api.pp: -------------------------------------------------------------------------------- 1 | # Installs & configure the gnocchi api service 2 | # 3 | # == Parameters 4 | # 5 | # [*enabled*] 6 | # (optional) Should the service be enabled. 7 | # Defaults to true 8 | # 9 | # [*manage_service*] 10 | # (optional) Whether the service should be managed by Puppet. 11 | # Defaults to true. 12 | # 13 | # [*max_limit*] 14 | # (optional) The maximum number of items returned in a 15 | # single response from a collection resource. 16 | # Defaults to $facts['os_service_default'] 17 | # 18 | # [*package_ensure*] 19 | # (optional) ensure state for package. 20 | # Defaults to 'present' 21 | # 22 | # [*service_name*] 23 | # (optional) Name of the service that will be providing the 24 | # server functionality of gnocchi-api. 25 | # If the value is 'httpd', this means gnocchi-api will be a web 26 | # service, and you must use another class to configure that 27 | # web service. For example, use class { 'gnocchi::wsgi::apache'...} 28 | # to make gnocchi-api be a web app using apache mod_wsgi. 29 | # Defaults to '$::gnocchi::params::api_service_name' 30 | # 31 | # [*sync_db*] 32 | # (optional) Run gnocchi-upgrade db sync on api nodes after installing the package. 33 | # Defaults to false 34 | # 35 | # [*auth_strategy*] 36 | # (optional) Configure gnocchi authentication. 37 | # Can be set to noauth and keystone. 38 | # Defaults to 'keystone'. 39 | # 40 | # [*paste_config*] 41 | # (Optional) Path to API paste configuration. 42 | # Defaults to $facts['os_service_default']. 43 | # 44 | # [*operation_timeout*] 45 | # (Optional) Number of seconds before timeout when attempting to do some 46 | # operations. 47 | # Defaults to $facts['os_service_default']. 48 | # 49 | # [*enable_proxy_headers_parsing*] 50 | # (Optional) Enable paste middleware to handle SSL requests through 51 | # HTTPProxyToWSGI middleware. 52 | # Defaults to $facts['os_service_default']. 53 | # 54 | # [*max_request_body_size*] 55 | # (Optional) Set max request body size 56 | # Defaults to $facts['os_service_default']. 57 | # 58 | class gnocchi::api ( 59 | Boolean $manage_service = true, 60 | Boolean $enabled = true, 61 | $package_ensure = 'present', 62 | $max_limit = $facts['os_service_default'], 63 | $service_name = $::gnocchi::params::api_service_name, 64 | Boolean $sync_db = false, 65 | $auth_strategy = 'keystone', 66 | $paste_config = $facts['os_service_default'], 67 | $operation_timeout = $facts['os_service_default'], 68 | $enable_proxy_headers_parsing = $facts['os_service_default'], 69 | $max_request_body_size = $facts['os_service_default'], 70 | ) inherits gnocchi::params { 71 | 72 | include gnocchi::deps 73 | include gnocchi::policy 74 | 75 | package { 'gnocchi-api': 76 | ensure => $package_ensure, 77 | name => $::gnocchi::params::api_package_name, 78 | tag => ['openstack', 'gnocchi-package'], 79 | } 80 | 81 | if $sync_db { 82 | include gnocchi::db::sync 83 | } 84 | 85 | if $manage_service { 86 | if $enabled { 87 | $service_ensure = 'running' 88 | } else { 89 | $service_ensure = 'stopped' 90 | } 91 | 92 | if $service_name == $::gnocchi::params::api_service_name { 93 | service { 'gnocchi-api': 94 | ensure => $service_ensure, 95 | name => $::gnocchi::params::api_service_name, 96 | enable => $enabled, 97 | hasstatus => true, 98 | hasrestart => true, 99 | tag => ['gnocchi-service', 'gnocchi-db-sync-service'], 100 | } 101 | 102 | # On any paste-api.ini config change, we must rstart Gnocchi API. 103 | Gnocchi_api_paste_ini<||> ~> Service['gnocchi-api'] 104 | # On any uwsgi config change, we must restart Gnocchi API. 105 | Gnocchi_api_uwsgi_config<||> ~> Service['gnocchi-api'] 106 | 107 | } elsif $service_name == 'httpd' { 108 | service { 'gnocchi-api': 109 | ensure => 'stopped', 110 | name => $::gnocchi::params::api_service_name, 111 | enable => false, 112 | tag => ['gnocchi-service', 'gnocchi-db-sync-service'], 113 | } 114 | Service <| title == 'httpd' |> { tag +> 'gnocchi-service' } 115 | 116 | # we need to make sure gnocchi-api/eventlet is stopped before trying to start apache 117 | Service['gnocchi-api'] -> Service[$service_name] 118 | 119 | # On any paste-api.ini config change, we must rstart Gnocchi API. 120 | Gnocchi_api_paste_ini<||> ~> Service[$service_name] 121 | 122 | } else { 123 | fail("Invalid service_name. Either gnocchi/openstack-gnocchi-api for running as a \ 124 | standalone service, or httpd for being run by a httpd server") 125 | } 126 | } 127 | 128 | gnocchi_config { 129 | 'api/max_limit': value => $max_limit; 130 | 'api/auth_mode': value => $auth_strategy; 131 | 'api/paste_config': value => $paste_config; 132 | 'api/operation_timeout': value => $operation_timeout; 133 | 'api/enable_proxy_headers_parsing': value => $enable_proxy_headers_parsing; 134 | } 135 | 136 | oslo::middleware { 'gnocchi_config': 137 | max_request_body_size => $max_request_body_size, 138 | } 139 | 140 | if $auth_strategy == 'keystone' { 141 | include gnocchi::keystone::authtoken 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /manifests/client.pp: -------------------------------------------------------------------------------- 1 | # 2 | # Installs the gnocchi python library. 3 | # 4 | # == parameters 5 | # [*ensure*] 6 | # ensure state for package. 7 | # 8 | class gnocchi::client ( 9 | $ensure = 'present' 10 | ) { 11 | 12 | include gnocchi::deps 13 | include gnocchi::params 14 | 15 | package { 'python-gnocchiclient': 16 | ensure => $ensure, 17 | name => $::gnocchi::params::client_package_name, 18 | tag => 'openstack', 19 | } 20 | 21 | include openstacklib::openstackclient 22 | 23 | } 24 | 25 | -------------------------------------------------------------------------------- /manifests/config.pp: -------------------------------------------------------------------------------- 1 | # == Class: gnocchi::config 2 | # 3 | # This class is used to manage arbitrary gnocchi configurations. 4 | # 5 | # === Parameters 6 | # 7 | # [*gnocchi_config*] 8 | # (optional) Allow configuration of arbitrary gnocchi configurations. 9 | # The value is an hash of gnocchi_config resources. Example: 10 | # { 'DEFAULT/foo' => { value => 'fooValue'}, 11 | # 'DEFAULT/bar' => { value => 'barValue'} 12 | # } 13 | # In yaml format, Example: 14 | # gnocchi_config: 15 | # DEFAULT/foo: 16 | # value: fooValue 17 | # DEFAULT/bar: 18 | # value: barValue 19 | # 20 | # [*gnocchi_api_paste_ini*] 21 | # (optional) Allow configuration of /etc/gnocchi/api-paste.ini options. 22 | # 23 | # NOTE: The configuration MUST NOT be already handled by this module 24 | # or Puppet catalog compilation will fail with duplicate resources. 25 | # 26 | class gnocchi::config ( 27 | Hash $gnocchi_config = {}, 28 | Hash $gnocchi_api_paste_ini = {}, 29 | ) { 30 | 31 | include gnocchi::deps 32 | 33 | create_resources('gnocchi_config', $gnocchi_config) 34 | create_resources('gnocchi_api_paste_ini', $gnocchi_api_paste_ini) 35 | } 36 | -------------------------------------------------------------------------------- /manifests/cors.pp: -------------------------------------------------------------------------------- 1 | # == Class: gnocchi::cors 2 | # 3 | # Configure the gnocchi cors 4 | # 5 | # === Parameters 6 | # 7 | # [*allowed_origin*] 8 | # (Optional) Indicate whether this resource may be shared with the domain 9 | # received in the requests "origin" header. 10 | # (string value) 11 | # Defaults to $facts['os_service_default']. 12 | # 13 | # [*allow_credentials*] 14 | # (Optional) Indicate that the actual request can include user credentials. 15 | # (boolean value) 16 | # Defaults to $facts['os_service_default']. 17 | # 18 | # [*expose_headers*] 19 | # (Optional) Indicate which headers are safe to expose to the API. 20 | # (list value) 21 | # Defaults to $facts['os_service_default']. 22 | # 23 | # [*max_age*] 24 | # (Optional) Maximum cache age of CORS preflight requests. 25 | # (integer value) 26 | # Defaults to $facts['os_service_default']. 27 | # 28 | # [*allow_methods*] 29 | # (Optional) Indicate which methods can be used during the actual request. 30 | # (list value) 31 | # Defaults to $facts['os_service_default']. 32 | # 33 | # [*allow_headers*] 34 | # (Optional) Indicate which header field names may be used during the actual 35 | # request. 36 | # (list value) 37 | # Defaults to $facts['os_service_default']. 38 | # 39 | class gnocchi::cors ( 40 | $allowed_origin = $facts['os_service_default'], 41 | $allow_credentials = $facts['os_service_default'], 42 | $expose_headers = $facts['os_service_default'], 43 | $max_age = $facts['os_service_default'], 44 | $allow_methods = $facts['os_service_default'], 45 | $allow_headers = $facts['os_service_default'], 46 | ) { 47 | 48 | include gnocchi::deps 49 | 50 | oslo::cors { 'gnocchi_config': 51 | allowed_origin => $allowed_origin, 52 | allow_credentials => $allow_credentials, 53 | expose_headers => $expose_headers, 54 | max_age => $max_age, 55 | allow_methods => $allow_methods, 56 | allow_headers => $allow_headers, 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /manifests/db.pp: -------------------------------------------------------------------------------- 1 | # == Class: gnocchi::db 2 | # 3 | # Configure the Gnocchi database 4 | # 5 | # === Parameters 6 | # 7 | # [*database_db_max_retries*] 8 | # (optional) Maximum retries in case of connection error or deadlock error 9 | # before error is raised. Set to -1 to specify an infinite retry count. 10 | # Defaults to $facts['os_service_default'] 11 | # 12 | # [*database_connection*] 13 | # Url used to connect to database. 14 | # (Optional) Defaults to 'sqlite:////var/lib/gnocchi/gnocchi.sqlite'. 15 | # 16 | # [*slave_connection*] 17 | # (optional) Connection url to connect to aodh slave database (read-only). 18 | # Defaults to $facts['os_service_default']. 19 | # 20 | # [*database_connection_recycle_time*] 21 | # Timeout when db connections should be reaped. 22 | # (Optional) Defaults to $facts['os_service_default']. 23 | # 24 | # [*database_max_pool_size*] 25 | # Maximum number of SQL connections to keep open in a pool. 26 | # (Optional) Defaults to $facts['os_service_default']. 27 | # 28 | # [*database_max_retries*] 29 | # Maximum number of database connection retries during startup. 30 | # Setting -1 implies an infinite retry count. 31 | # (Optional) Defaults to $facts['os_service_default']. 32 | # 33 | # [*database_retry_interval*] 34 | # Interval between retries of opening a database connection. 35 | # (Optional) Defaults to $facts['os_service_default']. 36 | # 37 | # [*database_max_overflow*] 38 | # If set, use this value for max_overflow with sqlalchemy. 39 | # (Optional) Defaults to $facts['os_service_default']. 40 | # 41 | # [*database_pool_timeout*] 42 | # (Optional) If set, use this value for pool_timeout with SQLAlchemy. 43 | # Defaults to $facts['os_service_default'] 44 | # 45 | # [*mysql_enable_ndb*] 46 | # (Optional) If True, transparently enables support for handling MySQL 47 | # Cluster (NDB). 48 | # Defaults to $facts['os_service_default'] 49 | # 50 | # [*package_ensure*] 51 | # (optional) The state of gnocchi packages 52 | # Defaults to 'present' 53 | # 54 | class gnocchi::db ( 55 | $database_db_max_retries = $facts['os_service_default'], 56 | Oslo::DBconn $database_connection = 'sqlite:////var/lib/gnocchi/gnocchi.sqlite', 57 | $slave_connection = $facts['os_service_default'], 58 | $database_connection_recycle_time = $facts['os_service_default'], 59 | $database_max_pool_size = $facts['os_service_default'], 60 | $database_max_retries = $facts['os_service_default'], 61 | $database_retry_interval = $facts['os_service_default'], 62 | $database_max_overflow = $facts['os_service_default'], 63 | $database_pool_timeout = $facts['os_service_default'], 64 | $mysql_enable_ndb = $facts['os_service_default'], 65 | $package_ensure = 'present', 66 | ) inherits gnocchi::params { 67 | 68 | include gnocchi::deps 69 | 70 | oslo::db { 'gnocchi_config': 71 | db_max_retries => $database_db_max_retries, 72 | slave_connection => $slave_connection, 73 | connection_recycle_time => $database_connection_recycle_time, 74 | max_pool_size => $database_max_pool_size, 75 | max_retries => $database_max_retries, 76 | retry_interval => $database_retry_interval, 77 | max_overflow => $database_max_overflow, 78 | pool_timeout => $database_pool_timeout, 79 | mysql_enable_ndb => $mysql_enable_ndb, 80 | manage_backend_package => false, 81 | manage_config => true, 82 | } 83 | 84 | # NOTE(tkajinam): Gnocchi does not use [database] connection but use 85 | # [indexer] url to obtain database connection url. So 86 | # database_connection is used separately only to determine 87 | # the required dependencies we should install. 88 | oslo::db { 'gnocchi_config_connection': 89 | config => 'gnocchi_config', 90 | connection => $database_connection, 91 | backend_package_ensure => $package_ensure, 92 | manage_backend_package => true, 93 | manage_config => false, 94 | } 95 | 96 | gnocchi_config { 97 | 'indexer/url': value => $database_connection, secret => true; 98 | } 99 | 100 | # all db settings should be applied and all packages should be installed 101 | # before dbsync starts 102 | Oslo::Db['gnocchi_config'] -> Anchor['gnocchi::dbsync::begin'] 103 | Oslo::Db['gnocchi_config_connection'] -> Anchor['gnocchi::dbsync::begin'] 104 | } 105 | -------------------------------------------------------------------------------- /manifests/db/mysql.pp: -------------------------------------------------------------------------------- 1 | # The gnocchi::db::mysql class implements mysql backend for gnocchi 2 | # 3 | # This class can be used to create tables, users and grant 4 | # privileges for a mysql gnocchi database. 5 | # 6 | # == Parameters 7 | # 8 | # [*password*] 9 | # (Required) Password to connect to the database. 10 | # 11 | # [*dbname*] 12 | # (Optional) Name of the database. 13 | # Defaults to 'gnocchi'. 14 | # 15 | # [*user*] 16 | # (Optional) User to connect to the database. 17 | # Defaults to 'gnocchi'. 18 | # 19 | # [*host*] 20 | # (Optional) The default source host user is allowed to connect from. 21 | # Defaults to '127.0.0.1' 22 | # 23 | # [*allowed_hosts*] 24 | # (Optional) Other hosts the user is allowed to connect from. 25 | # Defaults to 'undef'. 26 | # 27 | # [*charset*] 28 | # (Optional) The database charset. 29 | # Defaults to 'utf8' 30 | # 31 | # [*collate*] 32 | # (Optional) The database collate. 33 | # Only used with mysql modules >= 2.2. 34 | # Defaults to 'utf8_general_ci' 35 | # 36 | class gnocchi::db::mysql( 37 | String[1] $password, 38 | $dbname = 'gnocchi', 39 | $user = 'gnocchi', 40 | $host = '127.0.0.1', 41 | $charset = 'utf8', 42 | $collate = 'utf8_general_ci', 43 | $allowed_hosts = undef 44 | ) { 45 | 46 | include gnocchi::deps 47 | 48 | openstacklib::db::mysql { 'gnocchi': 49 | user => $user, 50 | password => $password, 51 | dbname => $dbname, 52 | host => $host, 53 | charset => $charset, 54 | collate => $collate, 55 | allowed_hosts => $allowed_hosts, 56 | } 57 | 58 | Anchor['gnocchi::db::begin'] 59 | ~> Class['gnocchi::db::mysql'] 60 | ~> Anchor['gnocchi::db::end'] 61 | 62 | } 63 | -------------------------------------------------------------------------------- /manifests/db/postgresql.pp: -------------------------------------------------------------------------------- 1 | # == Class: gnocchi::db::postgresql 2 | # 3 | # Class that configures postgresql for gnocchi 4 | # Requires the Puppetlabs postgresql module. 5 | # 6 | # === Parameters 7 | # 8 | # [*password*] 9 | # (Required) Password to connect to the database. 10 | # 11 | # [*dbname*] 12 | # (Optional) Name of the database. 13 | # Defaults to 'gnocchi'. 14 | # 15 | # [*user*] 16 | # (Optional) User to connect to the database. 17 | # Defaults to 'gnocchi'. 18 | # 19 | # [*encoding*] 20 | # (Optional) The charset to use for the database. 21 | # Default to undef. 22 | # 23 | # [*privileges*] 24 | # (Optional) Privileges given to the database user. 25 | # Default to 'ALL' 26 | # 27 | class gnocchi::db::postgresql( 28 | $password, 29 | $dbname = 'gnocchi', 30 | $user = 'gnocchi', 31 | $encoding = undef, 32 | $privileges = 'ALL', 33 | ) { 34 | 35 | include gnocchi::deps 36 | 37 | openstacklib::db::postgresql { 'gnocchi': 38 | password => $password, 39 | dbname => $dbname, 40 | user => $user, 41 | encoding => $encoding, 42 | privileges => $privileges, 43 | } 44 | 45 | Anchor['gnocchi::db::begin'] 46 | ~> Class['gnocchi::db::postgresql'] 47 | ~> Anchor['gnocchi::db::end'] 48 | 49 | } 50 | -------------------------------------------------------------------------------- /manifests/db/sync.pp: -------------------------------------------------------------------------------- 1 | # 2 | # Class to execute "gnocchi-dbsync" 3 | # 4 | # [*user*] 5 | # (Optional) User to run dbsync command. 6 | # Defaults to $::gnocchi::params::user 7 | # 8 | # [*extra_opts*] 9 | # (Optional) String of extra command line parameters to append 10 | # to the gnocchi-db-sync command. 11 | # Defaults to undef 12 | # 13 | # [*db_sync_timeout*] 14 | # (Optional) Timeout for the execution of the db_sync 15 | # Defaults to 300 16 | # 17 | class gnocchi::db::sync ( 18 | $user = $::gnocchi::params::user, 19 | $extra_opts = undef, 20 | $db_sync_timeout = 300, 21 | ) inherits gnocchi::params { 22 | 23 | include gnocchi::deps 24 | 25 | exec { 'gnocchi-db-sync': 26 | command => "gnocchi-upgrade ${extra_opts}", 27 | path => '/usr/bin', 28 | refreshonly => true, 29 | user => $user, 30 | try_sleep => 5, 31 | tries => 10, 32 | timeout => $db_sync_timeout, 33 | logoutput => on_failure, 34 | subscribe => [ 35 | Anchor['gnocchi::install::end'], 36 | Anchor['gnocchi::config::end'], 37 | Anchor['gnocchi::dbsync::begin'] 38 | ], 39 | notify => Anchor['gnocchi::dbsync::end'], 40 | tag => 'openstack-db', 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /manifests/deps.pp: -------------------------------------------------------------------------------- 1 | # == Class: gnocchi::deps 2 | # 3 | # Gnocchi anchors and dependency management 4 | # 5 | class gnocchi::deps { 6 | # Setup anchors for install, config and service phases of the module. These 7 | # anchors allow external modules to hook the begin and end of any of these 8 | # phases. Package or service management can also be replaced by ensuring the 9 | # package is absent or turning off service management and having the 10 | # replacement depend on the appropriate anchors. When applicable, end tags 11 | # should be notified so that subscribers can determine if installation, 12 | # config or service state changed and act on that if needed. 13 | anchor { 'gnocchi::install::begin': } 14 | -> Package<| tag == 'gnocchi-package'|> 15 | ~> anchor { 'gnocchi::install::end': } 16 | -> anchor { 'gnocchi::config::begin': } 17 | -> Gnocchi_config<||> 18 | ~> anchor { 'gnocchi::config::end': } 19 | -> anchor { 'gnocchi::db::begin': } 20 | -> anchor { 'gnocchi::db::end': } 21 | ~> anchor { 'gnocchi::dbsync::begin': } 22 | -> anchor { 'gnocchi::dbsync::end': } 23 | ~> anchor { 'gnocchi::service::begin': } 24 | ~> Service<| tag == 'gnocchi-service' |> 25 | ~> anchor { 'gnocchi::service::end': } 26 | 27 | Anchor['gnocchi::config::begin'] 28 | -> Gnocchi_api_paste_ini<||> 29 | -> Anchor['gnocchi::config::end'] 30 | 31 | Anchor['gnocchi::config::begin'] 32 | -> Gnocchi_api_uwsgi_config<||> 33 | -> Anchor['gnocchi::config::end'] 34 | 35 | # Installation or config changes will always restart services. 36 | Anchor['gnocchi::install::end'] ~> Anchor['gnocchi::service::begin'] 37 | Anchor['gnocchi::config::end'] ~> Anchor['gnocchi::service::begin'] 38 | } 39 | -------------------------------------------------------------------------------- /manifests/healthcheck.pp: -------------------------------------------------------------------------------- 1 | # == Class: gnocchi::healthcheck 2 | # 3 | # Configure oslo_middleware options in healthcheck section 4 | # 5 | # == Params 6 | # 7 | # [*detailed*] 8 | # (Optional) Show more detailed information as part of the response. 9 | # Defaults to $facts['os_service_default'] 10 | # 11 | # [*backends*] 12 | # (Optional) Additional backends that can perform health checks and report 13 | # that information back as part of a request. 14 | # Defaults to $facts['os_service_default'] 15 | # 16 | # [*allowed_source_ranges*] 17 | # (Optional) A list of network addresses to limit source ip allowed to access 18 | # healthcheck information. 19 | # Defaults to $facts['os_service_default'] 20 | # 21 | # [*ignore_proxied_requests*] 22 | # (Optional) Ignore requests with proxy headers 23 | # Defaults to $facts['os_service_default'] 24 | # 25 | # [*disable_by_file_path*] 26 | # (Optional) Check the presence of a file to determine if an application 27 | # is running on a port. 28 | # Defaults to $facts['os_service_default'] 29 | # 30 | # [*disable_by_file_paths*] 31 | # (Optional) Check the presence of a file to determine if an application 32 | # is running on a port. Expects a "port:path" list of strings. 33 | # Defaults to $facts['os_service_default'] 34 | # 35 | # [*enable_by_file_paths*] 36 | # (Optional) Check the presence of files. Used by EnableByFilesHealthcheck 37 | # plugin. 38 | # Defaults to $facts['os_service_default'] 39 | # 40 | class gnocchi::healthcheck ( 41 | $detailed = $facts['os_service_default'], 42 | $backends = $facts['os_service_default'], 43 | $allowed_source_ranges = $facts['os_service_default'], 44 | $ignore_proxied_requests = $facts['os_service_default'], 45 | $disable_by_file_path = $facts['os_service_default'], 46 | $disable_by_file_paths = $facts['os_service_default'], 47 | $enable_by_file_paths = $facts['os_service_default'], 48 | ) { 49 | 50 | include gnocchi::deps 51 | 52 | oslo::healthcheck { 'gnocchi_config': 53 | detailed => $detailed, 54 | backends => $backends, 55 | allowed_source_ranges => $allowed_source_ranges, 56 | ignore_proxied_requests => $ignore_proxied_requests, 57 | disable_by_file_path => $disable_by_file_path, 58 | disable_by_file_paths => $disable_by_file_paths, 59 | enable_by_file_paths => $enable_by_file_paths, 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /manifests/init.pp: -------------------------------------------------------------------------------- 1 | # == Class: gnocchi 2 | # 3 | # Full description of class gnocchi here. 4 | # 5 | # === Parameters 6 | # 7 | # [*package_ensure*] 8 | # (optional) The state of gnocchi packages 9 | # Defaults to 'present' 10 | # 11 | # [*coordination_url*] 12 | # (optional) The url to use for distributed group membership coordination. 13 | # Defaults to $facts['os_service_default']. 14 | # 15 | # [*purge_config*] 16 | # (optional) Whether to set only the specified config options 17 | # in the gnocchi config. 18 | # Defaults to false. 19 | # 20 | class gnocchi ( 21 | $package_ensure = 'present', 22 | $coordination_url = $facts['os_service_default'], 23 | Boolean $purge_config = false, 24 | ) inherits gnocchi::params { 25 | 26 | include gnocchi::deps 27 | 28 | package { 'gnocchi': 29 | ensure => $package_ensure, 30 | name => $::gnocchi::params::common_package_name, 31 | tag => ['openstack', 'gnocchi-package'], 32 | } 33 | 34 | resources { 'gnocchi_config': 35 | purge => $purge_config, 36 | } 37 | 38 | oslo::coordination{ 'gnocchi_config': 39 | backend_url => $coordination_url, 40 | manage_config => false, 41 | } 42 | gnocchi_config { 43 | 'DEFAULT/coordination_url' : value => $coordination_url, secret => true; 44 | } 45 | 46 | # all coordination settings should be applied and all packages should be 47 | # installed before service startup 48 | Oslo::Coordination['gnocchi_config'] -> Anchor['gnocchi::service::begin'] 49 | } 50 | -------------------------------------------------------------------------------- /manifests/keystone/auth.pp: -------------------------------------------------------------------------------- 1 | # == Class: gnocchi::keystone::auth 2 | # 3 | # Configures Gnocchi user, service and endpoint in Keystone. 4 | # 5 | # === Parameters 6 | # 7 | # [*password*] 8 | # (Required) Password for gnocchi user. 9 | # 10 | # [*auth_name*] 11 | # (Optional) Username for gnocchi service. 12 | # Defaults to 'gnocchi'. 13 | # 14 | # [*email*] 15 | # (Optional) Email for gnocchi user. 16 | # Defaults to 'gnocchi@localhost'. 17 | # 18 | # [*tenant*] 19 | # (Optional) Tenant for gnocchi user. 20 | # Defaults to 'services'. 21 | # 22 | # [*roles*] 23 | # (Optional) List of roles assigned to gnocchi user. 24 | # Defaults to ['admin'] 25 | # 26 | # [*system_scope*] 27 | # (Optional) Scope for system operations. 28 | # Defaults to 'all' 29 | # 30 | # [*system_roles*] 31 | # (Optional) List of system roles assigned to gnocchi user. 32 | # Defaults to [] 33 | # 34 | # [*configure_endpoint*] 35 | # (Optional) Should gnocchi endpoint be configured? 36 | # Defaults to true 37 | # 38 | # [*configure_user*] 39 | # (Optional) Should the service user be configured? 40 | # Defaults to true 41 | # 42 | # [*configure_user_role*] 43 | # (Optional) Should the admin role be configured for the service user? 44 | # Defaults to true 45 | # 46 | # [*configure_service*] 47 | # (Optional) Should the service be configurd? 48 | # Defaults to True 49 | # 50 | # [*service_type*] 51 | # (Optional) Type of service. 52 | # Defaults to 'metric'. 53 | # 54 | # [*service_name*] 55 | # (Optional) Name of the service. 56 | # Defaults to 'gnocchi' 57 | # 58 | # [*service_description*] 59 | # (Optional) Description for keystone service. 60 | # Defaults to 'Openstack Metric Service'. 61 | # 62 | # [*region*] 63 | # (Optional) Region for endpoint. 64 | # Defaults to 'RegionOne'. 65 | # 66 | # [*public_url*] 67 | # (Optional) The endpoint's public url. 68 | # This url should *not* contain any trailing '/'. 69 | # Defaults to 'http://127.0.0.1:8041' 70 | # 71 | # [*admin_url*] 72 | # (Optional) The endpoint's admin url. 73 | # This url should *not* contain any trailing '/'. 74 | # Defaults to 'http://127.0.0.1:8041' 75 | # 76 | # [*internal_url*] 77 | # (Optional) The endpoint's internal url. 78 | # This url should *not* contain any trailing '/'. 79 | # Defaults to 'http://127.0.0.1:8041' 80 | # 81 | class gnocchi::keystone::auth ( 82 | String[1] $password, 83 | String[1] $auth_name = 'gnocchi', 84 | String[1] $email = 'gnocchi@localhost', 85 | String[1] $tenant = 'services', 86 | Array[String[1]] $roles = ['admin'], 87 | String[1] $system_scope = 'all', 88 | Array[String[1]] $system_roles = [], 89 | Boolean $configure_endpoint = true, 90 | Boolean $configure_user = true, 91 | Boolean $configure_user_role = true, 92 | Boolean $configure_service = true, 93 | String[1] $service_name = 'gnocchi', 94 | String[1] $service_type = 'metric', 95 | String[1] $service_description = 'OpenStack Metric Service', 96 | String[1] $region = 'RegionOne', 97 | Keystone::PublicEndpointUrl $public_url = 'http://127.0.0.1:8041', 98 | Keystone::EndpointUrl $internal_url = 'http://127.0.0.1:8041', 99 | Keystone::EndpointUrl $admin_url = 'http://127.0.0.1:8041', 100 | ) { 101 | 102 | include gnocchi::deps 103 | 104 | Keystone::Resource::Service_identity['gnocchi'] -> Anchor['gnocchi::service::end'] 105 | 106 | keystone::resource::service_identity { 'gnocchi': 107 | configure_user => $configure_user, 108 | configure_user_role => $configure_user_role, 109 | configure_endpoint => $configure_endpoint, 110 | configure_service => $configure_service, 111 | service_name => $service_name, 112 | service_type => $service_type, 113 | service_description => $service_description, 114 | region => $region, 115 | auth_name => $auth_name, 116 | password => $password, 117 | email => $email, 118 | tenant => $tenant, 119 | roles => $roles, 120 | system_scope => $system_scope, 121 | system_roles => $system_roles, 122 | public_url => $public_url, 123 | internal_url => $internal_url, 124 | admin_url => $admin_url, 125 | } 126 | 127 | } 128 | -------------------------------------------------------------------------------- /manifests/logging.pp: -------------------------------------------------------------------------------- 1 | # Class gnocchi::logging 2 | # 3 | # gnocchi logging configuration 4 | # 5 | # == parameters 6 | # 7 | # [*debug*] 8 | # (Optional) Should the daemons log debug messages 9 | # Defaults to $facts['os_service_default'] 10 | # 11 | # [*use_syslog*] 12 | # (Optional) Use syslog for logging. 13 | # Defaults to $facts['os_service_default'] 14 | # 15 | # [*use_json*] 16 | # (Optional) Use json for logging. 17 | # Defaults to $facts['os_service_default'] 18 | # 19 | # [*use_journal*] 20 | # (Optional) Use journal for logging. 21 | # Defaults to $facts['os_service_default'] 22 | # 23 | # [*use_stderr*] 24 | # (Optional) Use stderr for logging 25 | # Defaults to $facts['os_service_default'] 26 | # 27 | # [*log_facility*] 28 | # (Optional) Syslog facility to receive log lines. 29 | # Defaults to $facts['os_service_default'] 30 | # 31 | # [*log_dir*] 32 | # (Optional) Directory where logs should be stored. 33 | # If set to boolean false or the $facts['os_service_default'], it will not log to 34 | # any directory. 35 | # Defaults to '/var/log/gnocchi' 36 | # 37 | # [*log_file*] 38 | # (Optional) File where logs should be stored. 39 | # Defaults to $facts['os_service_default'] 40 | # 41 | class gnocchi::logging( 42 | $use_syslog = $facts['os_service_default'], 43 | $use_json = $facts['os_service_default'], 44 | $use_journal = $facts['os_service_default'], 45 | $use_stderr = $facts['os_service_default'], 46 | $log_facility = $facts['os_service_default'], 47 | $log_dir = '/var/log/gnocchi', 48 | $log_file = $facts['os_service_default'], 49 | $debug = $facts['os_service_default'], 50 | ) { 51 | 52 | include gnocchi::deps 53 | 54 | oslo::log { 'gnocchi_config': 55 | debug => $debug, 56 | use_syslog => $use_syslog, 57 | use_json => $use_json, 58 | use_journal => $use_journal, 59 | use_stderr => $use_stderr, 60 | log_dir => $log_dir, 61 | log_file => $log_file, 62 | syslog_log_facility => $log_facility, 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /manifests/metricd.pp: -------------------------------------------------------------------------------- 1 | # Installs & configure the gnocchi metricd service 2 | # 3 | # == Parameters 4 | # 5 | # [*enabled*] 6 | # (optional) Should the service be enabled. 7 | # Defaults to true 8 | # 9 | # [*package_ensure*] 10 | # (optional) ensure state for package. 11 | # Defaults to 'present' 12 | # 13 | # [*workers*] 14 | # (optional) the number of workers. 15 | # Defaults to $facts['os_workers'] 16 | # 17 | # [*metric_processing_delay*] 18 | # (optional) Delay between processing metrics 19 | # Defaults to $facts['os_service_default']. 20 | # 21 | # [*greedy*] 22 | # (optional) Allow to bypass metric_processing_delay if metricd is noticed 23 | # that messages are ready to be processed. 24 | # Defaults to $facts['os_service_default']. 25 | # 26 | # [*metric_reporting_delay*] 27 | # (optional) How many seconds to wait between metric ingestion reporting. 28 | # Defaults to $facts['os_service_default']. 29 | # 30 | # [*metric_cleanup_delay*] 31 | # (optional) How many seconds to wait between cleaning of expired data. 32 | # Defaults to $facts['os_service_default']. 33 | # 34 | # [*processing_replicas*] 35 | # (optional) Number of workers tht share a task. 36 | # Defaults to $facts['os_service_default']. 37 | # 38 | # [*manage_service*] 39 | # (optional) Whether the service should be managed by Puppet. 40 | # Defaults to true. 41 | # 42 | class gnocchi::metricd ( 43 | Boolean $manage_service = true, 44 | Boolean $enabled = true, 45 | $workers = $facts['os_workers'], 46 | $metric_processing_delay = $facts['os_service_default'], 47 | $greedy = $facts['os_service_default'], 48 | $metric_reporting_delay = $facts['os_service_default'], 49 | $metric_cleanup_delay = $facts['os_service_default'], 50 | $processing_replicas = $facts['os_service_default'], 51 | $package_ensure = 'present', 52 | ) inherits gnocchi::params { 53 | 54 | include gnocchi::deps 55 | 56 | gnocchi_config { 57 | 'metricd/workers': value => $workers; 58 | 'metricd/metric_processing_delay': value => $metric_processing_delay; 59 | 'metricd/greedy': value => $greedy; 60 | 'metricd/metric_reporting_delay': value => $metric_reporting_delay; 61 | 'metricd/metric_cleanup_delay': value => $metric_cleanup_delay; 62 | 'metricd/processing_replicas': value => $processing_replicas; 63 | } 64 | 65 | package { 'gnocchi-metricd': 66 | ensure => $package_ensure, 67 | name => $::gnocchi::params::metricd_package_name, 68 | tag => ['openstack', 'gnocchi-package'], 69 | } 70 | 71 | if $manage_service { 72 | if $enabled { 73 | $service_ensure = 'running' 74 | } else { 75 | $service_ensure = 'stopped' 76 | } 77 | 78 | service { 'gnocchi-metricd': 79 | ensure => $service_ensure, 80 | name => $::gnocchi::params::metricd_service_name, 81 | enable => $enabled, 82 | hasstatus => true, 83 | hasrestart => true, 84 | tag => ['gnocchi-service', 'gnocchi-db-sync-service'], 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /manifests/params.pp: -------------------------------------------------------------------------------- 1 | # ==Class: gnocchi::params 2 | # 3 | # Parameters for puppet-gnocchi 4 | # 5 | class gnocchi::params { 6 | include openstacklib::defaults 7 | 8 | $client_package_name = 'python3-gnocchiclient' 9 | $rados_package_name = 'python3-rados' 10 | $common_package_name = 'gnocchi-common' 11 | $api_package_name = 'gnocchi-api' 12 | $api_service_name = 'gnocchi-api' 13 | $metricd_package_name = 'gnocchi-metricd' 14 | $metricd_service_name = 'gnocchi-metricd' 15 | $statsd_package_name = 'gnocchi-statsd' 16 | $statsd_service_name = 'gnocchi-statsd' 17 | $user = 'gnocchi' 18 | $group = 'gnocchi' 19 | $gnocchi_wsgi_script_source = '/usr/bin/gnocchi-api' 20 | $boto3_package_name = 'python3-boto3' 21 | 22 | case $facts['os']['family'] { 23 | 'RedHat': { 24 | $gnocchi_wsgi_script_path = '/var/www/cgi-bin/gnocchi' 25 | } 26 | 'Debian': { 27 | $gnocchi_wsgi_script_path = '/usr/lib/cgi-bin/gnocchi' 28 | } 29 | default: { 30 | fail("Unsupported osfamily: ${facts['os']['family']}") 31 | } 32 | 33 | } # Case $facts['os']['family'] 34 | } 35 | -------------------------------------------------------------------------------- /manifests/policy.pp: -------------------------------------------------------------------------------- 1 | # == Class: gnocchi::policy 2 | # 3 | # Configure the gnocchi policies 4 | # 5 | # === Parameters 6 | # 7 | # [*enforce_scope*] 8 | # (Optional) Whether or not to enforce scope when evaluating policies. 9 | # Defaults to $facts['os_service_default']. 10 | # 11 | # [*enforce_new_defaults*] 12 | # (Optional) Whether or not to use old deprecated defaults when evaluating 13 | # policies. 14 | # Defaults to $facts['os_service_default']. 15 | # 16 | # [*policies*] 17 | # (Optional) Set of policies to configure for gnocchi 18 | # Example : 19 | # { 20 | # 'gnocchi-context_is_admin' => { 21 | # 'key' => 'context_is_admin', 22 | # 'value' => 'true' 23 | # }, 24 | # 'gnocchi-default' => { 25 | # 'key' => 'default', 26 | # 'value' => 'rule:admin_or_owner' 27 | # } 28 | # } 29 | # Defaults to empty hash. 30 | # 31 | # [*policy_path*] 32 | # (Optional) Path to the gnocchi policy.yaml file 33 | # Defaults to /etc/gnocchi/policy.yaml 34 | # 35 | # [*policy_default_rule*] 36 | # (Optional) Default rule. Enforced when a requested rule is not found. 37 | # Defaults to $facts['os_service_default']. 38 | # 39 | # [*policy_dirs*] 40 | # (Optional) Path to the gnocchi policy folder 41 | # Defaults to $facts['os_service_default'] 42 | # 43 | # [*purge_config*] 44 | # (optional) Whether to set only the specified policy rules in the policy 45 | # file. 46 | # Defaults to false. 47 | # 48 | class gnocchi::policy ( 49 | $enforce_scope = $facts['os_service_default'], 50 | $enforce_new_defaults = $facts['os_service_default'], 51 | Hash $policies = {}, 52 | $policy_path = '/etc/gnocchi/policy.yaml', 53 | $policy_default_rule = $facts['os_service_default'], 54 | $policy_dirs = $facts['os_service_default'], 55 | Boolean $purge_config = false, 56 | ) { 57 | 58 | include gnocchi::deps 59 | include gnocchi::params 60 | 61 | $policy_parameters = { 62 | policies => $policies, 63 | policy_path => $policy_path, 64 | file_user => 'root', 65 | file_group => $::gnocchi::params::group, 66 | file_format => 'yaml', 67 | purge_config => $purge_config, 68 | } 69 | 70 | create_resources('openstacklib::policy', { $policy_path => $policy_parameters }) 71 | 72 | # policy config should occur in the config block also. 73 | Anchor['gnocchi::config::begin'] 74 | -> Openstacklib::Policy[$policy_path] 75 | -> Anchor['gnocchi::config::end'] 76 | 77 | oslo::policy { 'gnocchi_config': 78 | enforce_scope => $enforce_scope, 79 | enforce_new_defaults => $enforce_new_defaults, 80 | policy_file => $policy_path, 81 | policy_default_rule => $policy_default_rule, 82 | policy_dirs => $policy_dirs, 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /manifests/statsd.pp: -------------------------------------------------------------------------------- 1 | # Installs & configure the gnocchi statsd service 2 | # 3 | # == Parameters 4 | # 5 | # [*resource_id*] 6 | # (required) Resource UUID to use to identify statsd in Gnocchi. 7 | # 8 | # [*host*] 9 | # (optional) The listen IP for statsd. 10 | # Defaults to $facts['os_service_default'] 11 | # 12 | # [*port*] 13 | # (optional) The port for statsd. 14 | # Defaults to $facts['os_service_default']. 15 | # 16 | # [*flush_delay*] 17 | # (optional) Delay between flushes. 18 | # Defaults to $facts['os_service_default'] 19 | # 20 | # [*archive_policy_name*] 21 | # (optional) Archive policy name to use when creating metrics. 22 | # Defaults to $facts['os_service_default']. 23 | # 24 | # [*creator*] 25 | # (required) Creator value to use to identify statsd in Gnocchi. 26 | # Defaults to $facts['os_service_default']. 27 | # 28 | # [*enabled*] 29 | # (optional) Should the service be enabled. 30 | # Defaults to true 31 | # 32 | # [*package_ensure*] 33 | # (optional) ensure state for package. 34 | # Defaults to 'present' 35 | # 36 | # [*manage_service*] 37 | # (optional) Whether the service should be managed by Puppet. 38 | # Defaults to true. 39 | # 40 | class gnocchi::statsd ( 41 | $resource_id, 42 | $host = $facts['os_service_default'], 43 | $port = $facts['os_service_default'], 44 | $flush_delay = $facts['os_service_default'], 45 | $archive_policy_name = $facts['os_service_default'], 46 | $creator = $facts['os_service_default'], 47 | Boolean $manage_service = true, 48 | Boolean $enabled = true, 49 | $package_ensure = 'present', 50 | ) inherits gnocchi::params { 51 | 52 | include gnocchi::deps 53 | 54 | package { 'gnocchi-statsd': 55 | ensure => $package_ensure, 56 | name => $::gnocchi::params::statsd_package_name, 57 | tag => ['openstack', 'gnocchi-package'], 58 | } 59 | 60 | if $manage_service { 61 | if $enabled { 62 | $service_ensure = 'running' 63 | } else { 64 | $service_ensure = 'stopped' 65 | } 66 | 67 | service { 'gnocchi-statsd': 68 | ensure => $service_ensure, 69 | name => $::gnocchi::params::statsd_service_name, 70 | enable => $enabled, 71 | hasstatus => true, 72 | hasrestart => true, 73 | tag => ['gnocchi-service', 'gnocchi-db-sync-service'], 74 | } 75 | } 76 | 77 | gnocchi_config { 78 | 'statsd/resource_id' : value => $resource_id; 79 | 'statsd/host' : value => $host; 80 | 'statsd/port' : value => $port; 81 | 'statsd/flush_delay' : value => $flush_delay; 82 | 'statsd/archive_policy_name' : value => $archive_policy_name; 83 | 'statsd/creator' : value => $creator; 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /manifests/storage.pp: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | # gnocchi::storage 14 | # 15 | # Storage backend for Gnocchi 16 | # This class currently has no effect but is kept as a placeholder. 17 | # 18 | # == Parameters 19 | # 20 | class gnocchi::storage( 21 | ) { 22 | include gnocchi::deps 23 | } 24 | -------------------------------------------------------------------------------- /manifests/storage/ceph.pp: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015 eNovance SAS 3 | # 4 | # Author: Emilien Macchi 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # gnocchi::storage::ceph 19 | # 20 | # Ceph driver for Gnocchi 21 | # 22 | # == Parameters 23 | # 24 | # [*ceph_username*] 25 | # (required) Ceph username to use. 26 | # 27 | # [*ceph_keyring*] 28 | # (optional) Ceph keyring path. 29 | # Defaults to undef 30 | # 31 | # [*ceph_secret*] 32 | # (optional) Ceph secret. 33 | # Defaults to undef 34 | # 35 | # [*ceph_pool*] 36 | # (optional) Ceph pool name to use. 37 | # Defaults to 'gnocchi'. 38 | # 39 | # [*ceph_timeout*] 40 | # (optional) Ceph connection timeout in seconds. 41 | # Defaults to $facts['os_service_default'] 42 | # 43 | # [*ceph_conffile*] 44 | # (optional) Ceph configuration file. 45 | # Defaults to '/etc/ceph/ceph.conf'. 46 | # 47 | # [*manage_rados*] 48 | # (optional) Ensure state of the rados python package. 49 | # Defaults to true. 50 | # 51 | # [*package_ensure*] 52 | # (optional) ensure state for package. 53 | # Defaults to 'present' 54 | # 55 | class gnocchi::storage::ceph( 56 | $ceph_username, 57 | $ceph_keyring = undef, 58 | $ceph_secret = undef, 59 | $ceph_pool = 'gnocchi', 60 | $ceph_timeout = $facts['os_service_default'], 61 | $ceph_conffile = '/etc/ceph/ceph.conf', 62 | Boolean $manage_rados = true, 63 | $package_ensure = 'present', 64 | ) inherits gnocchi::params { 65 | 66 | include gnocchi::deps 67 | 68 | if (! $ceph_keyring and ! $ceph_secret) { 69 | fail('You need to specify either ceph_keyring or ceph_secret.') 70 | } 71 | 72 | $ceph_keyring_real = $ceph_keyring ? { 73 | undef => $facts['os_service_default'], 74 | default => $ceph_keyring 75 | } 76 | $ceph_secret_real = $ceph_secret ? { 77 | undef => $facts['os_service_default'], 78 | default => $ceph_secret 79 | } 80 | 81 | gnocchi_config { 82 | 'storage/driver': value => 'ceph'; 83 | 'storage/ceph_username': value => $ceph_username; 84 | 'storage/ceph_keyring': value => $ceph_keyring_real; 85 | 'storage/ceph_secret': value => $ceph_secret_real, secret => true; 86 | 'storage/ceph_pool': value => $ceph_pool; 87 | 'storage/ceph_timeout': value => $ceph_timeout; 88 | 'storage/ceph_conffile': value => $ceph_conffile; 89 | } 90 | 91 | if $manage_rados { 92 | ensure_packages('python-rados', { 93 | 'ensure' => $package_ensure, 94 | 'name' => $::gnocchi::params::rados_package_name, 95 | 'tag' => ['openstack','gnocchi-package'], 96 | }) 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /manifests/storage/file.pp: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2014 eNovance SAS 3 | # 4 | # Author: Emilien Macchi 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # gnocchi::storage::file 19 | # 20 | # File driver for Gnocchi 21 | # 22 | # == Parameters 23 | # 24 | # [*file_basepath*] 25 | # (optional) Path used to store gnocchi data files. 26 | # Defaults to '/var/lib/gnocchi'. 27 | # 28 | class gnocchi::storage::file( 29 | $file_basepath = '/var/lib/gnocchi', 30 | ) { 31 | 32 | include gnocchi::deps 33 | 34 | gnocchi_config { 35 | 'storage/driver': value => 'file'; 36 | 'storage/file_basepath': value => $file_basepath; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /manifests/storage/incoming/file.pp: -------------------------------------------------------------------------------- 1 | # 2 | # gnocchi::storage::incoming::file 3 | # 4 | # File incoming storage driver for Gnocchi 5 | # 6 | # == Parameters 7 | # 8 | # [*file_basepath*] 9 | # (optional) Path used to store gnocchi data files. 10 | # This parameter can be used only when gnocchi::storage::file is not used. 11 | # Defaults to $facts['os_service_default']. 12 | # 13 | class gnocchi::storage::incoming::file( 14 | $file_basepath = $facts['os_service_default'], 15 | ) { 16 | 17 | include gnocchi::deps 18 | 19 | gnocchi_config { 20 | 'incoming/driver': value => 'file'; 21 | 'incoming/file_basepath': value => $file_basepath; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /manifests/storage/incoming/redis.pp: -------------------------------------------------------------------------------- 1 | # 2 | # gnocchi::storage::incoming::redis 3 | # 4 | # Redis incoming storage driver for Gnocchi 5 | # 6 | # == Parameters 7 | # 8 | # [*redis_url*] 9 | # (optional) Redis url. 10 | # 11 | class gnocchi::storage::incoming::redis( 12 | $redis_url = undef, 13 | ) { 14 | 15 | include gnocchi::deps 16 | 17 | gnocchi_config { 18 | 'incoming/driver': value => 'redis'; 19 | 'incoming/redis_url': value => $redis_url, secret => true; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /manifests/storage/s3.pp: -------------------------------------------------------------------------------- 1 | # 2 | # gnocchi::storage::s3 3 | # 4 | # S3 driver for Gnocchi 5 | # 6 | # == Parameters 7 | # 8 | # [*s3_endpoint_url*] 9 | # (optional) 'S3 endpoint url. 10 | # Defaults to $facts['os_service_default'] 11 | # 12 | # [*s3_region_name*] 13 | # (optional) S3 Region name. 14 | # Defaults to $facts['os_service_default'] 15 | # 16 | # [*s3_access_key_id*] 17 | # (optional) S3 storage access key id. 18 | # Defaults to undef 19 | # 20 | # [*s3_secret_access_key*] 21 | # (optional) S3 storage secret access key. 22 | # Defaults to undef 23 | # 24 | # [*s3_bucket_prefix*] 25 | # (optional) S3 bucket prefix for gnocchi 26 | # Defaults to undef 27 | # 28 | # [*manage_boto3*] 29 | # (optional) Manage boto3 package. 30 | # Defaults to true 31 | # 32 | # [*package_ensure*] 33 | # (optional) The state of boto3 package. 34 | # Defaults to 'present' 35 | # 36 | class gnocchi::storage::s3( 37 | $s3_endpoint_url = $facts['os_service_default'], 38 | $s3_region_name = $facts['os_service_default'], 39 | $s3_access_key_id = undef, 40 | $s3_secret_access_key = undef, 41 | $s3_bucket_prefix = $facts['os_service_default'], 42 | Boolean $manage_boto3 = true, 43 | $package_ensure = 'present', 44 | ) { 45 | 46 | include gnocchi::deps 47 | include gnocchi::params 48 | 49 | if $manage_boto3 { 50 | ensure_packages('python-boto3', { 51 | 'ensure' => $package_ensure, 52 | 'name' => $::gnocchi::params::boto3_package_name, 53 | 'tag' => ['openstack','gnocchi-package'], 54 | }) 55 | } 56 | 57 | gnocchi_config { 58 | 'storage/driver': value => 's3'; 59 | 'storage/s3_endpoint_url': value => $s3_endpoint_url; 60 | 'storage/s3_region_name': value => $s3_region_name; 61 | 'storage/s3_access_key_id': value => $s3_access_key_id, secret => true; 62 | 'storage/s3_secret_access_key': value => $s3_secret_access_key, secret => true; 63 | 'storage/s3_bucket_prefix': value => $s3_bucket_prefix; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /manifests/storage/swift.pp: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2014 eNovance SAS 3 | # 4 | # Author: Emilien Macchi 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # gnocchi::storage::swift 19 | # 20 | # Swift driver for Gnocchi 21 | # 22 | # == Parameters 23 | # 24 | # [*swift_auth_version*] 25 | # (optional) 'Swift authentication version to user. 26 | # Defaults to $facts['os_service_default'] 27 | # 28 | # [*swift_authurl*] 29 | # (optional) Swift auth URL. 30 | # Defaults to $facts['os_service_default'] 31 | # 32 | # [*swift_user*] 33 | # (optional) Swift user. 34 | # Defaults to $facts['os_service_default'] 35 | # 36 | # [*swift_key*] 37 | # (optional) Swift key. 38 | # Defaults to $facts['os_service_default'] 39 | # 40 | # [*swift_project_name*] 41 | # (optional) Swift tenant name, only used if swift_auth_version is '2' or 42 | # '3'. 43 | # Defaults to $facts['os_service_default'] 44 | # 45 | # [*swift_user_domain_name*] 46 | # (optional) Swift user domain name. 47 | # Defaults to $facts['os_service_default'] 48 | # 49 | # [*swift_project_domain_name*] 50 | # (optional) Swift project domain name. 51 | # Defaults to $facts['os_service_default'] 52 | # 53 | # [*swift_region*] 54 | # (optional) Swift region. 55 | # Defaults to $facts['os_service_default'] 56 | # 57 | # [*swift_endpoint_type*] 58 | # (optional) Swift endpoint type. Defines the keystone endpoint type 59 | # (publicURL, internalURL or adminURL). 60 | # Defaults to $facts['os_service_default'] 61 | # 62 | # [*swift_service_type*] 63 | # (optional) A string giving the service type of the swift service to use. 64 | # Defaults to $facts['os_service_default'] 65 | # 66 | # [*swift_timeout*] 67 | # (optional) Connection timeout in seconds. 68 | # Defaults to $facts['os_service_default'] 69 | # 70 | # [*swift_container_prefix*] 71 | # (optional) Prefix to namespace metric containers. 72 | # Defaults to $facts['os_service_default'] 73 | # 74 | class gnocchi::storage::swift( 75 | $swift_auth_version = $facts['os_service_default'], 76 | $swift_authurl = $facts['os_service_default'], 77 | $swift_user = $facts['os_service_default'], 78 | $swift_key = $facts['os_service_default'], 79 | $swift_project_name = $facts['os_service_default'], 80 | $swift_user_domain_name = $facts['os_service_default'], 81 | $swift_project_domain_name = $facts['os_service_default'], 82 | $swift_region = $facts['os_service_default'], 83 | $swift_endpoint_type = $facts['os_service_default'], 84 | $swift_service_type = $facts['os_service_default'], 85 | $swift_timeout = $facts['os_service_default'], 86 | $swift_container_prefix = $facts['os_service_default'], 87 | ) { 88 | 89 | include gnocchi::deps 90 | 91 | gnocchi_config { 92 | 'storage/driver': value => 'swift'; 93 | 'storage/swift_user': value => $swift_user; 94 | 'storage/swift_key': value => $swift_key, secret => true; 95 | 'storage/swift_project_name': value => $swift_project_name; 96 | 'storage/swift_user_domain_name': value => $swift_user_domain_name; 97 | 'storage/swift_project_domain_name': value => $swift_project_domain_name; 98 | 'storage/swift_region': value => $swift_region; 99 | 'storage/swift_auth_version': value => $swift_auth_version; 100 | 'storage/swift_authurl': value => $swift_authurl; 101 | 'storage/swift_endpoint_type': value => $swift_endpoint_type; 102 | 'storage/swift_service_type': value => $swift_service_type; 103 | 'storage/swift_timeout': value => $swift_timeout; 104 | 'storage/swift_container_prefix': value => $swift_container_prefix; 105 | } 106 | 107 | } 108 | -------------------------------------------------------------------------------- /manifests/wsgi/apache.pp: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015 eNovance SAS 3 | # 4 | # Author: Emilien Macchi 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # Class to serve gnocchi API with apache mod_wsgi in place of gnocchi-api service. 19 | # 20 | # Serving gnocchi API from apache is the recommended way to go for production 21 | # because of limited performance for concurrent accesses when running eventlet. 22 | # 23 | # When using this class you should disable your gnocchi-api service. 24 | # 25 | # == Parameters 26 | # 27 | # [*servername*] 28 | # (Optional) The servername for the virtualhost. 29 | # Defaults to $facts['networking']['fqdn'] 30 | # 31 | # [*port*] 32 | # (Optional) The port. 33 | # Defaults to 8041 34 | # 35 | # [*bind_host*] 36 | # (Optional) The host/ip address Apache will listen on. 37 | # Defaults to undef (listen on all ip addresses). 38 | # 39 | # [*path*] 40 | # (Optional) The prefix for the endpoint. 41 | # Defaults to '/' 42 | # 43 | # [*ssl*] 44 | # (Optional) Use ssl ? (boolean) 45 | # Defaults to false 46 | # 47 | # [*workers*] 48 | # (Optional) Number of WSGI workers to spawn. 49 | # Defaults to $facts['os_workers'] 50 | # 51 | # [*priority*] 52 | # (Optional) The priority for the vhost. 53 | # Defaults to 10 54 | # 55 | # [*threads*] 56 | # (Optional) The number of threads for the vhost. 57 | # Defaults to 1 58 | # 59 | # [*wsgi_process_display_name*] 60 | # (Optional) Name of the WSGI process display-name. 61 | # Defaults to undef 62 | # 63 | # [*ssl_cert*] 64 | # [*ssl_key*] 65 | # [*ssl_chain*] 66 | # [*ssl_ca*] 67 | # [*ssl_crl_path*] 68 | # [*ssl_crl*] 69 | # [*ssl_certs_dir*] 70 | # (Optional) apache::vhost ssl parameters. 71 | # Default to apache::vhost 'ssl_*' defaults. 72 | # 73 | # [*access_log_file*] 74 | # (Optional) The log file name for the virtualhost. 75 | # Defaults to undef. 76 | # 77 | # [*access_log_pipe*] 78 | # (Optional) Specifies a pipe where Apache sends access logs for 79 | # the virtualhost. 80 | # Defaults to undef. 81 | # 82 | # [*access_log_syslog*] 83 | # (Optional) Sends the virtualhost access log messages to syslog. 84 | # Defaults to undef. 85 | # 86 | # [*access_log_format*] 87 | # (Optional) The log format for the virtualhost. 88 | # Defaults to undef. 89 | # 90 | # [*access_log_env_var*] 91 | # (Optional) Specifies that only requests with particular 92 | # environment variables be logged. 93 | # Defaults to undef. 94 | # 95 | # [*error_log_file*] 96 | # (Optional) The error log file name for the virtualhost. 97 | # Defaults to undef. 98 | # 99 | # [*error_log_pipe*] 100 | # (Optional) Specifies a pipe where Apache sends error logs for 101 | # the virtualhost. 102 | # Defaults to undef. 103 | # 104 | # [*error_log_syslog*] 105 | # (Optional) Sends the virtualhost error log messages to syslog. 106 | # Defaults to undef. 107 | # 108 | # [*custom_wsgi_process_options*] 109 | # (Optional) gives you the opportunity to add custom process options or to 110 | # overwrite the default options for the WSGI main process. 111 | # eg. to use a virtual python environment for the WSGI process 112 | # you could set it to: 113 | # { python-path => '/my/python/virtualenv' } 114 | # Defaults to {} 115 | # 116 | # [*headers*] 117 | # (Optional) Headers for the vhost. 118 | # Defaults to undef 119 | # 120 | # [*request_headers*] 121 | # (Optional) Modifies collected request headers in various ways. 122 | # Defaults to undef 123 | # 124 | # [*vhost_custom_fragment*] 125 | # (Optional) Passes a string of custom configuration 126 | # directives to be placed at the end of the vhost configuration. 127 | # Defaults to undef. 128 | # 129 | # == Dependencies 130 | # 131 | # requires Class['apache'] & Class['gnocchi'] 132 | # 133 | # == Examples 134 | # 135 | # include apache 136 | # 137 | # class { 'gnocchi::wsgi::apache': } 138 | # 139 | class gnocchi::wsgi::apache ( 140 | $servername = $facts['networking']['fqdn'], 141 | $port = 8041, 142 | $bind_host = undef, 143 | $path = '/', 144 | $ssl = false, 145 | $workers = $facts['os_workers'], 146 | $ssl_cert = undef, 147 | $ssl_key = undef, 148 | $ssl_chain = undef, 149 | $ssl_ca = undef, 150 | $ssl_crl_path = undef, 151 | $ssl_crl = undef, 152 | $ssl_certs_dir = undef, 153 | $wsgi_process_display_name = undef, 154 | $threads = 1, 155 | $priority = 10, 156 | $access_log_file = undef, 157 | $access_log_pipe = undef, 158 | $access_log_syslog = undef, 159 | $access_log_format = undef, 160 | $access_log_env_var = undef, 161 | $error_log_file = undef, 162 | $error_log_pipe = undef, 163 | $error_log_syslog = undef, 164 | $custom_wsgi_process_options = {}, 165 | $headers = undef, 166 | $request_headers = undef, 167 | $vhost_custom_fragment = undef, 168 | ) { 169 | 170 | include gnocchi::deps 171 | include gnocchi::params 172 | 173 | Anchor['gnocchi::install::end'] -> Class['apache'] 174 | 175 | openstacklib::wsgi::apache { 'gnocchi_wsgi': 176 | bind_host => $bind_host, 177 | bind_port => $port, 178 | group => $::gnocchi::params::group, 179 | path => $path, 180 | priority => $priority, 181 | servername => $servername, 182 | ssl => $ssl, 183 | ssl_ca => $ssl_ca, 184 | ssl_cert => $ssl_cert, 185 | ssl_certs_dir => $ssl_certs_dir, 186 | ssl_chain => $ssl_chain, 187 | ssl_crl => $ssl_crl, 188 | ssl_crl_path => $ssl_crl_path, 189 | ssl_key => $ssl_key, 190 | threads => $threads, 191 | user => $::gnocchi::params::user, 192 | vhost_custom_fragment => $vhost_custom_fragment, 193 | workers => $workers, 194 | wsgi_daemon_process => 'gnocchi', 195 | wsgi_process_display_name => $wsgi_process_display_name, 196 | wsgi_process_group => 'gnocchi', 197 | wsgi_script_dir => $::gnocchi::params::gnocchi_wsgi_script_path, 198 | wsgi_script_file => 'app', 199 | wsgi_script_source => $::gnocchi::params::gnocchi_wsgi_script_source, 200 | headers => $headers, 201 | request_headers => $request_headers, 202 | custom_wsgi_process_options => $custom_wsgi_process_options, 203 | access_log_file => $access_log_file, 204 | access_log_pipe => $access_log_pipe, 205 | access_log_syslog => $access_log_syslog, 206 | access_log_format => $access_log_format, 207 | access_log_env_var => $access_log_env_var, 208 | error_log_file => $error_log_file, 209 | error_log_pipe => $error_log_pipe, 210 | error_log_syslog => $error_log_syslog, 211 | } 212 | } 213 | -------------------------------------------------------------------------------- /manifests/wsgi/uwsgi.pp: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021 Thomas Goirand 3 | # 4 | # Author: Thomas Goirand 5 | # 6 | # == Class: gnocchi::wsgi::uwsgi 7 | # 8 | # Configure the UWSGI service for Gnocchi API. 9 | # 10 | # == Parameters 11 | # 12 | # [*processes*] 13 | # (Optional) Number of processes. 14 | # Defaults to $facts['os_workers']. 15 | # 16 | # [*threads*] 17 | # (Optional) Number of threads. 18 | # Defaults to 32. 19 | # 20 | # [*listen_queue_size*] 21 | # (Optional) Socket listen queue size. 22 | # Defaults to 100 23 | # 24 | class gnocchi::wsgi::uwsgi ( 25 | $processes = $facts['os_workers'], 26 | $threads = 32, 27 | $listen_queue_size = 100, 28 | ){ 29 | 30 | include gnocchi::deps 31 | 32 | if $facts['os']['name'] != 'Debian'{ 33 | warning('This class is only valid for Debian, as other operating systems are not using uwsgi by default.') 34 | } 35 | 36 | gnocchi_api_uwsgi_config { 37 | 'uwsgi/processes': value => $processes; 38 | 'uwsgi/threads': value => $threads; 39 | 'uwsgi/listen': value => $listen_queue_size; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "OpenStack Contributors", 3 | "dependencies": [ 4 | { 5 | "name": "puppetlabs/inifile", 6 | "version_requirement": ">=2.0.0 <7.0.0" 7 | }, 8 | { 9 | "name": "openstack/keystone", 10 | "version_requirement": ">=26.0.0 <27.0.0" 11 | }, 12 | { 13 | "name": "puppetlabs/stdlib", 14 | "version_requirement": ">=5.0.0 <10.0.0" 15 | }, 16 | { 17 | "name": "openstack/openstacklib", 18 | "version_requirement": ">=26.0.0 <27.0.0" 19 | }, 20 | { 21 | "name": "openstack/oslo", 22 | "version_requirement": ">=26.0.0 <27.0.0" 23 | } 24 | ], 25 | "description": "Installs and configures OpenStack Gnocchi (Metric & index storage API).", 26 | "issues_url": "https://bugs.launchpad.net/puppet-gnocchi", 27 | "license": "Apache-2.0", 28 | "name": "openstack-gnocchi", 29 | "operatingsystem_support": [ 30 | { 31 | "operatingsystem": "Debian", 32 | "operatingsystemrelease": [ 33 | "12" 34 | ] 35 | }, 36 | { 37 | "operatingsystem": "RedHat", 38 | "operatingsystemrelease": [ 39 | "9" 40 | ] 41 | }, 42 | { 43 | "operatingsystem": "CentOS", 44 | "operatingsystemrelease": [ 45 | "9" 46 | ] 47 | }, 48 | { 49 | "operatingsystem": "Ubuntu", 50 | "operatingsystemrelease": [ 51 | "24.04" 52 | ] 53 | } 54 | ], 55 | "project_page": "https://launchpad.net/puppet-gnocchi", 56 | "requirements": [ 57 | { 58 | "name": "puppet", 59 | "version_requirement": ">= 7.0.0 < 9.0.0" 60 | } 61 | ], 62 | "source": "https://opendev.org/openstack/puppet-gnocchi.git", 63 | "summary": "Puppet module for OpenStack Gnocchi", 64 | "version": "26.0.0" 65 | } 66 | -------------------------------------------------------------------------------- /releasenotes/notes/Adds-enable-proxy-header-parsing-3f3da693df01b5ec.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - This adds the enable_proxy_headers parsing option which is used by the 4 | http_proxy_to_wsgi middleware. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/access_log_env_var-60037442d322f7e8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Add the ``access_log_env_var`` parameter to the ``gnocchi::wsgi::apache`` 5 | class to allow filtering logs (eg. suppress healthecks) 6 | -------------------------------------------------------------------------------- /releasenotes/notes/add-log_file-for-logging-b978d0ad122b36ed.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Add the log_file option for logging. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/add-metric-delay-c4b5db22171d9165.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - Expose metric processing delay param. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/add-metricd-processing-delay-76c234b0727f092a.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - | 4 | Expose metricd processing delay to be set in gnocchi config metricd section. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/add-middlewares-configuration-fdb6048123cc848f.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - add middlewares configuration to gnocchi.conf. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/add-openstackclient-client-ab8c46a274ff4349.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Add openstackclient installation to the client class. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/add-s3-driver-c73d167c81a8b33c.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - | 4 | Add gnocchi S3 storage driver 5 | -------------------------------------------------------------------------------- /releasenotes/notes/add-sync_db-to-gnocchi-db-class-d3fed198a27b15e0.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - Add a sync_db option to ::gnocchi::api class. This makes it easier 4 | to control the db sync. The sync_db param is a boolean and set to 5 | false by default for backward compatibility so db sync is not run 6 | out of the box. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/add-use_journal-option-for-logging-8c99500f64320163.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Adds the use_journal option for configuring oslo.log. This will enable 5 | passing the logs to journald. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/add_db_sync_timeout-8363be2e21ddc1e8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Adds db_sync_timeout parameter to db sync. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/add_watch_log_file-option-89d790e542d4d081.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::logging::watch_log_file`` parameter has been added. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/added_python_rados_package-0427154d398c9d75.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - The python-rados package is part of ceph jewel release and should replace the cradox package. 4 | - Ubuntu Xenial comes with ceph jewel release and the python-rados package resolves a missing dependency for ceph backends. 5 | deprecations: 6 | - The cradox package setting in gnocchi::storage::ceph has been deprecated. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/apache-headers-0091ba375bd625f6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The ``gnocchi::wsgi::apache`` class now supports customizing 5 | request/response headers added by apache. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/api-operation_timeout-909cae1732afee42.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The ``gnochi::api::operation_timeout`` parameter has been added. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/api-paste_config-590218f4261661c7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::api::paste_config`` parameter has been added. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/api_paste-b94e191896840944.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Add api_paste type/provider. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/api_paste_ini-separator-3e39be7a841c71ad.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``key_val_separator`` parameter has been added to 5 | the ``gnocchi_api_paste_ini`` resource type. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/authtoken-c0b1d26fc3156482.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Configure keystonemiddleware in a consistent way with all options required 4 | for Keystone v3. 5 | deprecations: 6 | - gnocchi::api::keystone_user is deprecated in favor of 7 | gnocchi::keystone::authtoken::username. 8 | - gnocchi::api::keystone_password is deprecated in favor of 9 | gnocchi::keystone::authtoken::password. 10 | - gnocchi::api::keystone_tenant is deprecated in favor of 11 | gnocchi::keystone::authtoken::project_name 12 | - gnocchi::api::keystone_identity_uri is deprecated in favor of 13 | gnocchi::keystone::authtoken::auth_url. 14 | - gnocchi::api::keystone_auth_uri is deprecated in favor of 15 | gnocchi::keystone::authtoken::auth_uri 16 | -------------------------------------------------------------------------------- /releasenotes/notes/authtoken_manage_memcache_package-a83630efd64e36a0.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Passes parameter to keystone authtoken define to manage python-memcache package install. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/centos-9-support-bde5553b64716c60.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Now this module supports CentOS 9 and Red Hat Enterprise Linux 9. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/ceph_secret-8e8fbccd416b0883.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Allow to configure ceph_secret parameter. 4 | This change makes ceph_keyring not required anymore 5 | but either ceph_secret or ceph_keyring have to be set. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/ceph_timeout-770ca9c5ff60a976.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::storage::ceph::ceph_timeout`` parameter has been added. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/client-04f70664e363425c.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Implement ::gnocchi::client. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/config-api-paste_ini-7ce01cbf1b62d666.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::config::gnocchi_api_paste_ini`` parameter has been 5 | added. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/configure_service-7f4d0478b7e74711.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::keystone::auth::configure_service`` parameter has been 5 | added. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/cradox-e10fb8c46ec2935a.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - When deploying Ceph storage backend, allow to automatically install python-cradox 4 | as a packaging dependency. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/db_upgrade-2eff712611fa34ba.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - Update db-sync command to use gnocchi-upgrade. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/default-metricd-to-safer-value-529c85e617105424.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - Default the metricd workers parameter to a safer 4 | value. Now defaulted to os_workers will configure 5 | this parameter to the maximum value between 6 | '(<# processors> / 4)' and '2' without exeeding '8' 7 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-api-middlewares-20287ca86b384799.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``gnocchi::api::middlewares`` parameter has been deprecated and will be 5 | removed in a future release. The parmaeter has no effect now. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-gnocchi-database_connection-65d47012e2bd0579.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The gnocchi::database_connection was deperecated. Use the 5 | gnocchi::db::database_connection parameter instead. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-oslo-log-params-12ed30a5db0e5baf.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - Deprecating some oslo.log options from logging class. Gnocchi is moving 4 | away from oslo.log to daiquri. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-storage-options-bff9a8cde960a8bc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | gnocchi::storage::coordination_url and gnocchi::storage::package_ensure 5 | were deprecated because coordination_url in storage seciton was deprecated 6 | in gnocchi. Use the parameters in gnocchi class. 7 | - | 8 | gnocchi::storage::metric_processing_dealy was deprecated because the 9 | corresponding parameter under storage section was deprecated in gnocchi. 10 | Use gnocchi::metricd::metric_processing_delay instead. 11 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-watch_log_file-f29924b2bcb809f1.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``gnocchi::logging::watch_log_file`` parameter has been deprecated. 5 | The parameter has no effect now. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate_auth_uri_parameter-91324d12d87e4618.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - auth_uri is deprecated and will be removed in a future release. 4 | Please use www_authenticate_uri instead. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate_ensure_package_parameter-8a3583e991345fd3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - gnocchi::ensure_package is now deprecated and will be removed in the 4 | future release. Please use gnocchi::package_ensure instead. 5 | - gnocchi::db::ensure_package is now deprecated and will be removed in the 6 | future release. Please use gnocchi::db::package_ensure instead. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate_pki_related_parameters-8d707b64e754d061.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - check_revocations_for_cached option is now deprecated for removal, the 4 | parameter has no effect. 5 | - hash_algorithms option is now deprecated for removal, the parameter 6 | has no effect. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate_revocation_cache_time_parameter-f2b545e59754e5ba.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - revocation_cache_time option is now deprecated for removal, the 4 | parameter has no effect. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate_signing_dir_parameter-6135a83f34551ef9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - signing_dir option is now deprecated for removal, the 4 | parameter has no effect. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate_statsd_options-87315a345ef19816.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - user_id and project_id options are now deprecated for removal. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecated-manage-cradox-6a4052d270c5180e.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The gnocchi::storage::ceph::manage_rados parameters default value is now 5 | true. 6 | deprecations: 7 | - | 8 | The gnocchi::storage::ceph::manage_cradox parameter is deprecated and has 9 | no effect. 10 | -------------------------------------------------------------------------------- /releasenotes/notes/disable-apache-ssl-c2c62907caa34749.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | Default value of the ``gnocchi::wsgi::apache::ssl`` parameter has been 5 | changed from ``true`` to ``false`` and now ssl is disabled by default. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/dont-include-logging-init-46f9d159f3456994.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | gnocchi::logging is now not included in init class by default. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/drop-fedora-2a73195edf824a0f.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | Fedora is no longer supported. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/drop-influxdb-classes-d2e4d3d02290ce9d.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - The classes to manage InfluxDB have been removed due to the fact that the 4 | InfluxDB support was dropped over a year ago. -------------------------------------------------------------------------------- /releasenotes/notes/drop_qpid-1774ee36bab4e8e9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | other: 3 | - Drop all Qpid support, it was removed from Oslo in Mitaka. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/external_install_mgmt_hook-6717235a692f234d.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | Add hooks for external install & svc management. 4 | features: 5 | - This adds defined anchor points for external modules to 6 | hook into the software install, config and service dependency 7 | chain. This allows external modules to manage software 8 | installation (virtualenv, containers, etc) and service management 9 | (pacemaker) without needing rely on resources that may change or 10 | be renamed. 11 | -------------------------------------------------------------------------------- /releasenotes/notes/file-incoming-driver-166fa94e9253781e.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::storage::incoming::file`` class has been added. This 5 | class can be used to set up the file incoming driver. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/fix-s3-and-install-boto3-49991c1b453c2168.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Install python-boto3 automatically in order to satisfy s3 storage backend 5 | package dependencies. This can be disabled by setting 6 | the ``gnocchi::storage::s3::manage_boto3`` parameter. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/gnocchi-api-deprecated-options-782e19fefaff5f5f.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - The Gnocchi API options host, port and workers are deprecated. These 4 | options have been removed in the Gnocchi project so they have no effect 5 | whatsoever. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/gnocchi-api-remove-deprecated-host-port-workers-8bbe2e5ddf6b7072.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The deprecated parameters glance::api::host, glance::api::port 5 | and glance::api::workers has been removed. 6 | - | 7 | The deprecated parameters glance::statsd::user_id and 8 | gnocchi::statsd::project_id has been removed. 9 | -------------------------------------------------------------------------------- /releasenotes/notes/hc-enable_by_file_paths-40231ad5bbc4ae0f.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::healthcheck::enable_by_file_paths`` parameter has been 5 | added. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/healthcheck-0465f924bd2f4dbe.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::healthcheck`` class has been added. This class manages 5 | parameters of healthcheck middlware in oslo.middleware. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/healthcheck-allowed_source_ranges-b1c11b198c0ad1b9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::healthcheck::allowed_source_ranges`` parameter has been 5 | added. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/healthcheck-ignore_proxied_requests-7922bce837a45541.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::healthcheck::ignore_proxied_requests`` parameter has 5 | been added. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/httpd-logs-piped-syslog-96f86098dbfb38cc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added parameters for advanced configuration of httpd access and error log 5 | destinations including piped logging and syslog (see `mod_syslog`). Note 6 | that mod_syslog requires Apache2 >= 2.5.0. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/influxdb-889413086f27c7e4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Add Influxdb as a backend storage. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/install-redis-ded395c27ee7dfc3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - Install redis when coordination is set in gnocchi storage. 4 | Otherwise metricd will go creazy and throw exceptions. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/keystone-auth-name-c23eaad41284ac43.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - The keystone auth class has been updated to provide a default service_name 4 | to allow a user to specify a custom auth_name that may not contain the 5 | name of the service. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/keystone-authtoken-interface-c06d43b518a9dd80.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::keystone::authtoken::interface`` parameter has been 5 | added, which can be used to set the interface parameter in authtoken 6 | middleware. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/keystone-authtoken-service_type-4a4662738bfc44c9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::keystone::authtoken::service_type`` parameter has been 5 | added to configure the service_type parameter in authtoken middleware. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/keystone_auth-557bfe055fd9101d.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Enable correct auth pipeline when keystone is enabled. 4 | Use gnocchi+auth in the main pipeline when we want to use keystone 5 | authentification. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/log-json-514a919eec6e2b8e.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Expose use_json logging parameter, which enables JSON formatted logging. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/max_request_body_size-99d457dd976374cc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Add support to configure `[oslo_middleware]/max_request_body_size` with 5 | `$max_request_body_size`. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/metricd-dd917b15aa827654.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Add metricd service support. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/metricd-opts-78c846cee9222e7d.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The following parameters have been added to the ``gnocchi::metricd`` class. 5 | 6 | - ``greedy`` 7 | - ``metric_reporting_delay`` 8 | - ``processing_replicas`` 9 | 10 | deprecations: 11 | - | 12 | The ``gnocchi::metricd::cleanup_delay`` parameter has been deprecated in 13 | favor of the new ``gnocchi::metricd::metric_cleanup_delay`` parameter. 14 | -------------------------------------------------------------------------------- /releasenotes/notes/metricd_workers-6fe3da8ec2927909.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Add parameter to configure metricd workers configuration. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/migrate-policy-format-from-json-to-yaml-790e4f7ef2d7e68c.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | Now policy.yaml is used by default instead of policy.json. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/openstack_db_tag-8b0893929fcd6617.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Add openstack-db tag to Exec that run db-sync. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/os_workers_for_worker_count-3517788058682645.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | other: 3 | - Parameters that control the number of spawned child processes for 4 | distributing processing have had their default value changed from 5 | ::processorcount to ::os_workers. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/oslo-db-options-1af29036e647d8c9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The ``gnocchi::db`` class now supports customizing oslo.db options. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/oslo_policy-enforce_scope-3cf4ea69a6f5a91f.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::policy::enforce_scope`` parameter has been added to 5 | support the corresponding parameter in oslo.policy library. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/policy-dirs-3a09b80e991f9745.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | There is now a new policy_dirs parameter in the gnocchi::policy class, 5 | so one can set a custom path. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/policy-enforce_new_defaults-f33654b6eb02c4f2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::policy::enforce_new_defaults`` parameter has been 5 | added. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/policy_default_rule-c2f38a50dc3f2636.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::policy::policy_default_rule`` parameter has been added. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/policy_purge_config-842778b72b5916f8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Adds new purge_config parameter. When set to true, the policy file is 5 | cleared during configuration process. This allows to remove any existing 6 | rules before applying them or clean the file when all policies got removed. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/prepare-to-change-apache-ssl-95eb9428664d7a5b.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | Default value of the ``gnocchi::wsgi::apache::ssl`` parameter will be 5 | changed from ``true`` to ``false`` in a future release. Make sure 6 | the parameter is set to the desired value. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/puppet-8-9f211baa0b2cbb0e.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | This module now officially supports Puppet 8. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/puppet4-mysql-func-4d364d08e159b230.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | This module now requires a puppetlabs-mysql version >= 6.0.0 5 | -------------------------------------------------------------------------------- /releasenotes/notes/pymysql-e57bf1f0289dd426.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Support of PyMySQL driver for MySQL backend. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/release-note-ubuntu-py3-4f70daa32cd6f04e.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | In this release Ubuntu has moved all projects that supported it to python3 4 | which means that there will be a lot of changes. The Puppet OpenStack project 5 | does not test the upgrade path from python2 to python3 packages so there might 6 | be manual steps required when moving to the python3 packages. 7 | upgrade: 8 | - | 9 | Ubuntu packages are now using python3, the upgrade path is not tested by 10 | Puppet OpenStack. Manual steps may be required when upgrading. 11 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-api-middleware-298f14aedeb92362.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The ``gnocchi::api::middleware`` parameter has been removed. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-api-paste-712235bf18a47855.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - Remove api-paste configuration as its now moved into the 4 | python code. There is no need to explicitly configure it. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-auth-uri-b751d103ac62f67d.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The deprecated parameter auth_uri is now removed, please use www_authenticate_uri. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-centos-8-7bc984364b2c1250.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | CentOS 8 Stream is no longer supported by this module. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-deprecated-db-init-62110da4e2d86881.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The deprecated gnocchi::database_connection parameter is removed. 5 | Use the gnocchi:db::database_connection parameter instead. 6 | - | 7 | Deployments now need to explicitly use the gnocchi::db class. -------------------------------------------------------------------------------- /releasenotes/notes/remove-manage-cradox-72d292874c5fb286.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The ``gnocchi::storage::ceph::manage_cradox`` parameter has been removed. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-metricd-cleanup_delay-7cfd91487f8d4c43.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The ``gnocchi::metricd::cleanup_delay`` parameter has been removed. Use 5 | the ``metric_cleanup_delay`` parameter instead. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-puppet-6-f6f8cef93b77dc20.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | Puppet 6 is no longer supported. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-storage-options-22a1f994f8713794.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The following parameters have been removed from the ``gnocchi::storage`` 5 | class. 6 | 7 | - ``package_ensure`` 8 | - ``coordination_url`` 9 | - ``metric_processing_delay`` 10 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-swift-auth_tenant_name-32010b83e506b70c.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The deprecated ``gnocchi::storage::swift::auth_tenant_name`` parameter has 5 | been removed. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-watch_log_file-2be7a59d3036fddb.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The ``gnocchi::logging::watch_log_file`` parameter has been removed. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/remove_deprecated_ensure_package_option-b6afaafe8e6bf9fd.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - Deprecated ensure_package option has been removed. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/remove_deprecated_keystone_revocation_cache_time_option-8a0d0250946f08bf.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - Deprecated keystone::authtoken::revocation_cache_time option has been removed. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/remove_deprecated_keystone_signing_dir_option-9910df26a9798db6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - Deprecated keystone authtoken signing_dir option is removed in Pike. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/remove_deprecated_logging_options-7601c56e6cc49f3c.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | other: 3 | - Remove deprecated logging options for ::gnocchi::logging class. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/remove_deprecated_pki_related_options-8d7fe0e0c58fc48e.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The deprecated pki related options check_revocations_for_cached and 5 | hash_algorithms option has been removed. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/remove_old_authtoken_options-2ea2763a69ea5f76.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | other: 3 | - removed deprecated gnocchi::api::keystone_user 4 | - removed deprecated gnocchi::api::keystone_password 5 | - removed deprecated gnocchi::api::keystone_tenant 6 | - removed deprecated gnocchi::api::keystone_auth_uri 7 | - removed deprecated gnocchi::api::keystone_identity_uri 8 | -------------------------------------------------------------------------------- /releasenotes/notes/remove_verbose-6f796fb4c2fde1e3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | other: 3 | - The verbose option was marked to be removed in Ocata, 4 | in Newton the option was deprecated. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/rspec-puppet-facts-ee600fc22f33e93f.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | other: 3 | - Switch spec tests to leverage rspec-puppet-facts 4 | -------------------------------------------------------------------------------- /releasenotes/notes/service_token_roles-9955b67a04160949.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Add support to configure service_token_roles in authtoken middleware. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/service_token_roles_required-a35dbab612e8d796.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Service_token_roles_required missing in the server config file which 4 | allows backwards compatibility to ensure that the service tokens are 5 | compared against a list of possible roles for validity. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/statsd-creator-4dd4b95ac66cef5a.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::statsd::creator`` parameter has been added. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/statsd-flush_delay-optional-e1aa6d8aac600191.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The ``gnocchi::statsd::flush_delay`` is now optional and defaults to 5 | ``$::os_service_default`` which effectively use the default value defined 6 | in Gnocchi itself. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/statsd-host-and-port-57b290e8dd57ed6f.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The ``gnocchi::statsd`` class now supports ``host`` and ``port``. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/storage-ceph-package_ensure-36b77ea422e5c628.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnoccho::storage::ceph::package_ensure`` parameter has been 5 | added. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/storage-swift-keystone-v3-params-e07787e87f7999fc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The following parameters were added to the ``gnocchi::storage::swift`` 5 | class to configure keystone region and domain used for access to Swift. 6 | 7 | - ``swift_region`` 8 | - ``swift_user_domain_name`` 9 | - ``swift_project_domain_name`` 10 | -------------------------------------------------------------------------------- /releasenotes/notes/storage-swift_project_name-5c00b6eea8e4b009.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``gnocchi::storage::swift::auth_tenant_name`` parameter was deprecated 5 | and will be remove in a future release. Use the ``auth_project_name`` 6 | parameter instead. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/swift-opts-57734ccd24e882f1.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The following two parameters have been added to ``swift::storage::swift`` 5 | 6 | - ``swift_service_type`` 7 | - ``swift_timeout`` 8 | -------------------------------------------------------------------------------- /releasenotes/notes/swift_container_prefix-ea1aaa526fbd2a54.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``gnocchi::storage::swift::swift_container_prefix`` prameter has 5 | been added. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/switch_to_oslo-3eef147d9c6214e8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Switch to puppet-oslo resource usage (instead of 4 | manual configuration file editing). 5 | -------------------------------------------------------------------------------- /releasenotes/notes/system_scope-keystone-dfb7566a1f8b1eab.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The ``system_scope`` parameter has been added to 5 | the ``gnocchi::keystone::authtoken`` class. 6 | 7 | - | 8 | The ``gnocchi::keystone::auth`` class now supports customizing roles 9 | assigned to the gnocchi service user. 10 | 11 | - | 12 | The ``gnocchi::keystone::auth`` class now supports defining assignmet of 13 | system-scoped roles to the gnocchi service user. 14 | -------------------------------------------------------------------------------- /releasenotes/notes/tune-workers-and-thread-defaults-8eaabb88ae5a7d79.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - gnocchi has been underperforming under apache wsgi. 4 | This fix tunes the workers and threads appropriately 5 | so we get better performance from apache. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/ubuntu-jammy-3786c2e486535113.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | This module now supports Ubuntu 22.04 (Jammy Jellyfish). 5 | 6 | upgrade: 7 | - | 8 | This module no longer supports Ubuntu 20.04 (Focal Fossa). 9 | -------------------------------------------------------------------------------- /releasenotes/notes/ubuntu-noble-f02beb5b1e030d06.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Ubuntu 24.04 is now formally supported. 5 | 6 | upgrade: 7 | - | 8 | Ubuntu 22.04 is no longer supported. 9 | -------------------------------------------------------------------------------- /releasenotes/notes/use-reno-1caaec4ba5aa4285.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Release notes are no longer maintained by hand, we now use the reno tool to 4 | manage them. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/uwsgi-55ad851a66baa5e9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | A new class gnocchi::wsgi::uwsgi exist to allow configuring uwsgi in 5 | operating systems that support this (ie: currently Debian). This helps 6 | configuring the number of processes, threads and listen socket. 7 | Also, a new gnocchi_api_wsgi_config provider now exist. 8 | -------------------------------------------------------------------------------- /releasenotes/notes/verbose-deprecation-586c044e066c05d9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - verbose option is now deprecated for removal, the 4 | parameter has no effect. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/wsgi_process_options-c96a71aca0c2e1e5.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Add parameter to wsgi::apache to allow overwrite 4 | and/or add additional wsgi process options. 5 | -------------------------------------------------------------------------------- /releasenotes/source/2023.1.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2023.1 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/2023.1 7 | -------------------------------------------------------------------------------- /releasenotes/source/2023.2.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2023.2 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2023.2 7 | -------------------------------------------------------------------------------- /releasenotes/source/2024.1.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2024.1 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2024.1 7 | -------------------------------------------------------------------------------- /releasenotes/source/2024.2.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2024.2 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2024.2 7 | -------------------------------------------------------------------------------- /releasenotes/source/2025.1.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2025.1 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2025.1 7 | -------------------------------------------------------------------------------- /releasenotes/source/_static/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/puppet-gnocchi/85aa4ecaade4371550fb13600fca5440b379b288/releasenotes/source/_static/.placeholder -------------------------------------------------------------------------------- /releasenotes/source/index.rst: -------------------------------------------------------------------------------- 1 | ======================================== 2 | Welcome to puppet-gnocchi Release Notes! 3 | ======================================== 4 | 5 | Contents 6 | ======== 7 | 8 | .. toctree:: 9 | :maxdepth: 2 10 | 11 | unreleased 12 | 2025.1 13 | 2024.2 14 | 2024.1 15 | 2023.2 16 | 2023.1 17 | zed 18 | yoga 19 | xena 20 | wallaby 21 | victoria 22 | ussuri 23 | train 24 | stein 25 | rocky 26 | queens 27 | pike 28 | ocata 29 | newton 30 | mitaka 31 | 32 | 33 | Indices and tables 34 | ================== 35 | 36 | * :ref:`genindex` 37 | * :ref:`search` 38 | -------------------------------------------------------------------------------- /releasenotes/source/mitaka.rst: -------------------------------------------------------------------------------- 1 | ============================ 2 | Mitaka Series Release Notes 3 | ============================ 4 | 5 | .. release-notes:: 6 | :branch: origin/stable/mitaka 7 | -------------------------------------------------------------------------------- /releasenotes/source/newton.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Newton Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: origin/stable/newton 7 | -------------------------------------------------------------------------------- /releasenotes/source/ocata.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Ocata Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: origin/stable/ocata 7 | -------------------------------------------------------------------------------- /releasenotes/source/pike.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Pike Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/pike 7 | -------------------------------------------------------------------------------- /releasenotes/source/queens.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Queens Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/queens 7 | -------------------------------------------------------------------------------- /releasenotes/source/rocky.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Rocky Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/rocky 7 | -------------------------------------------------------------------------------- /releasenotes/source/stein.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Stein Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/stein 7 | -------------------------------------------------------------------------------- /releasenotes/source/train.rst: -------------------------------------------------------------------------------- 1 | ========================== 2 | Train Series Release Notes 3 | ========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/train 7 | -------------------------------------------------------------------------------- /releasenotes/source/unreleased.rst: -------------------------------------------------------------------------------- 1 | ============================== 2 | Current Series Release Notes 3 | ============================== 4 | 5 | .. release-notes:: 6 | -------------------------------------------------------------------------------- /releasenotes/source/ussuri.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | Ussuri Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/ussuri 7 | -------------------------------------------------------------------------------- /releasenotes/source/victoria.rst: -------------------------------------------------------------------------------- 1 | ============================= 2 | Victoria Series Release Notes 3 | ============================= 4 | 5 | .. release-notes:: 6 | :branch: stable/victoria 7 | -------------------------------------------------------------------------------- /releasenotes/source/wallaby.rst: -------------------------------------------------------------------------------- 1 | ============================ 2 | Wallaby Series Release Notes 3 | ============================ 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/wallaby 7 | -------------------------------------------------------------------------------- /releasenotes/source/xena.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | Xena Series Release Notes 3 | ========================= 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/xena 7 | -------------------------------------------------------------------------------- /releasenotes/source/yoga.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | Yoga Series Release Notes 3 | ========================= 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/yoga 7 | -------------------------------------------------------------------------------- /releasenotes/source/zed.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | Zed Series Release Notes 3 | ======================== 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/zed 7 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = puppet-gnocchi 3 | summary = Puppet module for OpenStack Gnocchi 4 | description_file = 5 | README.md 6 | author = Puppet Labs and OpenStack Contributors 7 | author_email = openstack-discuss@lists.openstack.org 8 | home_page = https://docs.openstack.org/puppet-openstack-guide/latest 9 | license = Apache License, Version 2.0 10 | classifier = 11 | Intended Audience :: Developers 12 | Intended Audience :: Information Technology 13 | Intended Audience :: System Administrators 14 | License :: OSI Approved :: Apache Software License 15 | Operating System :: POSIX :: Linux 16 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain 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, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 | # implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | import setuptools 17 | 18 | setuptools.setup( 19 | setup_requires=['pbr>=2.0.0'], 20 | py_modules=[], 21 | pbr=True) 22 | -------------------------------------------------------------------------------- /spec/acceptance/10_basic_gnocchi_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper_acceptance' 2 | 3 | describe 'basic gnocchi' do 4 | 5 | context 'default parameters' do 6 | 7 | it 'should work with no errors' do 8 | pp = <<-EOS 9 | include openstack_integration 10 | include openstack_integration::repos 11 | include openstack_integration::apache 12 | include openstack_integration::mysql 13 | include openstack_integration::memcached 14 | include openstack_integration::redis 15 | include openstack_integration::keystone 16 | class { 'openstack_integration::gnocchi': 17 | backend => 'file' 18 | } 19 | EOS 20 | 21 | # Run it twice and test for idempotency 22 | apply_manifest(pp, :catch_failures => true) 23 | apply_manifest(pp, :catch_changes => true) 24 | end 25 | 26 | describe port(8041) do 27 | it { is_expected.to be_listening } 28 | end 29 | 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /spec/acceptance/99_gnocchi_config_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper_acceptance' 2 | 3 | describe 'basic gnocchi_config resource' do 4 | 5 | context 'default parameters' do 6 | 7 | it 'should work with no errors' do 8 | pp= <<-EOS 9 | Exec { logoutput => 'on_failure' } 10 | 11 | File <||> -> Gnocchi_config <||> 12 | File <||> -> Gnocchi_api_paste_ini <||> 13 | 14 | file { '/etc/gnocchi' : 15 | ensure => directory, 16 | } 17 | file { '/etc/gnocchi/gnocchi.conf' : 18 | ensure => file, 19 | } 20 | file { '/etc/gnocchi/api-paste.ini' : 21 | ensure => file, 22 | } 23 | 24 | gnocchi_config { 'DEFAULT/thisshouldexist' : 25 | value => 'foo', 26 | } 27 | 28 | gnocchi_config { 'DEFAULT/thisshouldnotexist' : 29 | value => '', 30 | } 31 | 32 | gnocchi_config { 'DEFAULT/thisshouldexist2' : 33 | value => '', 34 | ensure_absent_val => 'toto', 35 | } 36 | 37 | gnocchi_config { 'DEFAULT/thisshouldexist3' : 38 | value => ['foo', 'bar'], 39 | } 40 | 41 | gnocchi_config { 'DEFAULT/thisshouldnotexist2' : 42 | value => 'toto', 43 | ensure_absent_val => 'toto', 44 | } 45 | 46 | gnocchi_api_paste_ini { 'DEFAULT/thisshouldexist' : 47 | value => 'foo', 48 | } 49 | 50 | gnocchi_api_paste_ini { 'DEFAULT/thisshouldnotexist' : 51 | value => '', 52 | } 53 | 54 | gnocchi_api_paste_ini { 'DEFAULT/thisshouldexist2' : 55 | value => '', 56 | ensure_absent_val => 'toto', 57 | } 58 | 59 | gnocchi_api_paste_ini { 'DEFAULT/thisshouldnotexist2' : 60 | value => 'toto', 61 | ensure_absent_val => 'toto', 62 | } 63 | 64 | gnocchi_api_paste_ini { 'DEFAULT/thisshouldexist3' : 65 | value => 'foo', 66 | key_val_separator => ':' 67 | } 68 | EOS 69 | 70 | 71 | # Run it twice and test for idempotency 72 | apply_manifest(pp, :catch_failures => true) 73 | apply_manifest(pp, :catch_changes => true) 74 | end 75 | 76 | describe file('/etc/gnocchi/gnocchi.conf') do 77 | it { is_expected.to exist } 78 | it { is_expected.to contain('thisshouldexist=foo') } 79 | it { is_expected.to contain('thisshouldexist2=') } 80 | it { is_expected.to contain('thisshouldexist3=foo') } 81 | it { is_expected.to contain('thisshouldexist3=bar') } 82 | 83 | describe '#content' do 84 | subject { super().content } 85 | it { is_expected.to_not match /thisshouldnotexist/ } 86 | end 87 | end 88 | 89 | describe file('/etc/gnocchi/api-paste.ini') do 90 | it { is_expected.to exist } 91 | it { is_expected.to contain('thisshouldexist=foo') } 92 | it { is_expected.to contain('thisshouldexist2=') } 93 | it { is_expected.to contain('thisshouldexist3:foo') } 94 | 95 | describe '#content' do 96 | subject { super().content } 97 | it { is_expected.to_not match /thisshouldnotexist/ } 98 | end 99 | end 100 | end 101 | end 102 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_api_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi::api' do 4 | 5 | let :pre_condition do 6 | "class { 'gnocchi': } 7 | include gnocchi::db 8 | class { 'gnocchi::keystone::authtoken': 9 | password => 'gnocchi-passw0rd', 10 | }" 11 | end 12 | 13 | let :params do 14 | { :enabled => true, 15 | :manage_service => true, 16 | :package_ensure => 'latest', 17 | } 18 | end 19 | 20 | shared_examples_for 'gnocchi-api wsgi' do 21 | context 'with gnocchi-api in wsgi' do 22 | before do 23 | params.merge!({ :service_name => 'httpd' }) 24 | end 25 | 26 | let :pre_condition do 27 | "include apache 28 | include gnocchi::db 29 | class { 'gnocchi': } 30 | class { 'gnocchi::keystone::authtoken': 31 | password => 'gnocchi-passw0rd', 32 | }" 33 | end 34 | 35 | it 'installs gnocchi-api package' do 36 | is_expected.to contain_package('gnocchi-api').with( 37 | :ensure => 'latest', 38 | :name => platform_params[:api_package_name], 39 | :tag => ['openstack', 'gnocchi-package'], 40 | ) 41 | end 42 | end 43 | end 44 | 45 | shared_examples_for 'gnocchi-api' do 46 | 47 | it { is_expected.to contain_class('gnocchi::deps') } 48 | it { is_expected.to contain_class('gnocchi::params') } 49 | it { is_expected.to contain_class('gnocchi::policy') } 50 | 51 | it 'installs gnocchi-api package' do 52 | is_expected.to contain_package('gnocchi-api').with( 53 | :ensure => 'latest', 54 | :name => platform_params[:api_package_name], 55 | :tag => ['openstack', 'gnocchi-package'], 56 | ) 57 | end 58 | 59 | it 'configures gnocchi-api' do 60 | is_expected.to contain_gnocchi_config('api/max_limit').with_value('') 61 | is_expected.to contain_gnocchi_config('api/auth_mode').with_value('keystone') 62 | is_expected.to contain_gnocchi_config('api/paste_config').with_value('') 63 | is_expected.to contain_gnocchi_config('api/operation_timeout').with_value('') 64 | is_expected.to contain_gnocchi_config('api/enable_proxy_headers_parsing').with_value('') 65 | is_expected.to contain_oslo__middleware('gnocchi_config').with( 66 | :max_request_body_size => '', 67 | ) 68 | end 69 | 70 | [{:enabled => true}, {:enabled => false}].each do |param_hash| 71 | context "when service should be #{param_hash[:enabled] ? 'enabled' : 'disabled'}" do 72 | before do 73 | params.merge!(param_hash) 74 | end 75 | 76 | it 'configures gnocchi-api service' do 77 | is_expected.to contain_service('gnocchi-api').with( 78 | :ensure => params[:enabled] ? 'running' : 'stopped', 79 | :name => platform_params[:api_service_name], 80 | :enable => params[:enabled], 81 | :hasstatus => true, 82 | :hasrestart => true, 83 | :tag => ['gnocchi-service', 'gnocchi-db-sync-service'], 84 | ) 85 | end 86 | it { is_expected.to contain_service('gnocchi-api').that_subscribes_to('Anchor[gnocchi::service::begin]')} 87 | it { is_expected.to contain_service('gnocchi-api').that_notifies('Anchor[gnocchi::service::end]')} 88 | end 89 | end 90 | 91 | context 'with sync_db set to true' do 92 | before do 93 | params.merge!({ 94 | :sync_db => true}) 95 | end 96 | it { is_expected.to contain_class('gnocchi::db::sync') } 97 | end 98 | 99 | context 'with disabled service managing' do 100 | before do 101 | params.merge!({ 102 | :manage_service => false 103 | }) 104 | end 105 | 106 | it 'does not configure gnocchi-api service' do 107 | is_expected.to_not contain_service('gnocchi-api') 108 | end 109 | end 110 | 111 | context 'when running gnocchi-api in wsgi' do 112 | before do 113 | params.merge!({ :service_name => 'httpd' }) 114 | end 115 | 116 | let :pre_condition do 117 | "include apache 118 | include gnocchi::db 119 | class { 'gnocchi': } 120 | class { 'gnocchi::keystone::authtoken': 121 | password => 'gnocchi-passw0rd', 122 | }" 123 | end 124 | 125 | it 'configures gnocchi-api service with Apache' do 126 | is_expected.to contain_service('gnocchi-api').with( 127 | :ensure => 'stopped', 128 | :name => platform_params[:api_service_name], 129 | :enable => false, 130 | :tag => ['gnocchi-service', 'gnocchi-db-sync-service'], 131 | ) 132 | end 133 | end 134 | 135 | context 'when service_name is not valid' do 136 | before do 137 | params.merge!({ :service_name => 'foobar' }) 138 | end 139 | 140 | let :pre_condition do 141 | "include apache 142 | include gnocchi::db 143 | class { 'gnocchi': } 144 | class { 'gnocchi::keystone::authtoken': 145 | password => 'gnocchi-passw0rd', 146 | }" 147 | end 148 | 149 | it_raises 'a Puppet::Error', /Invalid service_name/ 150 | end 151 | 152 | context 'with max_limit' do 153 | before do 154 | params.merge!({:max_limit => 1000 }) 155 | end 156 | 157 | it { is_expected.to contain_gnocchi_config('api/max_limit').with_value(1000) } 158 | end 159 | 160 | context 'with paste_config' do 161 | before do 162 | params.merge!({:paste_config => 'api-paste.ini' }) 163 | end 164 | 165 | it { is_expected.to contain_gnocchi_config('api/paste_config').with_value('api-paste.ini') } 166 | end 167 | 168 | context 'with operation_timeout' do 169 | before do 170 | params.merge!({:operation_timeout => 10 }) 171 | end 172 | 173 | it { is_expected.to contain_gnocchi_config('api/operation_timeout').with_value(10) } 174 | end 175 | 176 | context 'with enable_proxy_headers_parsing' do 177 | before do 178 | params.merge!({:enable_proxy_headers_parsing => true }) 179 | end 180 | 181 | it { is_expected.to contain_gnocchi_config('api/enable_proxy_headers_parsing').with_value(true) } 182 | end 183 | 184 | context 'with max_request_body_size' do 185 | before do 186 | params.merge!({:max_request_body_size => '102400' }) 187 | end 188 | 189 | it { is_expected.to contain_oslo__middleware('gnocchi_config').with( 190 | :max_request_body_size => '102400', 191 | )} 192 | end 193 | 194 | end 195 | 196 | on_supported_os({ 197 | :supported_os => OSDefaults.get_supported_os 198 | }).each do |os,facts| 199 | context "on #{os}" do 200 | let (:facts) do 201 | facts.merge!(OSDefaults.get_facts()) 202 | end 203 | 204 | let(:platform_params) do 205 | case facts[:os]['family'] 206 | when 'Debian' 207 | package_name = 'gnocchi-api' 208 | when 'RedHat' 209 | package_name = 'gnocchi-api' 210 | end 211 | { :api_package_name => package_name, 212 | :api_service_name => 'gnocchi-api' } 213 | end 214 | 215 | it_behaves_like 'gnocchi-api wsgi' 216 | it_behaves_like 'gnocchi-api' 217 | end 218 | end 219 | 220 | end 221 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_client_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi::client' do 4 | shared_examples 'gnocchi::client' do 5 | it { is_expected.to contain_class('gnocchi::deps') } 6 | it { is_expected.to contain_class('gnocchi::params') } 7 | 8 | it { should contain_package('python-gnocchiclient').with( 9 | :ensure => 'present', 10 | :name => platform_params[:client_package_name], 11 | :tag => 'openstack', 12 | )} 13 | 14 | it { is_expected.to contain_class('openstacklib::openstackclient') } 15 | end 16 | 17 | on_supported_os({ 18 | :supported_os => OSDefaults.get_supported_os 19 | }).each do |os,facts| 20 | context "on #{os}" do 21 | let (:facts) do 22 | facts.merge!(OSDefaults.get_facts()) 23 | end 24 | 25 | let(:platform_params) do 26 | case facts[:os]['family'] 27 | when 'Debian' 28 | { :client_package_name => 'python3-gnocchiclient' } 29 | when 'RedHat' 30 | { :client_package_name => 'python3-gnocchiclient' } 31 | end 32 | end 33 | 34 | it_behaves_like 'gnocchi::client' 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_config_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi::config' do 4 | 5 | let :params do 6 | { :gnocchi_config => { 7 | 'DEFAULT/foo' => { 'value' => 'fooValue' }, 8 | 'DEFAULT/bar' => { 'value' => 'barValue' }, 9 | 'DEFAULT/baz' => { 'ensure' => 'absent' } 10 | }, 11 | } 12 | end 13 | 14 | shared_examples_for 'gnocchi-config' do 15 | it { is_expected.to contain_class('gnocchi::deps') } 16 | 17 | it 'configures arbitrary gnocchi configurations' do 18 | is_expected.to contain_gnocchi_config('DEFAULT/foo').with_value('fooValue') 19 | is_expected.to contain_gnocchi_config('DEFAULT/bar').with_value('barValue') 20 | is_expected.to contain_gnocchi_config('DEFAULT/baz').with_ensure('absent') 21 | end 22 | 23 | end 24 | 25 | on_supported_os({ 26 | :supported_os => OSDefaults.get_supported_os 27 | }).each do |os,facts| 28 | context "on #{os}" do 29 | let (:facts) do 30 | facts.merge!(OSDefaults.get_facts()) 31 | end 32 | 33 | it_behaves_like 'gnocchi-config' 34 | end 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_cors_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi::cors' do 4 | 5 | shared_examples_for 'gnocchi::cors' do 6 | it 'configure cors default params' do 7 | is_expected.to contain_oslo__cors('gnocchi_config').with( 8 | :allowed_origin => '', 9 | :allow_credentials => '', 10 | :expose_headers => '', 11 | :max_age => '', 12 | :allow_methods => '', 13 | :allow_headers => '', 14 | ) 15 | end 16 | 17 | context 'with specific parameters' do 18 | let :params do 19 | { :allowed_origin => '*', 20 | :allow_credentials => true, 21 | :expose_headers => 'Content-Language,Expires', 22 | :max_age => 3600, 23 | :allow_methods => 'GET,POST,PUT,DELETE,OPTIONS', 24 | :allow_headers => 'Content-Type,Cache-Control', 25 | } 26 | end 27 | 28 | it 'configure cors params' do 29 | is_expected.to contain_oslo__cors('gnocchi_config').with( 30 | :allowed_origin => '*', 31 | :allow_credentials => true, 32 | :expose_headers => 'Content-Language,Expires', 33 | :max_age => 3600, 34 | :allow_methods => 'GET,POST,PUT,DELETE,OPTIONS', 35 | :allow_headers => 'Content-Type,Cache-Control', 36 | ) 37 | end 38 | end 39 | end 40 | 41 | on_supported_os({ 42 | :supported_os => OSDefaults.get_supported_os 43 | }).each do |os,facts| 44 | context "on #{os}" do 45 | let (:facts) do 46 | facts.merge!(OSDefaults.get_facts()) 47 | end 48 | 49 | it_behaves_like 'gnocchi::cors' 50 | end 51 | end 52 | 53 | end 54 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_db_mysql_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi::db::mysql' do 4 | shared_examples_for 'gnocchi::db::mysql' do 5 | let :pre_condition do 6 | 'include mysql::server' 7 | end 8 | 9 | describe "with default params" do 10 | let :params do 11 | { 12 | :password => 'gnocchipass1', 13 | } 14 | end 15 | 16 | it { is_expected.to contain_class('gnocchi::deps') } 17 | 18 | it { is_expected.to contain_openstacklib__db__mysql('gnocchi').with( 19 | :password => 'gnocchipass1', 20 | :charset => 'utf8', 21 | :collate => 'utf8_general_ci', 22 | )} 23 | 24 | end 25 | 26 | describe "overriding default params" do 27 | let :params do 28 | { 29 | :password => 'gnocchipass2', 30 | :dbname => 'gnocchidb2', 31 | :charset => 'utf8', 32 | } 33 | end 34 | 35 | it { is_expected.to contain_openstacklib__db__mysql('gnocchi').with( 36 | :password => 'gnocchipass2', 37 | :dbname => 'gnocchidb2', 38 | :charset => 'utf8' 39 | )} 40 | 41 | end 42 | 43 | describe "overriding allowed_hosts param to array" do 44 | let :params do 45 | { 46 | :password => 'gnocchipass2', 47 | :dbname => 'gnocchidb2', 48 | :allowed_hosts => ['127.0.0.1','%'] 49 | } 50 | end 51 | 52 | it { is_expected.to contain_openstacklib__db__mysql('gnocchi').with( 53 | :password => 'gnocchipass2', 54 | :dbname => 'gnocchidb2', 55 | :allowed_hosts => ['127.0.0.1','%'] 56 | )} 57 | 58 | end 59 | 60 | describe "overriding allowed_hosts param to string" do 61 | let :params do 62 | { 63 | :password => 'gnocchipass2', 64 | :dbname => 'gnocchidb2', 65 | :allowed_hosts => '192.168.1.1' 66 | } 67 | end 68 | 69 | it { is_expected.to contain_openstacklib__db__mysql('gnocchi').with( 70 | :password => 'gnocchipass2', 71 | :dbname => 'gnocchidb2', 72 | :allowed_hosts => '192.168.1.1' 73 | )} 74 | end 75 | 76 | describe "overriding allowed_hosts param equals to host param " do 77 | let :params do 78 | { 79 | :password => 'gnocchipass2', 80 | :dbname => 'gnocchidb2', 81 | :allowed_hosts => '127.0.0.1' 82 | } 83 | end 84 | 85 | it { is_expected.to contain_openstacklib__db__mysql('gnocchi').with( 86 | :password => 'gnocchipass2', 87 | :dbname => 'gnocchidb2', 88 | :allowed_hosts => '127.0.0.1' 89 | )} 90 | end 91 | end 92 | 93 | on_supported_os({ 94 | :supported_os => OSDefaults.get_supported_os 95 | }).each do |os,facts| 96 | context "on #{os}" do 97 | let (:facts) do 98 | facts.merge!(OSDefaults.get_facts()) 99 | end 100 | 101 | it_configures 'gnocchi::db::mysql' 102 | end 103 | end 104 | end 105 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_db_postgresql_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi::db::postgresql' do 4 | 5 | shared_examples_for 'gnocchi::db::postgresql' do 6 | let :req_params do 7 | { :password => 'gnocchipass' } 8 | end 9 | 10 | let :pre_condition do 11 | 'include postgresql::server' 12 | end 13 | 14 | context 'with only required parameters' do 15 | let :params do 16 | req_params 17 | end 18 | 19 | it { is_expected.to contain_class('gnocchi::deps') } 20 | 21 | it { is_expected.to contain_openstacklib__db__postgresql('gnocchi').with( 22 | :user => 'gnocchi', 23 | :password => 'gnocchipass', 24 | :dbname => 'gnocchi', 25 | :encoding => nil, 26 | :privileges => 'ALL', 27 | )} 28 | end 29 | 30 | end 31 | 32 | on_supported_os({ 33 | :supported_os => OSDefaults.get_supported_os 34 | }).each do |os,facts| 35 | context "on #{os}" do 36 | let (:facts) do 37 | facts.merge(OSDefaults.get_facts({ 38 | # puppet-postgresql requires the service_provider fact provided by 39 | # puppetlabs-postgresql. 40 | :service_provider => 'systemd' 41 | })) 42 | end 43 | 44 | it_configures 'gnocchi::db::postgresql' 45 | end 46 | end 47 | 48 | end 49 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_db_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi::db' do 4 | shared_examples 'gnocchi::db' do 5 | context 'with default parameters' do 6 | it { should contain_class('gnocchi::deps') } 7 | 8 | it { should contain_oslo__db('gnocchi_config').with( 9 | :db_max_retries => '', 10 | :connection_recycle_time => '', 11 | :max_pool_size => '', 12 | :max_retries => '', 13 | :retry_interval => '', 14 | :max_overflow => '', 15 | :pool_timeout => '', 16 | :mysql_enable_ndb => '', 17 | :manage_backend_package => false, 18 | :manage_config => true, 19 | )} 20 | 21 | it { should contain_oslo__db('gnocchi_config_connection').with( 22 | :config => 'gnocchi_config', 23 | :connection => 'sqlite:////var/lib/gnocchi/gnocchi.sqlite', 24 | :manage_backend_package => true, 25 | :manage_config => false, 26 | )} 27 | 28 | it { should contain_gnocchi_config('indexer/url').with( 29 | :value => 'sqlite:////var/lib/gnocchi/gnocchi.sqlite', 30 | :secret => true, 31 | )} 32 | end 33 | 34 | context 'with specific parameters' do 35 | let :params do 36 | { 37 | :database_db_max_retries => '-1', 38 | :database_connection => 'mysql+pymysql://gnocchi:gnocchi@localhost/gnocchi', 39 | :slave_connection => 'mysql+pymysql://gnocchi:gnocchi@localhost2/gnocchi', 40 | :database_connection_recycle_time => '3601', 41 | :database_max_pool_size => '11', 42 | :database_max_retries => '11', 43 | :database_retry_interval => '11', 44 | :database_max_overflow => '21', 45 | :database_pool_timeout => '21', 46 | :mysql_enable_ndb => true, 47 | } 48 | end 49 | 50 | it { should contain_class('gnocchi::deps') } 51 | 52 | it { should contain_oslo__db('gnocchi_config').with( 53 | :db_max_retries => '-1', 54 | :slave_connection => 'mysql+pymysql://gnocchi:gnocchi@localhost2/gnocchi', 55 | :connection_recycle_time => '3601', 56 | :max_pool_size => '11', 57 | :max_retries => '11', 58 | :retry_interval => '11', 59 | :max_overflow => '21', 60 | :pool_timeout => '21', 61 | :mysql_enable_ndb => true, 62 | :manage_backend_package => false, 63 | :manage_config => true, 64 | )} 65 | it { should contain_oslo__db('gnocchi_config_connection').with( 66 | :config => 'gnocchi_config', 67 | :connection => 'mysql+pymysql://gnocchi:gnocchi@localhost/gnocchi', 68 | :manage_backend_package => true, 69 | :manage_config => false, 70 | )} 71 | it { should contain_gnocchi_config('indexer/url').with( 72 | :value => 'mysql+pymysql://gnocchi:gnocchi@localhost/gnocchi', 73 | :secret => true, 74 | )} 75 | end 76 | end 77 | 78 | on_supported_os({ 79 | :supported_os => OSDefaults.get_supported_os 80 | }).each do |os,facts| 81 | context "on #{os}" do 82 | let (:facts) do 83 | facts.merge!(OSDefaults.get_facts()) 84 | end 85 | 86 | it_behaves_like 'gnocchi::db' 87 | end 88 | end 89 | end 90 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_db_sync_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi::db::sync' do 4 | 5 | shared_examples_for 'gnocchi-dbsync' do 6 | 7 | it { is_expected.to contain_class('gnocchi::deps') } 8 | 9 | it 'runs gnocchi-manage db_sync' do 10 | is_expected.to contain_exec('gnocchi-db-sync').with( 11 | :command => 'gnocchi-upgrade ', 12 | :path => '/usr/bin', 13 | :user => 'gnocchi', 14 | :refreshonly => 'true', 15 | :try_sleep => 5, 16 | :tries => 10, 17 | :timeout => 300, 18 | :logoutput => 'on_failure', 19 | :subscribe => ['Anchor[gnocchi::install::end]', 20 | 'Anchor[gnocchi::config::end]', 21 | 'Anchor[gnocchi::dbsync::begin]'], 22 | :notify => 'Anchor[gnocchi::dbsync::end]', 23 | :tag => 'openstack-db', 24 | ) 25 | end 26 | describe "overriding params" do 27 | let :params do 28 | { 29 | :extra_opts => '--skip-storage', 30 | :db_sync_timeout => 750, 31 | } 32 | end 33 | it { is_expected.to contain_exec('gnocchi-db-sync').with( 34 | :command => 'gnocchi-upgrade --skip-storage', 35 | :path => '/usr/bin', 36 | :user => 'gnocchi', 37 | :refreshonly => 'true', 38 | :try_sleep => 5, 39 | :tries => 10, 40 | :timeout => 750, 41 | :logoutput => 'on_failure', 42 | :subscribe => ['Anchor[gnocchi::install::end]', 43 | 'Anchor[gnocchi::config::end]', 44 | 'Anchor[gnocchi::dbsync::begin]'], 45 | :notify => 'Anchor[gnocchi::dbsync::end]', 46 | :tag => 'openstack-db', 47 | ) 48 | } 49 | end 50 | end 51 | 52 | on_supported_os({ 53 | :supported_os => OSDefaults.get_supported_os 54 | }).each do |os,facts| 55 | context "on #{os}" do 56 | let (:facts) do 57 | facts.merge(OSDefaults.get_facts()) 58 | end 59 | 60 | it_configures 'gnocchi-dbsync' 61 | end 62 | end 63 | 64 | end 65 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_healthcheck_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi::healthcheck' do 4 | 5 | shared_examples_for 'gnocchi::healthcheck' do 6 | 7 | context 'with default parameters' do 8 | let :params do 9 | {} 10 | end 11 | 12 | it 'configures default values' do 13 | is_expected.to contain_oslo__healthcheck('gnocchi_config').with( 14 | :detailed => '', 15 | :backends => '', 16 | :allowed_source_ranges => '', 17 | :ignore_proxied_requests => '', 18 | :disable_by_file_path => '', 19 | :disable_by_file_paths => '', 20 | :enable_by_file_paths => '', 21 | ) 22 | end 23 | end 24 | 25 | context 'with specific parameters' do 26 | let :params do 27 | { 28 | :detailed => true, 29 | :backends => ['disable_by_file'], 30 | :allowed_source_ranges => ['10.0.0.0/24', '10.0.1.0/24'], 31 | :ignore_proxied_requests => false, 32 | :disable_by_file_path => '/etc/gnocchi/healthcheck/disabled', 33 | :disable_by_file_paths => ['8004:/etc/gnocchi/healthcheck/disabled'], 34 | :enable_by_file_paths => ['/etc/gnocchi/healthcheck/enabled'], 35 | } 36 | end 37 | 38 | it 'configures specified values' do 39 | is_expected.to contain_oslo__healthcheck('gnocchi_config').with( 40 | :detailed => true, 41 | :backends => ['disable_by_file'], 42 | :allowed_source_ranges => ['10.0.0.0/24', '10.0.1.0/24'], 43 | :ignore_proxied_requests => false, 44 | :disable_by_file_path => '/etc/gnocchi/healthcheck/disabled', 45 | :disable_by_file_paths => ['8004:/etc/gnocchi/healthcheck/disabled'], 46 | :enable_by_file_paths => ['/etc/gnocchi/healthcheck/enabled'], 47 | ) 48 | end 49 | end 50 | end 51 | 52 | on_supported_os({ 53 | :supported_os => OSDefaults.get_supported_os 54 | }).each do |os,facts| 55 | context "on #{os}" do 56 | let (:facts) do 57 | facts.merge!(OSDefaults.get_facts()) 58 | end 59 | 60 | it_configures 'gnocchi::healthcheck' 61 | end 62 | end 63 | 64 | end 65 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_init_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi' do 4 | 5 | shared_examples 'gnocchi' do 6 | 7 | context 'with default parameters' do 8 | let :params do 9 | { :purge_config => false } 10 | end 11 | 12 | it 'contains the deps class' do 13 | is_expected.to contain_class('gnocchi::deps') 14 | end 15 | 16 | it 'installs packages' do 17 | is_expected.to contain_package('gnocchi').with( 18 | :name => platform_params[:gnocchi_common_package], 19 | :ensure => 'present', 20 | :tag => ['openstack', 'gnocchi-package'] 21 | ) 22 | end 23 | 24 | it 'passes purge to resource' do 25 | is_expected.to contain_resources('gnocchi_config').with({ 26 | :purge => false 27 | }) 28 | end 29 | 30 | it 'does not configure coordination_url' do 31 | is_expected.to contain_gnocchi_config('DEFAULT/coordination_url').with_value('').with_secret(true) 32 | is_expected.to contain_oslo__coordination('gnocchi_config').with( 33 | :backend_url => '', 34 | :manage_config => false, 35 | ) 36 | end 37 | end 38 | 39 | context 'with overridden parameters' do 40 | let :params do 41 | { :purge_config => true, 42 | :coordination_url => 'redis://localhost:6379', } 43 | end 44 | 45 | it 'purges gnocchi config' do 46 | is_expected.to contain_resources('gnocchi_config').with({ 47 | :purge => true 48 | }) 49 | end 50 | 51 | it 'configures coordination' do 52 | is_expected.to contain_gnocchi_config('DEFAULT/coordination_url').with_value('redis://localhost:6379').with_secret(true) 53 | is_expected.to contain_oslo__coordination('gnocchi_config').with( 54 | :backend_url => 'redis://localhost:6379', 55 | :manage_config => false, 56 | ) 57 | end 58 | end 59 | end 60 | 61 | on_supported_os({ 62 | :supported_os => OSDefaults.get_supported_os 63 | }).each do |os,facts| 64 | context "on #{os}" do 65 | let (:facts) do 66 | facts.merge!(OSDefaults.get_facts()) 67 | end 68 | 69 | let(:platform_params) do 70 | case facts[:os]['family'] 71 | when 'Debian' 72 | { :gnocchi_common_package => 'gnocchi-common' } 73 | when 'RedHat' 74 | { :gnocchi_common_package => 'gnocchi-common' } 75 | end 76 | end 77 | it_behaves_like 'gnocchi' 78 | end 79 | end 80 | 81 | end 82 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_keystone_auth_spec.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Unit tests for gnocchi::keystone::auth 3 | # 4 | 5 | require 'spec_helper' 6 | 7 | describe 'gnocchi::keystone::auth' do 8 | shared_examples_for 'gnocchi::keystone::auth' do 9 | context 'with default class parameters' do 10 | let :params do 11 | { :password => 'gnocchi_password' } 12 | end 13 | 14 | it { is_expected.to contain_keystone__resource__service_identity('gnocchi').with( 15 | :configure_user => true, 16 | :configure_user_role => true, 17 | :configure_endpoint => true, 18 | :configure_service => true, 19 | :service_name => 'gnocchi', 20 | :service_type => 'metric', 21 | :service_description => 'OpenStack Metric Service', 22 | :region => 'RegionOne', 23 | :auth_name => 'gnocchi', 24 | :password => 'gnocchi_password', 25 | :email => 'gnocchi@localhost', 26 | :tenant => 'services', 27 | :roles => ['admin'], 28 | :system_scope => 'all', 29 | :system_roles => [], 30 | :public_url => 'http://127.0.0.1:8041', 31 | :internal_url => 'http://127.0.0.1:8041', 32 | :admin_url => 'http://127.0.0.1:8041', 33 | ) } 34 | end 35 | 36 | context 'when overriding parameters' do 37 | let :params do 38 | { :password => 'gnocchi_password', 39 | :auth_name => 'alt_gnocchi', 40 | :email => 'alt_gnocchi@alt_localhost', 41 | :tenant => 'alt_service', 42 | :roles => ['admin', 'service'], 43 | :system_scope => 'all', 44 | :system_roles => ['admin', 'member', 'reader'], 45 | :configure_endpoint => false, 46 | :configure_user => false, 47 | :configure_user_role => false, 48 | :configure_service => false, 49 | :service_description => 'Alternative OpenStack Metric Service', 50 | :service_name => 'alt_service', 51 | :service_type => 'alt_metric', 52 | :region => 'RegionTwo', 53 | :public_url => 'https://10.10.10.10:80', 54 | :internal_url => 'http://10.10.10.11:81', 55 | :admin_url => 'http://10.10.10.12:81' } 56 | end 57 | 58 | it { is_expected.to contain_keystone__resource__service_identity('gnocchi').with( 59 | :configure_user => false, 60 | :configure_user_role => false, 61 | :configure_endpoint => false, 62 | :configure_service => false, 63 | :service_name => 'alt_service', 64 | :service_type => 'alt_metric', 65 | :service_description => 'Alternative OpenStack Metric Service', 66 | :region => 'RegionTwo', 67 | :auth_name => 'alt_gnocchi', 68 | :password => 'gnocchi_password', 69 | :email => 'alt_gnocchi@alt_localhost', 70 | :tenant => 'alt_service', 71 | :roles => ['admin', 'service'], 72 | :system_scope => 'all', 73 | :system_roles => ['admin', 'member', 'reader'], 74 | :public_url => 'https://10.10.10.10:80', 75 | :internal_url => 'http://10.10.10.11:81', 76 | :admin_url => 'http://10.10.10.12:81', 77 | ) } 78 | end 79 | end 80 | 81 | on_supported_os({ 82 | :supported_os => OSDefaults.get_supported_os 83 | }).each do |os,facts| 84 | context "on #{os}" do 85 | let (:facts) do 86 | facts.merge!(OSDefaults.get_facts()) 87 | end 88 | 89 | it_behaves_like 'gnocchi::keystone::auth' 90 | end 91 | end 92 | end 93 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_logging_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi::logging' do 4 | 5 | let :params do 6 | { 7 | } 8 | end 9 | 10 | let :log_params do 11 | { 12 | :use_syslog => true, 13 | :use_json => true, 14 | :use_journal => true, 15 | :use_stderr => false, 16 | :log_facility => 'LOG_FOO', 17 | :log_dir => '/var/log', 18 | :log_file => '/var/log/gnocchi/gnocchi.log', 19 | :debug => true, 20 | } 21 | end 22 | 23 | shared_examples_for 'gnocchi-logging' do 24 | 25 | context 'with basic logging options and default settings' do 26 | it_configures 'basic default logging settings' 27 | end 28 | 29 | context 'with basic logging options and non-default settings' do 30 | before { params.merge!( log_params ) } 31 | it_configures 'basic non-default logging settings' 32 | end 33 | 34 | end 35 | 36 | shared_examples 'basic default logging settings' do 37 | it 'configures gnocchi logging settings with default values' do 38 | is_expected.to contain_oslo__log('gnocchi_config').with( 39 | :use_syslog => '', 40 | :use_json => '', 41 | :use_journal => '', 42 | :use_stderr => '', 43 | :syslog_log_facility => '', 44 | :log_dir => '/var/log/gnocchi', 45 | :log_file => '', 46 | :debug => '', 47 | ) 48 | end 49 | end 50 | 51 | shared_examples 'basic non-default logging settings' do 52 | it 'configures gnocchi logging settings with non-default values' do 53 | is_expected.to contain_oslo__log('gnocchi_config').with( 54 | :use_syslog => true, 55 | :use_json => true, 56 | :use_journal => true, 57 | :use_stderr => false, 58 | :syslog_log_facility => 'LOG_FOO', 59 | :log_dir => '/var/log', 60 | :log_file => '/var/log/gnocchi/gnocchi.log', 61 | :debug => true, 62 | ) 63 | end 64 | end 65 | 66 | on_supported_os({ 67 | :supported_os => OSDefaults.get_supported_os 68 | }).each do |os,facts| 69 | context "on #{os}" do 70 | let (:facts) do 71 | facts.merge!(OSDefaults.get_facts()) 72 | end 73 | 74 | it_behaves_like 'gnocchi-logging' 75 | end 76 | end 77 | end 78 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_metricd_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi::metricd' do 4 | 5 | let :params do { } 6 | end 7 | 8 | shared_examples_for 'gnocchi-metricd' do 9 | 10 | it { is_expected.to contain_class('gnocchi::deps') } 11 | it { is_expected.to contain_class('gnocchi::params') } 12 | 13 | it 'installs gnocchi-metricd package' do 14 | is_expected.to contain_package('gnocchi-metricd').with( 15 | :ensure => 'present', 16 | :name => platform_params[:metricd_package_name], 17 | :tag => ['openstack', 'gnocchi-package'], 18 | ) 19 | end 20 | 21 | it 'configures the default value' do 22 | is_expected.to contain_gnocchi_config('metricd/workers').with_value(4) 23 | is_expected.to contain_gnocchi_config('metricd/metric_processing_delay').with_value('') 24 | is_expected.to contain_gnocchi_config('metricd/greedy').with_value('') 25 | is_expected.to contain_gnocchi_config('metricd/metric_reporting_delay').with_value('') 26 | is_expected.to contain_gnocchi_config('metricd/metric_cleanup_delay').with_value('') 27 | is_expected.to contain_gnocchi_config('metricd/processing_replicas').with_value('') 28 | end 29 | 30 | [{:enabled => true}, {:enabled => false}].each do |param_hash| 31 | context "when service should be #{param_hash[:enabled] ? 'enabled' : 'disabled'}" do 32 | before do 33 | params.merge!(param_hash) 34 | end 35 | 36 | it 'configures gnocchi-metricd service' do 37 | is_expected.to contain_service('gnocchi-metricd').with( 38 | :ensure => params[:enabled] ? 'running' : 'stopped', 39 | :name => platform_params[:metricd_service_name], 40 | :enable => params[:enabled], 41 | :hasstatus => true, 42 | :hasrestart => true, 43 | :tag => ['gnocchi-service', 'gnocchi-db-sync-service'], 44 | ) 45 | end 46 | end 47 | end 48 | 49 | context 'with disabled service managing' do 50 | before do 51 | params.merge!({ 52 | :manage_service => false 53 | }) 54 | end 55 | 56 | it 'does not configure gnocchi-metricd service' do 57 | is_expected.to_not contain_service('gnocchi-metricd') 58 | end 59 | end 60 | 61 | context 'with parameters set' do 62 | before do 63 | params.merge!({ 64 | :workers => 2, 65 | :metric_processing_delay => 60, 66 | :greedy => true, 67 | :metric_reporting_delay => 120, 68 | :metric_cleanup_delay => 300, 69 | :processing_replicas => 3, 70 | }) 71 | end 72 | 73 | it 'configures the overridden value' do 74 | is_expected.to contain_gnocchi_config('metricd/workers').with_value(2) 75 | is_expected.to contain_gnocchi_config('metricd/metric_processing_delay').with_value(60) 76 | is_expected.to contain_gnocchi_config('metricd/greedy').with_value(true) 77 | is_expected.to contain_gnocchi_config('metricd/metric_reporting_delay').with_value(120) 78 | is_expected.to contain_gnocchi_config('metricd/metric_cleanup_delay').with_value(300) 79 | is_expected.to contain_gnocchi_config('metricd/processing_replicas').with_value(3) 80 | end 81 | end 82 | end 83 | 84 | on_supported_os({ 85 | :supported_os => OSDefaults.get_supported_os 86 | }).each do |os,facts| 87 | context "on #{os}" do 88 | let (:facts) do 89 | facts.merge!(OSDefaults.get_facts({ :os_workers => 4 })) 90 | end 91 | 92 | let(:platform_params) do 93 | { :metricd_package_name => 'gnocchi-metricd', 94 | :metricd_service_name => 'gnocchi-metricd' } 95 | end 96 | it_behaves_like 'gnocchi-metricd' 97 | end 98 | end 99 | 100 | end 101 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_policy_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi::policy' do 4 | shared_examples 'gnocchi::policy' do 5 | 6 | context 'setup policy with parameters' do 7 | let :params do 8 | { 9 | :enforce_scope => false, 10 | :enforce_new_defaults => false, 11 | :policy_path => '/etc/gnocchi/policy.yaml', 12 | :policy_default_rule => 'default', 13 | :policy_dirs => '/etc/gnocchi/policy.d', 14 | :policies => { 15 | 'context_is_admin' => { 16 | 'key' => 'context_is_admin', 17 | 'value' => 'foo:bar' 18 | } 19 | } 20 | } 21 | end 22 | 23 | it 'set up the policies' do 24 | is_expected.to contain_openstacklib__policy('/etc/gnocchi/policy.yaml').with( 25 | :policies => { 26 | 'context_is_admin' => { 27 | 'key' => 'context_is_admin', 28 | 'value' => 'foo:bar' 29 | } 30 | }, 31 | :policy_path => '/etc/gnocchi/policy.yaml', 32 | :file_user => 'root', 33 | :file_group => 'gnocchi', 34 | :file_format => 'yaml', 35 | :purge_config => false, 36 | ) 37 | is_expected.to contain_oslo__policy('gnocchi_config').with( 38 | :enforce_scope => false, 39 | :enforce_new_defaults => false, 40 | :policy_file => '/etc/gnocchi/policy.yaml', 41 | :policy_default_rule => 'default', 42 | :policy_dirs => '/etc/gnocchi/policy.d', 43 | ) 44 | end 45 | end 46 | 47 | context 'with empty policies and purge_config enabled' do 48 | let :params do 49 | { 50 | :enforce_scope => false, 51 | :enforce_new_defaults => false, 52 | :policy_path => '/etc/gnocchi/policy.yaml', 53 | :policies => {}, 54 | :purge_config => true, 55 | } 56 | end 57 | 58 | it 'set up the policies' do 59 | is_expected.to contain_openstacklib__policy('/etc/gnocchi/policy.yaml').with( 60 | :policies => {}, 61 | :policy_path => '/etc/gnocchi/policy.yaml', 62 | :file_user => 'root', 63 | :file_group => 'gnocchi', 64 | :file_format => 'yaml', 65 | :purge_config => true, 66 | ) 67 | is_expected.to contain_oslo__policy('gnocchi_config').with( 68 | :enforce_scope => false, 69 | :enforce_new_defaults => false, 70 | :policy_file => '/etc/gnocchi/policy.yaml', 71 | ) 72 | end 73 | end 74 | end 75 | 76 | on_supported_os({ 77 | :supported_os => OSDefaults.get_supported_os 78 | }).each do |os,facts| 79 | context "on #{os}" do 80 | let (:facts) do 81 | facts.merge!(OSDefaults.get_facts()) 82 | end 83 | 84 | it_behaves_like 'gnocchi::policy' 85 | end 86 | end 87 | end 88 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_statsd_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi::statsd' do 4 | 5 | let :params do 6 | { :enabled => true, 7 | :manage_service => true, 8 | :resource_id => '07f26121-5777-48ba-8a0b-d70468133dd9', 9 | } 10 | end 11 | 12 | shared_examples_for 'gnocchi-statsd' do 13 | 14 | it { is_expected.to contain_class('gnocchi::deps') } 15 | it { is_expected.to contain_class('gnocchi::params') } 16 | 17 | it 'installs gnocchi-statsd package' do 18 | is_expected.to contain_package('gnocchi-statsd').with( 19 | :ensure => 'present', 20 | :name => platform_params[:statsd_package_name], 21 | :tag => ['openstack', 'gnocchi-package'], 22 | ) 23 | end 24 | 25 | it 'configures gnocchi statsd' do 26 | is_expected.to contain_gnocchi_config('statsd/resource_id').with_value('07f26121-5777-48ba-8a0b-d70468133dd9') 27 | is_expected.to contain_gnocchi_config('statsd/host').with_value('') 28 | is_expected.to contain_gnocchi_config('statsd/port').with_value('') 29 | is_expected.to contain_gnocchi_config('statsd/flush_delay').with_value('') 30 | is_expected.to contain_gnocchi_config('statsd/archive_policy_name').with_value('') 31 | is_expected.to contain_gnocchi_config('statsd/creator').with_value('') 32 | end 33 | 34 | [{:enabled => true}, {:enabled => false}].each do |param_hash| 35 | context "when service should be #{param_hash[:enabled] ? 'enabled' : 'disabled'}" do 36 | before do 37 | params.merge!(param_hash) 38 | end 39 | 40 | it 'configures gnocchi-statsd service' do 41 | is_expected.to contain_service('gnocchi-statsd').with( 42 | :ensure => params[:enabled] ? 'running' : 'stopped', 43 | :name => platform_params[:statsd_service_name], 44 | :enable => params[:enabled], 45 | :hasstatus => true, 46 | :hasrestart => true, 47 | :tag => ['gnocchi-service', 'gnocchi-db-sync-service'], 48 | ) 49 | end 50 | end 51 | end 52 | 53 | context 'with disabled service managing' do 54 | before do 55 | params.merge!({ 56 | :manage_service => false 57 | }) 58 | end 59 | 60 | it 'does not configure gnocchi-statsd service' do 61 | is_expected.to_not contain_service('gnocchi-statsd') 62 | end 63 | end 64 | 65 | context 'whth host and port' do 66 | before do 67 | params.merge!({ 68 | :host => '192.0.2.1', 69 | :port => 8125, 70 | }) 71 | end 72 | 73 | it 'configures the parameter' do 74 | is_expected.to contain_gnocchi_config('statsd/host').with_value('192.0.2.1') 75 | is_expected.to contain_gnocchi_config('statsd/port').with_value(8125) 76 | end 77 | end 78 | 79 | context 'with flush_delay' do 80 | before do 81 | params.merge!({ :flush_delay => 10 }) 82 | end 83 | 84 | it 'configures the parameter' do 85 | is_expected.to contain_gnocchi_config('statsd/flush_delay').with_value(10) 86 | end 87 | end 88 | 89 | context 'with archive_policy_name' do 90 | before do 91 | params.merge!({ :archive_policy_name => 'high' }) 92 | end 93 | 94 | it 'configures the parameter' do 95 | is_expected.to contain_gnocchi_config('statsd/archive_policy_name').with_value('high') 96 | end 97 | end 98 | 99 | context 'with creator' do 100 | before do 101 | params.merge!({ :creator => 'creator' }) 102 | end 103 | 104 | it 'configures the parameter' do 105 | is_expected.to contain_gnocchi_config('statsd/creator').with_value('creator') 106 | end 107 | end 108 | end 109 | 110 | on_supported_os({ 111 | :supported_os => OSDefaults.get_supported_os 112 | }).each do |os,facts| 113 | context "on #{os}" do 114 | let (:facts) do 115 | facts.merge!(OSDefaults.get_facts()) 116 | end 117 | 118 | let(:platform_params) do 119 | { :statsd_package_name => 'gnocchi-statsd', 120 | :statsd_service_name => 'gnocchi-statsd' } 121 | end 122 | it_behaves_like 'gnocchi-statsd' 123 | end 124 | end 125 | 126 | end 127 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_storage_ceph_spec.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Unit tests for gnocchi::storage::ceph 3 | # 4 | require 'spec_helper' 5 | 6 | describe 'gnocchi::storage::ceph' do 7 | 8 | let :params do 9 | { 10 | :ceph_username => 'joe', 11 | :ceph_keyring => 'client.admin', 12 | } 13 | end 14 | 15 | shared_examples 'gnocchi::storage::ceph' do 16 | 17 | context 'with default parameters' do 18 | it 'configures gnocchi-api with default parameters' do 19 | is_expected.to contain_gnocchi_config('storage/driver').with_value('ceph') 20 | is_expected.to contain_gnocchi_config('storage/ceph_username').with_value('joe') 21 | is_expected.to contain_gnocchi_config('storage/ceph_keyring').with_value('client.admin') 22 | is_expected.to contain_gnocchi_config('storage/ceph_pool').with_value('gnocchi') 23 | is_expected.to contain_gnocchi_config('storage/ceph_timeout').with_value('') 24 | is_expected.to contain_gnocchi_config('storage/ceph_conffile').with_value('/etc/ceph/ceph.conf') 25 | end 26 | 27 | it { is_expected.to contain_package('python-rados').with( 28 | :ensure => 'installed', 29 | :name => 'python3-rados', 30 | :tag => ['openstack', 'gnocchi-package'], 31 | )} 32 | end 33 | 34 | context 'with ceph_secret parameter' do 35 | before do 36 | params.merge!({ 37 | :ceph_secret => 'secrete'}) 38 | end 39 | 40 | it { is_expected.to contain_gnocchi_config('storage/ceph_secret').with_value('secrete').with_secret(true) } 41 | end 42 | 43 | context 'without required parameters' do 44 | before { params.delete(:ceph_keyring) } 45 | it { expect { is_expected.to raise_error(Puppet::Error) } } 46 | end 47 | 48 | context 'with both required parameters set to false' do 49 | before do 50 | params.merge!({ 51 | :ceph_secret => false, 52 | :ceph_keyring => false, 53 | }) 54 | end 55 | it { expect { is_expected.to raise_error(Puppet::Error) } } 56 | end 57 | 58 | context 'with manage_rados to false' do 59 | before do 60 | params.merge!( :manage_rados => false ) 61 | end 62 | 63 | it { is_expected.not_to contain_package('python-rados') } 64 | end 65 | 66 | context 'with package_ensure' do 67 | before do 68 | params.merge!( :package_ensure => 'latest' ) 69 | end 70 | 71 | it { is_expected.to contain_package('python-rados').with( 72 | :ensure => 'latest', 73 | :name => 'python3-rados', 74 | :tag => ['openstack', 'gnocchi-package'], 75 | )} 76 | end 77 | 78 | context 'with ceph_timeout' do 79 | before do 80 | params.merge!( :ceph_timeout => 30 ) 81 | end 82 | 83 | it { is_expected.to contain_gnocchi_config('storage/ceph_timeout').with_value(30) } 84 | end 85 | end 86 | 87 | on_supported_os({ 88 | :supported_os => OSDefaults.get_supported_os 89 | }).each do |os,facts| 90 | context "on #{os}" do 91 | let (:facts) do 92 | facts.merge!(OSDefaults.get_facts()) 93 | end 94 | 95 | it_behaves_like 'gnocchi::storage::ceph' 96 | end 97 | end 98 | end 99 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_storage_file_spec.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Unit tests for gnocchi::storage::file 3 | # 4 | require 'spec_helper' 5 | 6 | describe 'gnocchi::storage::file' do 7 | 8 | let :params do 9 | {} 10 | end 11 | 12 | shared_examples 'gnocchi storage file' do 13 | 14 | context 'with default parameters' do 15 | it 'configures gnocchi-api with default parameters' do 16 | is_expected.to contain_gnocchi_config('storage/driver').with_value('file') 17 | is_expected.to contain_gnocchi_config('storage/file_basepath').with_value('/var/lib/gnocchi') 18 | end 19 | end 20 | end 21 | 22 | on_supported_os({ 23 | :supported_os => OSDefaults.get_supported_os 24 | }).each do |os,facts| 25 | context "on #{os}" do 26 | let (:facts) do 27 | facts.merge!(OSDefaults.get_facts()) 28 | end 29 | 30 | it_behaves_like 'gnocchi storage file' 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_storage_incoming_file_spec.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Unit tests for gnocchi::storage::incoming::file 3 | # 4 | 5 | require 'spec_helper' 6 | 7 | describe 'gnocchi::storage::incoming::file' do 8 | 9 | let :params do 10 | {} 11 | end 12 | 13 | shared_examples_for 'gnocchi storage file' do 14 | 15 | context 'with file' do 16 | it 'configures gnocchi incoming driver with file' do 17 | is_expected.to contain_class('gnocchi::deps') 18 | is_expected.to contain_gnocchi_config('incoming/driver').with_value('file') 19 | is_expected.to contain_gnocchi_config('incoming/file_basepath').with_value('') 20 | end 21 | end 22 | 23 | context 'with file_basepath' do 24 | let :params do 25 | { :file_basepath => '/var/lib/gnocchi' } 26 | end 27 | 28 | it 'configures gnocchi incoming driver with file' do 29 | is_expected.to contain_gnocchi_config('incoming/driver').with_value('file') 30 | is_expected.to contain_gnocchi_config('incoming/file_basepath').with_value('/var/lib/gnocchi') 31 | end 32 | end 33 | end 34 | 35 | on_supported_os({ 36 | :supported_os => OSDefaults.get_supported_os 37 | }).each do |os,facts| 38 | context "on #{os}" do 39 | let (:facts) do 40 | facts.merge!(OSDefaults.get_facts()) 41 | end 42 | 43 | it_behaves_like 'gnocchi storage file' 44 | end 45 | end 46 | 47 | end 48 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_storage_incoming_redis_spec.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Unit tests for gnocchi::storage::incoming::redis 3 | # 4 | 5 | require 'spec_helper' 6 | 7 | describe 'gnocchi::storage::incoming::redis' do 8 | 9 | let :params do 10 | { :redis_url => 'http://localhost:6378' } 11 | end 12 | 13 | shared_examples_for 'gnocchi storage redis' do 14 | 15 | it { is_expected.to contain_class('gnocchi::deps') } 16 | 17 | context 'with redis' do 18 | it 'configures gnocchi incoming driver with redis' do 19 | is_expected.to contain_gnocchi_config('incoming/driver').with_value('redis') 20 | is_expected.to contain_gnocchi_config('incoming/redis_url').with_value('http://localhost:6378').with_secret(true) 21 | end 22 | end 23 | end 24 | 25 | on_supported_os({ 26 | :supported_os => OSDefaults.get_supported_os 27 | }).each do |os,facts| 28 | context "on #{os}" do 29 | let (:facts) do 30 | facts.merge!(OSDefaults.get_facts()) 31 | end 32 | 33 | it_behaves_like 'gnocchi storage redis' 34 | end 35 | end 36 | 37 | end 38 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_storage_s3_spec.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Unit tests for gnocchi::storage::s3 3 | # 4 | require 'spec_helper' 5 | 6 | describe 'gnocchi::storage::s3' do 7 | 8 | let :params do 9 | { 10 | :s3_endpoint_url => 'https://s3-eu-west-1.amazonaws.com', 11 | :s3_region_name => 'eu-west-1', 12 | :s3_access_key_id => 'xyz', 13 | :s3_secret_access_key => 'secret-xyz', 14 | } 15 | end 16 | 17 | shared_examples 'gnocchi storage s3' do 18 | 19 | context 'with default parameters' do 20 | it 'configures gnocchi-api with default parameters' do 21 | is_expected.to contain_gnocchi_config('storage/driver').with_value('s3') 22 | is_expected.to contain_gnocchi_config('storage/s3_endpoint_url').with_value('https://s3-eu-west-1.amazonaws.com') 23 | is_expected.to contain_gnocchi_config('storage/s3_region_name').with_value('eu-west-1') 24 | is_expected.to contain_gnocchi_config('storage/s3_access_key_id').with_value('xyz').with_secret(true) 25 | is_expected.to contain_gnocchi_config('storage/s3_secret_access_key').with_value('secret-xyz').with_secret(true) 26 | end 27 | 28 | it 'installs python-boto3 package' do 29 | is_expected.to contain_package('python-boto3').with( 30 | :ensure => 'installed', 31 | :name => platform_params[:boto3_package_name], 32 | :tag => ['openstack', 'gnocchi-package'], 33 | ) 34 | end 35 | end 36 | 37 | context 'with manage_boto3 to false' do 38 | before do 39 | params.merge!( :manage_boto3 => false ) 40 | end 41 | 42 | it { is_expected.not_to contain_package('python-boto3') } 43 | end 44 | 45 | context 'with package_ensure' do 46 | before do 47 | params.merge!( :package_ensure => 'latest' ) 48 | end 49 | 50 | it 'installs python-boto3 package' do 51 | is_expected.to contain_package('python-boto3').with( 52 | :ensure => 'latest', 53 | :name => platform_params[:boto3_package_name], 54 | :tag => ['openstack', 'gnocchi-package'], 55 | ) 56 | end 57 | end 58 | end 59 | 60 | on_supported_os({ 61 | :supported_os => OSDefaults.get_supported_os 62 | }).each do |os,facts| 63 | context "on #{os}" do 64 | let (:facts) do 65 | facts.merge!(OSDefaults.get_facts()) 66 | end 67 | 68 | let(:platform_params) do 69 | case facts[:os]['family'] 70 | when 'Debian' 71 | { :boto3_package_name => 'python3-boto3' } 72 | when 'RedHat' 73 | { :boto3_package_name => 'python3-boto3' } 74 | end 75 | end 76 | 77 | it_behaves_like 'gnocchi storage s3' 78 | end 79 | end 80 | end 81 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_storage_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi::storage' do 4 | 5 | shared_examples_for 'gnocchi-storage' do 6 | # Nothing to test 7 | end 8 | 9 | on_supported_os({ 10 | :supported_os => OSDefaults.get_supported_os 11 | }).each do |os,facts| 12 | context "on #{os}" do 13 | let (:facts) do 14 | facts.merge!(OSDefaults.get_facts()) 15 | end 16 | 17 | it_behaves_like 'gnocchi-storage' 18 | end 19 | end 20 | 21 | end 22 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_storage_swift_spec.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Unit tests for gnocchi::storage::swift 3 | # 4 | require 'spec_helper' 5 | 6 | describe 'gnocchi::storage::swift' do 7 | 8 | let :params do 9 | {} 10 | end 11 | 12 | shared_examples 'gnocchi storage swift' do 13 | 14 | context 'with default parameters' do 15 | it 'configures gnocchi-api with default parameters' do 16 | is_expected.to contain_gnocchi_config('storage/driver').with_value('swift') 17 | is_expected.to contain_gnocchi_config('storage/swift_user').with_value('') 18 | is_expected.to contain_gnocchi_config('storage/swift_key').with_value('').with_secret(true) 19 | is_expected.to contain_gnocchi_config('storage/swift_authurl').with_value('') 20 | is_expected.to contain_gnocchi_config('storage/swift_project_name').with_value('') 21 | is_expected.to contain_gnocchi_config('storage/swift_user_domain_name').with_value('') 22 | is_expected.to contain_gnocchi_config('storage/swift_project_domain_name').with_value('') 23 | is_expected.to contain_gnocchi_config('storage/swift_region').with_value('') 24 | is_expected.to contain_gnocchi_config('storage/swift_auth_version').with_value('') 25 | is_expected.to contain_gnocchi_config('storage/swift_endpoint_type').with_value('') 26 | is_expected.to contain_gnocchi_config('storage/swift_service_type').with_value('') 27 | is_expected.to contain_gnocchi_config('storage/swift_timeout').with_value('') 28 | is_expected.to contain_gnocchi_config('storage/swift_container_prefix').with_value('') 29 | end 30 | end 31 | 32 | context 'with specific parameters' do 33 | before do 34 | params.merge!({ 35 | :swift_user => 'swift2', 36 | :swift_key => 'admin', 37 | :swift_authurl => 'http://localhost:5000', 38 | :swift_project_name => 'service', 39 | :swift_user_domain_name => 'Default', 40 | :swift_project_domain_name => 'Default', 41 | :swift_region => 'regionOne', 42 | :swift_auth_version => 2, 43 | :swift_endpoint_type => 'publicURL', 44 | :swift_service_type => 'object-store', 45 | :swift_timeout => 0, 46 | :swift_container_prefix => 'gnocchi', 47 | }) 48 | end 49 | 50 | it 'configures gnocchi-api with given endpoint type' do 51 | is_expected.to contain_gnocchi_config('storage/driver').with_value('swift') 52 | is_expected.to contain_gnocchi_config('storage/swift_user').with_value('swift2') 53 | is_expected.to contain_gnocchi_config('storage/swift_key').with_value('admin').with_secret(true) 54 | is_expected.to contain_gnocchi_config('storage/swift_authurl').with_value('http://localhost:5000') 55 | is_expected.to contain_gnocchi_config('storage/swift_project_name').with_value('service') 56 | is_expected.to contain_gnocchi_config('storage/swift_user_domain_name').with_value('Default') 57 | is_expected.to contain_gnocchi_config('storage/swift_project_domain_name').with_value('Default') 58 | is_expected.to contain_gnocchi_config('storage/swift_region').with_value('regionOne') 59 | is_expected.to contain_gnocchi_config('storage/swift_auth_version').with_value(2) 60 | is_expected.to contain_gnocchi_config('storage/swift_endpoint_type').with_value('publicURL') 61 | is_expected.to contain_gnocchi_config('storage/swift_service_type').with_value('object-store') 62 | is_expected.to contain_gnocchi_config('storage/swift_timeout').with_value(0) 63 | is_expected.to contain_gnocchi_config('storage/swift_container_prefix').with_value('gnocchi') 64 | end 65 | end 66 | end 67 | 68 | on_supported_os({ 69 | :supported_os => OSDefaults.get_supported_os 70 | }).each do |os,facts| 71 | context "on #{os}" do 72 | let (:facts) do 73 | facts.merge!(OSDefaults.get_facts()) 74 | end 75 | 76 | it_behaves_like 'gnocchi storage swift' 77 | end 78 | end 79 | end 80 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_wsgi_apache_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi::wsgi::apache' do 4 | 5 | shared_examples_for 'apache serving gnocchi with mod_wsgi' do 6 | context 'with default parameters' do 7 | it { is_expected.to contain_class('gnocchi::params') } 8 | it { is_expected.to contain_openstacklib__wsgi__apache('gnocchi_wsgi').with( 9 | :bind_port => 8041, 10 | :group => 'gnocchi', 11 | :path => '/', 12 | :priority => 10, 13 | :servername => 'foo.example.com', 14 | :ssl => false, 15 | :threads => 1, 16 | :user => 'gnocchi', 17 | :workers => facts[:os_workers], 18 | :wsgi_daemon_process => 'gnocchi', 19 | :wsgi_process_group => 'gnocchi', 20 | :wsgi_script_dir => platform_params[:wsgi_script_path], 21 | :wsgi_script_file => 'app', 22 | :wsgi_script_source => platform_params[:wsgi_script_source], 23 | :headers => nil, 24 | :request_headers => nil, 25 | :custom_wsgi_process_options => {}, 26 | :access_log_file => nil, 27 | :access_log_pipe => nil, 28 | :access_log_syslog => nil, 29 | :access_log_format => nil, 30 | :access_log_env_var => nil, 31 | :error_log_file => nil, 32 | :error_log_pipe => nil, 33 | :error_log_syslog => nil, 34 | )} 35 | end 36 | 37 | context 'when overriding parameters' do 38 | let :params do 39 | { 40 | :servername => 'dummy.host', 41 | :bind_host => '10.42.51.1', 42 | :port => 12345, 43 | :ssl => true, 44 | :workers => 8, 45 | :wsgi_process_display_name => 'gnocchi', 46 | :threads => 2, 47 | :custom_wsgi_process_options => { 48 | 'python_path' => '/my/python/path', 49 | }, 50 | :headers => ['set X-XSS-Protection "1; mode=block"'], 51 | :request_headers => ['set Content-Type "application/json"'], 52 | :vhost_custom_fragment => 'Timeout 99' 53 | } 54 | end 55 | 56 | it { is_expected.to contain_class('gnocchi::params') } 57 | it { is_expected.to contain_openstacklib__wsgi__apache('gnocchi_wsgi').with( 58 | :bind_host => '10.42.51.1', 59 | :bind_port => 12345, 60 | :group => 'gnocchi', 61 | :path => '/', 62 | :servername => 'dummy.host', 63 | :ssl => true, 64 | :threads => 2, 65 | :user => 'gnocchi', 66 | :vhost_custom_fragment => 'Timeout 99', 67 | :workers => 8, 68 | :wsgi_daemon_process => 'gnocchi', 69 | :wsgi_process_display_name => 'gnocchi', 70 | :wsgi_process_group => 'gnocchi', 71 | :wsgi_script_dir => platform_params[:wsgi_script_path], 72 | :wsgi_script_file => 'app', 73 | :wsgi_script_source => platform_params[:wsgi_script_source], 74 | :headers => ['set X-XSS-Protection "1; mode=block"'], 75 | :request_headers => ['set Content-Type "application/json"'], 76 | :custom_wsgi_process_options => { 77 | 'python_path' => '/my/python/path', 78 | }, 79 | )} 80 | end 81 | 82 | context 'with custom access logging' do 83 | let :params do 84 | { 85 | :access_log_format => 'foo', 86 | :access_log_syslog => 'syslog:local0', 87 | :error_log_syslog => 'syslog:local1', 88 | :access_log_env_var => '!dontlog', 89 | } 90 | end 91 | 92 | it { should contain_openstacklib__wsgi__apache('gnocchi_wsgi').with( 93 | :access_log_format => params[:access_log_format], 94 | :access_log_syslog => params[:access_log_syslog], 95 | :error_log_syslog => params[:error_log_syslog], 96 | :access_log_env_var => params[:access_log_env_var], 97 | )} 98 | end 99 | 100 | context 'with access_log_file' do 101 | let :params do 102 | { 103 | :access_log_file => '/path/to/file', 104 | } 105 | end 106 | 107 | it { should contain_openstacklib__wsgi__apache('gnocchi_wsgi').with( 108 | :access_log_file => params[:access_log_file], 109 | )} 110 | end 111 | 112 | context 'with access_log_pipe' do 113 | let :params do 114 | { 115 | :access_log_pipe => 'pipe', 116 | } 117 | end 118 | 119 | it { should contain_openstacklib__wsgi__apache('gnocchi_wsgi').with( 120 | :access_log_pipe => params[:access_log_pipe], 121 | )} 122 | end 123 | 124 | context 'with error_log_file' do 125 | let :params do 126 | { 127 | :error_log_file => '/path/to/file', 128 | } 129 | end 130 | 131 | it { should contain_openstacklib__wsgi__apache('gnocchi_wsgi').with( 132 | :error_log_file => params[:error_log_file], 133 | )} 134 | end 135 | 136 | context 'with error_log_pipe' do 137 | let :params do 138 | { 139 | :error_log_pipe => 'pipe', 140 | } 141 | end 142 | 143 | it { should contain_openstacklib__wsgi__apache('gnocchi_wsgi').with( 144 | :error_log_pipe => params[:error_log_pipe], 145 | )} 146 | end 147 | end 148 | 149 | on_supported_os({ 150 | :supported_os => OSDefaults.get_supported_os 151 | }).each do |os,facts| 152 | context "on #{os}" do 153 | let (:facts) do 154 | facts.merge!(OSDefaults.get_facts({ 155 | :os_workers => 4, 156 | })) 157 | end 158 | 159 | let(:platform_params) do 160 | case facts[:os]['family'] 161 | when 'Debian' 162 | { 163 | :wsgi_script_path => '/usr/lib/cgi-bin/gnocchi', 164 | :wsgi_script_source => '/usr/bin/gnocchi-api' 165 | } 166 | when 'RedHat' 167 | { 168 | :wsgi_script_path => '/var/www/cgi-bin/gnocchi', 169 | :wsgi_script_source => '/usr/bin/gnocchi-api' 170 | } 171 | end 172 | end 173 | 174 | it_behaves_like 'apache serving gnocchi with mod_wsgi' 175 | end 176 | end 177 | end 178 | -------------------------------------------------------------------------------- /spec/classes/gnocchi_wsgi_uwsgi_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'gnocchi::wsgi::uwsgi' do 4 | 5 | shared_examples 'gnocchi::wsgi::uwsgi' do 6 | context 'with default parameters' do 7 | it { 8 | should contain_class('gnocchi::deps') 9 | } 10 | 11 | it { 12 | is_expected.to contain_gnocchi_api_uwsgi_config('uwsgi/processes').with_value(facts[:os_workers]) 13 | is_expected.to contain_gnocchi_api_uwsgi_config('uwsgi/threads').with_value('32') 14 | is_expected.to contain_gnocchi_api_uwsgi_config('uwsgi/listen').with_value('100') 15 | } 16 | end 17 | end 18 | 19 | on_supported_os({ 20 | :supported_os => OSDefaults.get_supported_os 21 | }).each do |os,facts| 22 | context "on #{os}" do 23 | let (:facts) do 24 | facts.merge!(OSDefaults.get_facts({ 25 | :os_workers => 8, 26 | })) 27 | end 28 | it_behaves_like 'gnocchi::wsgi::uwsgi' 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /spec/shared_examples.rb: -------------------------------------------------------------------------------- 1 | shared_examples_for "a Puppet::Error" do |description| 2 | it "with message matching #{description.inspect}" do 3 | expect { is_expected.to have_class_count(1) }.to raise_error(Puppet::Error, description) 4 | end 5 | end 6 | 7 | shared_examples 'generic Gnocchi service' do |service| 8 | 9 | context 'with default parameters' do 10 | it 'installs package and service' do 11 | is_expected.to contain_package(service[:name]).with({ 12 | :name => service[:package_name], 13 | :ensure => 'present', 14 | :notify => "Service[#{service[:name]}]", 15 | :tag => ['openstack', 'gnocchi-package'], 16 | }) 17 | is_expected.to contain_service(service[:name]).with({ 18 | :name => service[:service_name], 19 | :ensure => 'stopped', 20 | :hasstatus => true, 21 | :enable => false, 22 | :tag => 'gnocchi-service', 23 | }) 24 | end 25 | end 26 | 27 | context 'with overridden parameters' do 28 | let :params do 29 | { :enabled => true, 30 | :ensure_package => '2014.1-1' } 31 | end 32 | 33 | it 'installs package and service' do 34 | is_expected.to contain_package(service[:name]).with({ 35 | :name => service[:package_name], 36 | :ensure => '2014.1-1', 37 | :notify => "Service[#{service[:name]}]", 38 | :tag => ['openstack', 'gnocchi-package'], 39 | }) 40 | is_expected.to contain_service(service[:name]).with({ 41 | :name => service[:service_name], 42 | :ensure => 'running', 43 | :hasstatus => true, 44 | :enable => true, 45 | :tag => 'gnocchi-service', 46 | }) 47 | end 48 | end 49 | 50 | context 'while not managing service state' do 51 | let :params do 52 | { :enabled => false, 53 | :manage_service => false } 54 | end 55 | 56 | it 'does not control service state' do 57 | is_expected.to contain_service(service[:name]).without_ensure 58 | end 59 | end 60 | end 61 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # Load libraries here to simulate how they live together in a real puppet run (for provider unit tests) 2 | $LOAD_PATH.push(File.join(File.dirname(__FILE__), 'fixtures', 'modules', 'inifile', 'lib')) 3 | $LOAD_PATH.push(File.join(File.dirname(__FILE__), 'fixtures', 'modules', 'openstacklib', 'lib')) 4 | require 'puppetlabs_spec_helper/module_spec_helper' 5 | require 'shared_examples' 6 | require 'puppet-openstack_spec_helper/facts' 7 | 8 | fixture_path = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures')) 9 | 10 | RSpec.configure do |c| 11 | c.alias_it_should_behave_like_to :it_configures, 'configures' 12 | c.alias_it_should_behave_like_to :it_raises, 'raises' 13 | 14 | c.module_path = File.join(fixture_path, 'modules') 15 | end 16 | 17 | at_exit { RSpec::Puppet::Coverage.report! } 18 | -------------------------------------------------------------------------------- /spec/spec_helper_acceptance.rb: -------------------------------------------------------------------------------- 1 | require 'puppet-openstack_spec_helper/litmus_spec_helper' 2 | -------------------------------------------------------------------------------- /spec/unit/provider/gnocchi_api_paste_ini/ini_setting_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | provider_class = Puppet::Type.type(:gnocchi_api_paste_ini).provider(:ini_setting) 3 | describe provider_class do 4 | 5 | it 'should allow setting to be set explicitly' do 6 | resource = Puppet::Type::Gnocchi_api_paste_ini.new( 7 | {:name => 'dude/foo', :value => 'bar'} 8 | ) 9 | provider = provider_class.new(resource) 10 | expect(provider.section).to eq('dude') 11 | expect(provider.setting).to eq('foo') 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/unit/provider/gnocchi_api_uwsgi_config/ini_setting_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | provider_class = Puppet::Type.type(:gnocchi_api_uwsgi_config).provider(:ini_setting) 3 | describe provider_class do 4 | 5 | it 'should default to the default setting when no other one is specified' do 6 | resource = Puppet::Type::Gnocchi_api_uwsgi_config.new( 7 | {:name => 'DEFAULT/foo', :value => 'bar'} 8 | ) 9 | provider = provider_class.new(resource) 10 | expect(provider.section).to eq('DEFAULT') 11 | expect(provider.setting).to eq('foo') 12 | end 13 | 14 | it 'should allow setting to be set explicitly' do 15 | resource = Puppet::Type::Gnocchi_api_uwsgi_config.new( 16 | {:name => 'dude/foo', :value => 'bar'} 17 | ) 18 | provider = provider_class.new(resource) 19 | expect(provider.section).to eq('dude') 20 | expect(provider.setting).to eq('foo') 21 | end 22 | 23 | it 'should ensure absent when is specified as a value' do 24 | resource = Puppet::Type::Gnocchi_api_uwsgi_config.new( 25 | {:name => 'dude/foo', :value => ''} 26 | ) 27 | provider = provider_class.new(resource) 28 | provider.exists? 29 | expect(resource[:ensure]).to eq :absent 30 | end 31 | 32 | it 'should ensure absent when value matches ensure_absent_val' do 33 | resource = Puppet::Type::Gnocchi_api_uwsgi_config.new( 34 | {:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' } 35 | ) 36 | provider = provider_class.new(resource) 37 | provider.exists? 38 | expect(resource[:ensure]).to eq :absent 39 | end 40 | 41 | end 42 | -------------------------------------------------------------------------------- /spec/unit/provider/gnocchi_config/openstackconfig_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | provider_class = Puppet::Type.type(:gnocchi_config).provider(:openstackconfig) 3 | describe provider_class do 4 | 5 | it 'should default to the default setting when no other one is specified' do 6 | resource = Puppet::Type::Gnocchi_config.new( 7 | {:name => 'DEFAULT/foo', :value => 'bar'} 8 | ) 9 | provider = provider_class.new(resource) 10 | expect(provider.section).to eq('DEFAULT') 11 | expect(provider.setting).to eq('foo') 12 | end 13 | 14 | it 'should allow setting to be set explicitly' do 15 | resource = Puppet::Type::Gnocchi_config.new( 16 | {:name => 'dude/foo', :value => 'bar'} 17 | ) 18 | provider = provider_class.new(resource) 19 | expect(provider.section).to eq('dude') 20 | expect(provider.setting).to eq('foo') 21 | end 22 | 23 | it 'should ensure absent when is specified as a value' do 24 | resource = Puppet::Type::Gnocchi_config.new( 25 | {:name => 'dude/foo', :value => ''} 26 | ) 27 | provider = provider_class.new(resource) 28 | provider.exists? 29 | expect(resource[:ensure]).to eq :absent 30 | end 31 | 32 | it 'should ensure absent when value matches ensure_absent_val' do 33 | resource = Puppet::Type::Gnocchi_config.new( 34 | {:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' } 35 | ) 36 | provider = provider_class.new(resource) 37 | provider.exists? 38 | expect(resource[:ensure]).to eq :absent 39 | end 40 | 41 | end 42 | -------------------------------------------------------------------------------- /spec/unit/type/gnocchi_api_paste_ini_spec.rb: -------------------------------------------------------------------------------- 1 | require 'puppet' 2 | require 'puppet/type/gnocchi_api_paste_ini' 3 | 4 | describe 'Puppet::Type.type(:gnocchi_api_paste_ini)' do 5 | before :each do 6 | @gnocchi_api_paste_ini = Puppet::Type.type(:gnocchi_api_paste_ini).new(:name => 'DEFAULT/foo', :value => 'bar') 7 | end 8 | 9 | it 'should accept a valid value' do 10 | @gnocchi_api_paste_ini[:value] = 'bar' 11 | expect(@gnocchi_api_paste_ini[:value]).to eq('bar') 12 | end 13 | 14 | it 'should autorequire the anchor that install the file' do 15 | catalog = Puppet::Resource::Catalog.new 16 | anchor = Puppet::Type.type(:anchor).new(:name => 'gnocchi::install::end') 17 | catalog.add_resource anchor, @gnocchi_api_paste_ini 18 | dependency = @gnocchi_api_paste_ini.autorequire 19 | expect(dependency.size).to eq(1) 20 | expect(dependency[0].target).to eq(@gnocchi_api_paste_ini) 21 | expect(dependency[0].source).to eq(anchor) 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /spec/unit/type/gnocchi_api_uwsgi_config_spec.rb: -------------------------------------------------------------------------------- 1 | require 'puppet' 2 | require 'puppet/type/gnocchi_api_uwsgi_config' 3 | 4 | describe 'Puppet::Type.type(:gnocchi_api_uwsgi_config)' do 5 | before :each do 6 | @gnocchi_api_uwsgi_config = Puppet::Type.type(:gnocchi_api_uwsgi_config).new(:name => 'DEFAULT/foo', :value => 'bar') 7 | end 8 | 9 | it 'should require a name' do 10 | expect { 11 | Puppet::Type.type(:gnocchi_api_uwsgi_config).new({}) 12 | }.to raise_error(Puppet::Error, 'Title or name must be provided') 13 | end 14 | 15 | it 'should not expect a name with whitespace' do 16 | expect { 17 | Puppet::Type.type(:gnocchi_api_uwsgi_config).new(:name => 'f oo') 18 | }.to raise_error(Puppet::Error, /Parameter name failed/) 19 | end 20 | 21 | it 'should fail when there is no section' do 22 | expect { 23 | Puppet::Type.type(:gnocchi_api_uwsgi_config).new(:name => 'foo') 24 | }.to raise_error(Puppet::Error, /Parameter name failed/) 25 | end 26 | 27 | it 'should not require a value when ensure is absent' do 28 | Puppet::Type.type(:gnocchi_api_uwsgi_config).new(:name => 'DEFAULT/foo', :ensure => :absent) 29 | end 30 | 31 | it 'should accept a valid value' do 32 | @gnocchi_api_uwsgi_config[:value] = 'bar' 33 | expect(@gnocchi_api_uwsgi_config[:value]).to eq('bar') 34 | end 35 | 36 | it 'should accept a value with whitespace' do 37 | @gnocchi_api_uwsgi_config[:value] = 'b ar' 38 | expect(@gnocchi_api_uwsgi_config[:value]).to eq('b ar') 39 | end 40 | 41 | it 'should accept valid ensure values' do 42 | @gnocchi_api_uwsgi_config[:ensure] = :present 43 | expect(@gnocchi_api_uwsgi_config[:ensure]).to eq(:present) 44 | @gnocchi_api_uwsgi_config[:ensure] = :absent 45 | expect(@gnocchi_api_uwsgi_config[:ensure]).to eq(:absent) 46 | end 47 | 48 | it 'should not accept invalid ensure values' do 49 | expect { 50 | @gnocchi_api_uwsgi_config[:ensure] = :latest 51 | }.to raise_error(Puppet::Error, /Invalid value/) 52 | end 53 | 54 | it 'should autorequire the package that install the file' do 55 | catalog = Puppet::Resource::Catalog.new 56 | anchor = Puppet::Type.type(:anchor).new(:name => 'gnocchi::install::end') 57 | catalog.add_resource anchor, @gnocchi_api_uwsgi_config 58 | dependency = @gnocchi_api_uwsgi_config.autorequire 59 | expect(dependency.size).to eq(1) 60 | expect(dependency[0].target).to eq(@gnocchi_api_uwsgi_config) 61 | expect(dependency[0].source).to eq(anchor) 62 | end 63 | 64 | end 65 | -------------------------------------------------------------------------------- /spec/unit/type/gnocchi_config_spec.rb: -------------------------------------------------------------------------------- 1 | require 'puppet' 2 | require 'puppet/type/gnocchi_config' 3 | 4 | describe 'Puppet::Type.type(:gnocchi_config)' do 5 | before :each do 6 | @gnocchi_config = Puppet::Type.type(:gnocchi_config).new(:name => 'DEFAULT/foo', :value => 'bar') 7 | end 8 | 9 | it 'should require a name' do 10 | expect { 11 | Puppet::Type.type(:gnocchi_config).new({}) 12 | }.to raise_error(Puppet::Error, 'Title or name must be provided') 13 | end 14 | 15 | it 'should not expect a name with whitespace' do 16 | expect { 17 | Puppet::Type.type(:gnocchi_config).new(:name => 'f oo') 18 | }.to raise_error(Puppet::Error, /Parameter name failed/) 19 | end 20 | 21 | it 'should fail when there is no section' do 22 | expect { 23 | Puppet::Type.type(:gnocchi_config).new(:name => 'foo') 24 | }.to raise_error(Puppet::Error, /Parameter name failed/) 25 | end 26 | 27 | it 'should not require a value when ensure is absent' do 28 | Puppet::Type.type(:gnocchi_config).new(:name => 'DEFAULT/foo', :ensure => :absent) 29 | end 30 | 31 | it 'should accept a valid value' do 32 | @gnocchi_config[:value] = 'bar' 33 | expect(@gnocchi_config[:value]).to eq(['bar']) 34 | end 35 | 36 | it 'should accept a value with whitespace' do 37 | @gnocchi_config[:value] = 'b ar' 38 | expect(@gnocchi_config[:value]).to eq(['b ar']) 39 | end 40 | 41 | it 'should accept valid ensure values' do 42 | @gnocchi_config[:ensure] = :present 43 | expect(@gnocchi_config[:ensure]).to eq(:present) 44 | @gnocchi_config[:ensure] = :absent 45 | expect(@gnocchi_config[:ensure]).to eq(:absent) 46 | end 47 | 48 | it 'should not accept invalid ensure values' do 49 | expect { 50 | @gnocchi_config[:ensure] = :latest 51 | }.to raise_error(Puppet::Error, /Invalid value/) 52 | end 53 | 54 | it 'should autorequire the package that install the file' do 55 | catalog = Puppet::Resource::Catalog.new 56 | anchor = Puppet::Type.type(:anchor).new(:name => 'gnocchi::install::end') 57 | catalog.add_resource anchor, @gnocchi_config 58 | dependency = @gnocchi_config.autorequire 59 | expect(dependency.size).to eq(1) 60 | expect(dependency[0].target).to eq(@gnocchi_config) 61 | expect(dependency[0].source).to eq(anchor) 62 | end 63 | 64 | end 65 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | minversion = 3.1 3 | skipsdist = True 4 | envlist = releasenotes 5 | ignore_basepython_conflict = True 6 | 7 | [testenv] 8 | basepython = python3 9 | 10 | [testenv:releasenotes] 11 | deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} 12 | -r{toxinidir}/doc/requirements.txt 13 | commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html 14 | --------------------------------------------------------------------------------