diff --git a/examples/site.pp b/examples/site.pp index 37fa62d7..a385ddc2 100644 --- a/examples/site.pp +++ b/examples/site.pp @@ -1,6 +1,6 @@ # This is an example of site.pp to deploy Gnocchi -class { '::gnocchi::keystone::auth': +class { 'gnocchi::keystone::auth': admin_url => 'http://10.0.0.1:8041', internal_url => 'http://10.0.0.1:8041', public_url => 'http://10.0.0.1:8041', @@ -8,20 +8,20 @@ class { '::gnocchi::keystone::auth': region => 'OpenStack' } -class { '::gnocchi': +class { 'gnocchi': database_connection => 'mysql+pymysql://gnocchi:secrete@10.0.0.1/gnocchi?charset=utf8', } -class { '::gnocchi::api': +class { 'gnocchi::api': bind_host => '10.0.0.1', identity_uri => 'https://identity.openstack.org:5000', keystone_password => 'verysecrete' } -class { '::gnocchi::statsd': +class { 'gnocchi::statsd': resource_id => '07f26121-5777-48ba-8a0b-d70468133dd9', archive_policy_name => 'high', flush_delay => '100', } -include ::gnocchi::client +include gnocchi::client diff --git a/manifests/api.pp b/manifests/api.pp index f76dd867..2414953d 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -63,8 +63,8 @@ class gnocchi::api ( $middlewares = $::os_service_default, ) inherits gnocchi::params { - include ::gnocchi::deps - include ::gnocchi::policy + include gnocchi::deps + include gnocchi::policy package { 'gnocchi-api': ensure => $package_ensure, @@ -81,7 +81,7 @@ class gnocchi::api ( } if $sync_db { - include ::gnocchi::db::sync + include gnocchi::db::sync } if $service_name == $::gnocchi::params::api_service_name { @@ -94,7 +94,7 @@ class gnocchi::api ( tag => ['gnocchi-service', 'gnocchi-db-sync-service'], } } elsif $service_name == 'httpd' { - include ::apache::params + include apache::params service { 'gnocchi-api': ensure => 'stopped', @@ -123,6 +123,6 @@ standalone service, or httpd for being run by a httpd server") } if $auth_strategy == 'keystone' { - include ::gnocchi::keystone::authtoken + include gnocchi::keystone::authtoken } } diff --git a/manifests/client.pp b/manifests/client.pp index 2b9f4b42..0550c3ec 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -9,8 +9,8 @@ class gnocchi::client ( $ensure = 'present' ) { - include ::gnocchi::deps - include ::gnocchi::params + include gnocchi::deps + include gnocchi::params package { 'python-gnocchiclient': ensure => $ensure, diff --git a/manifests/config.pp b/manifests/config.pp index fc596e21..f541d7ff 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -24,7 +24,7 @@ class gnocchi::config ( $gnocchi_config = {}, ) { - include ::gnocchi::deps + include gnocchi::deps validate_legacy(Hash, 'validate_hash', $gnocchi_config) diff --git a/manifests/cors.pp b/manifests/cors.pp index 6fd1b9ea..86ab152a 100644 --- a/manifests/cors.pp +++ b/manifests/cors.pp @@ -45,7 +45,7 @@ class gnocchi::cors ( $allow_headers = $::os_service_default, ) { - include ::gnocchi::deps + include gnocchi::deps oslo::cors { 'gnocchi_config': allowed_origin => $allowed_origin, diff --git a/manifests/db.pp b/manifests/db.pp index e735e30f..1ee811ab 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -17,7 +17,7 @@ class gnocchi::db ( $package_ensure = 'present', ) inherits gnocchi::params { - include ::gnocchi::deps + include gnocchi::deps # NOTE(spredzy): In order to keep backward compatibility we rely on the pick function # to use gnocchi:: if gnocchi::db:: isn't specified. diff --git a/manifests/db/mysql.pp b/manifests/db/mysql.pp index 158407b6..51806171 100644 --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@ -43,7 +43,7 @@ class gnocchi::db::mysql( $allowed_hosts = undef ) { - include ::gnocchi::deps + include gnocchi::deps validate_legacy(String, 'validate_string', $password) diff --git a/manifests/db/postgresql.pp b/manifests/db/postgresql.pp index 8e7fc751..069d8573 100644 --- a/manifests/db/postgresql.pp +++ b/manifests/db/postgresql.pp @@ -32,7 +32,7 @@ class gnocchi::db::postgresql( $privileges = 'ALL', ) { - include ::gnocchi::deps + include gnocchi::deps ::openstacklib::db::postgresql { 'gnocchi': password_hash => postgresql_password($user, $password), diff --git a/manifests/db/sync.pp b/manifests/db/sync.pp index 46c2357e..dec51252 100644 --- a/manifests/db/sync.pp +++ b/manifests/db/sync.pp @@ -15,7 +15,7 @@ class gnocchi::db::sync ( $extra_opts = undef, ){ - include ::gnocchi::deps + include gnocchi::deps exec { 'gnocchi-db-sync': command => "gnocchi-upgrade --config-file /etc/gnocchi/gnocchi.conf ${extra_opts}", diff --git a/manifests/init.pp b/manifests/init.pp index 4648eb6e..dc1b0cb1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -23,8 +23,8 @@ class gnocchi ( $purge_config = false, ) inherits gnocchi::params { - include ::gnocchi::deps - include ::gnocchi::db + include gnocchi::deps + include gnocchi::db package { 'gnocchi': ensure => $package_ensure, diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index 74449e1c..9fcfd548 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -79,7 +79,7 @@ class gnocchi::keystone::auth ( $service_description = 'OpenStack Metric Service', ) { - include ::gnocchi::deps + include gnocchi::deps keystone::resource::service_identity { 'gnocchi': configure_user => $configure_user, diff --git a/manifests/keystone/authtoken.pp b/manifests/keystone/authtoken.pp index 620634b6..c7eaf565 100644 --- a/manifests/keystone/authtoken.pp +++ b/manifests/keystone/authtoken.pp @@ -214,7 +214,7 @@ class gnocchi::keystone::authtoken( $service_token_roles_required = $::os_service_default, ) { - include ::gnocchi::deps + include gnocchi::deps if is_service_default($password) { fail('Please set password for Gnocchi service user') diff --git a/manifests/logging.pp b/manifests/logging.pp index 9ed37d5a..180b71ec 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -49,7 +49,7 @@ class gnocchi::logging( $debug = $::os_service_default, ) { - include ::gnocchi::deps + include gnocchi::deps oslo::log { 'gnocchi_config': debug => $debug, diff --git a/manifests/metricd.pp b/manifests/metricd.pp index 44583ad5..ba77071a 100644 --- a/manifests/metricd.pp +++ b/manifests/metricd.pp @@ -36,7 +36,7 @@ class gnocchi::metricd ( $package_ensure = 'present', ) inherits gnocchi::params { - include ::gnocchi::deps + include gnocchi::deps gnocchi_config { 'metricd/workers': value => $workers; diff --git a/manifests/params.pp b/manifests/params.pp index aa58da66..3c90098a 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -3,7 +3,7 @@ # Parameters for puppet-gnocchi # class gnocchi::params { - include ::openstacklib::defaults + include openstacklib::defaults $pyvers = $::openstacklib::defaults::pyvers $client_package_name = "python${pyvers}-gnocchiclient" diff --git a/manifests/policy.pp b/manifests/policy.pp index d79204aa..ee827386 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -28,8 +28,8 @@ class gnocchi::policy ( $policy_path = '/etc/gnocchi/policy.json', ) { - include ::gnocchi::deps - include ::gnocchi::params + include gnocchi::deps + include gnocchi::params validate_legacy(Hash, 'validate_hash', $policies) diff --git a/manifests/statsd.pp b/manifests/statsd.pp index 06785b2c..da260168 100644 --- a/manifests/statsd.pp +++ b/manifests/statsd.pp @@ -33,7 +33,7 @@ class gnocchi::statsd ( $package_ensure = 'present', ) inherits gnocchi::params { - include ::gnocchi::deps + include gnocchi::deps package { 'gnocchi-statsd': ensure => $package_ensure, diff --git a/manifests/storage.pp b/manifests/storage.pp index 09ff4061..afb33eec 100644 --- a/manifests/storage.pp +++ b/manifests/storage.pp @@ -35,7 +35,7 @@ class gnocchi::storage( $metric_processing_delay = $::os_service_default, ) inherits gnocchi::params { - include ::gnocchi::deps + include gnocchi::deps if $coordination_url { diff --git a/manifests/storage/ceph.pp b/manifests/storage/ceph.pp index e161ef0c..30013b90 100644 --- a/manifests/storage/ceph.pp +++ b/manifests/storage/ceph.pp @@ -63,7 +63,7 @@ class gnocchi::storage::ceph( $manage_rados = false, ) inherits gnocchi::params { - include ::gnocchi::deps + include gnocchi::deps if (is_service_default($ceph_keyring) and is_service_default($ceph_secret)) or (! $ceph_keyring and ! $ceph_secret) { fail('You need to specify either gnocchi::storage::ceph::ceph_keyring or gnocchi::storage::ceph::ceph_secret.') diff --git a/manifests/storage/file.pp b/manifests/storage/file.pp index 8e4c7580..8f414d2d 100644 --- a/manifests/storage/file.pp +++ b/manifests/storage/file.pp @@ -29,7 +29,7 @@ class gnocchi::storage::file( $file_basepath = '/var/lib/gnocchi', ) { - include ::gnocchi::deps + include gnocchi::deps gnocchi_config { 'storage/driver': value => 'file'; diff --git a/manifests/storage/incoming/redis.pp b/manifests/storage/incoming/redis.pp index 879ea4aa..74ca1cf4 100644 --- a/manifests/storage/incoming/redis.pp +++ b/manifests/storage/incoming/redis.pp @@ -12,7 +12,7 @@ class gnocchi::storage::incoming::redis( $redis_url = undef, ) { - include ::gnocchi::deps + include gnocchi::deps gnocchi_config { 'incoming/driver': value => 'redis'; diff --git a/manifests/storage/s3.pp b/manifests/storage/s3.pp index d0505cbb..9301de42 100644 --- a/manifests/storage/s3.pp +++ b/manifests/storage/s3.pp @@ -33,7 +33,7 @@ class gnocchi::storage::s3( $s3_bucket_prefix = $::os_service_default, ) { - include ::gnocchi::deps + include gnocchi::deps gnocchi_config { 'storage/driver': value => 's3'; diff --git a/manifests/storage/swift.pp b/manifests/storage/swift.pp index 327ee25d..9d5a21b3 100644 --- a/manifests/storage/swift.pp +++ b/manifests/storage/swift.pp @@ -55,7 +55,7 @@ class gnocchi::storage::swift( $swift_endpoint_type = $::os_service_default, ) { - include ::gnocchi::deps + include gnocchi::deps gnocchi_config { 'storage/driver': value => 'swift'; diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 3d058354..4e300e7c 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -123,12 +123,12 @@ class gnocchi::wsgi::apache ( $custom_wsgi_process_options = {}, ) { - include ::gnocchi::deps - include ::gnocchi::params - include ::apache - include ::apache::mod::wsgi + include gnocchi::deps + include gnocchi::params + include apache + include apache::mod::wsgi if $ssl { - include ::apache::mod::ssl + include apache::mod::ssl } ::openstacklib::wsgi::apache { 'gnocchi_wsgi': diff --git a/spec/acceptance/basic_gnocchi_spec.rb b/spec/acceptance/basic_gnocchi_spec.rb index 688305ce..65dc49a4 100644 --- a/spec/acceptance/basic_gnocchi_spec.rb +++ b/spec/acceptance/basic_gnocchi_spec.rb @@ -6,11 +6,11 @@ describe 'basic gnocchi' do it 'should work with no errors' do pp = <<-EOS - include ::openstack_integration - include ::openstack_integration::repos - include ::openstack_integration::mysql - include ::openstack_integration::keystone - class { '::openstack_integration::gnocchi': + include openstack_integration + include openstack_integration::repos + include openstack_integration::mysql + include openstack_integration::keystone + class { 'openstack_integration::gnocchi': integration_enable => false, } EOS diff --git a/spec/classes/gnocchi_api_spec.rb b/spec/classes/gnocchi_api_spec.rb index 21f84330..2da650f2 100644 --- a/spec/classes/gnocchi_api_spec.rb +++ b/spec/classes/gnocchi_api_spec.rb @@ -4,8 +4,8 @@ describe 'gnocchi::api' do let :pre_condition do "class { 'gnocchi': } - include ::gnocchi::db - class { '::gnocchi::keystone::authtoken': + include gnocchi::db + class { 'gnocchi::keystone::authtoken': password => 'gnocchi-passw0rd', }" end @@ -25,10 +25,10 @@ describe 'gnocchi::api' do end let :pre_condition do - "include ::apache - include ::gnocchi::db + "include apache + include gnocchi::db class { 'gnocchi': } - class { '::gnocchi::keystone::authtoken': + class { 'gnocchi::keystone::authtoken': password => 'gnocchi-passw0rd', }" end @@ -121,10 +121,10 @@ describe 'gnocchi::api' do end let :pre_condition do - "include ::apache - include ::gnocchi::db + "include apache + include gnocchi::db class { 'gnocchi': } - class { '::gnocchi::keystone::authtoken': + class { 'gnocchi::keystone::authtoken': password => 'gnocchi-passw0rd', }" end @@ -145,10 +145,10 @@ describe 'gnocchi::api' do end let :pre_condition do - "include ::apache - include ::gnocchi::db + "include apache + include gnocchi::db class { 'gnocchi': } - class { '::gnocchi::keystone::authtoken': + class { 'gnocchi::keystone::authtoken': password => 'gnocchi-passw0rd', }" end