Convert all class usage to relative names
Change-Id: Id33f4d13a4547734f36a6437e0d0e6b1db37a9a1
This commit is contained in:
parent
05ee0bb433
commit
3a2a519bb2
|
@ -1,6 +1,6 @@
|
||||||
# This is an example of site.pp to deploy Gnocchi
|
# 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',
|
admin_url => 'http://10.0.0.1:8041',
|
||||||
internal_url => 'http://10.0.0.1:8041',
|
internal_url => 'http://10.0.0.1:8041',
|
||||||
public_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'
|
region => 'OpenStack'
|
||||||
}
|
}
|
||||||
|
|
||||||
class { '::gnocchi':
|
class { 'gnocchi':
|
||||||
database_connection => 'mysql+pymysql://gnocchi:secrete@10.0.0.1/gnocchi?charset=utf8',
|
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',
|
bind_host => '10.0.0.1',
|
||||||
identity_uri => 'https://identity.openstack.org:5000',
|
identity_uri => 'https://identity.openstack.org:5000',
|
||||||
keystone_password => 'verysecrete'
|
keystone_password => 'verysecrete'
|
||||||
}
|
}
|
||||||
|
|
||||||
class { '::gnocchi::statsd':
|
class { 'gnocchi::statsd':
|
||||||
resource_id => '07f26121-5777-48ba-8a0b-d70468133dd9',
|
resource_id => '07f26121-5777-48ba-8a0b-d70468133dd9',
|
||||||
archive_policy_name => 'high',
|
archive_policy_name => 'high',
|
||||||
flush_delay => '100',
|
flush_delay => '100',
|
||||||
}
|
}
|
||||||
|
|
||||||
include ::gnocchi::client
|
include gnocchi::client
|
||||||
|
|
|
@ -63,8 +63,8 @@ class gnocchi::api (
|
||||||
$middlewares = $::os_service_default,
|
$middlewares = $::os_service_default,
|
||||||
) inherits gnocchi::params {
|
) inherits gnocchi::params {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
include ::gnocchi::policy
|
include gnocchi::policy
|
||||||
|
|
||||||
package { 'gnocchi-api':
|
package { 'gnocchi-api':
|
||||||
ensure => $package_ensure,
|
ensure => $package_ensure,
|
||||||
|
@ -81,7 +81,7 @@ class gnocchi::api (
|
||||||
}
|
}
|
||||||
|
|
||||||
if $sync_db {
|
if $sync_db {
|
||||||
include ::gnocchi::db::sync
|
include gnocchi::db::sync
|
||||||
}
|
}
|
||||||
|
|
||||||
if $service_name == $::gnocchi::params::api_service_name {
|
if $service_name == $::gnocchi::params::api_service_name {
|
||||||
|
@ -94,7 +94,7 @@ class gnocchi::api (
|
||||||
tag => ['gnocchi-service', 'gnocchi-db-sync-service'],
|
tag => ['gnocchi-service', 'gnocchi-db-sync-service'],
|
||||||
}
|
}
|
||||||
} elsif $service_name == 'httpd' {
|
} elsif $service_name == 'httpd' {
|
||||||
include ::apache::params
|
include apache::params
|
||||||
|
|
||||||
service { 'gnocchi-api':
|
service { 'gnocchi-api':
|
||||||
ensure => 'stopped',
|
ensure => 'stopped',
|
||||||
|
@ -123,6 +123,6 @@ standalone service, or httpd for being run by a httpd server")
|
||||||
}
|
}
|
||||||
|
|
||||||
if $auth_strategy == 'keystone' {
|
if $auth_strategy == 'keystone' {
|
||||||
include ::gnocchi::keystone::authtoken
|
include gnocchi::keystone::authtoken
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,8 @@ class gnocchi::client (
|
||||||
$ensure = 'present'
|
$ensure = 'present'
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
include ::gnocchi::params
|
include gnocchi::params
|
||||||
|
|
||||||
package { 'python-gnocchiclient':
|
package { 'python-gnocchiclient':
|
||||||
ensure => $ensure,
|
ensure => $ensure,
|
||||||
|
|
|
@ -24,7 +24,7 @@ class gnocchi::config (
|
||||||
$gnocchi_config = {},
|
$gnocchi_config = {},
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
|
|
||||||
validate_legacy(Hash, 'validate_hash', $gnocchi_config)
|
validate_legacy(Hash, 'validate_hash', $gnocchi_config)
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ class gnocchi::cors (
|
||||||
$allow_headers = $::os_service_default,
|
$allow_headers = $::os_service_default,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
|
|
||||||
oslo::cors { 'gnocchi_config':
|
oslo::cors { 'gnocchi_config':
|
||||||
allowed_origin => $allowed_origin,
|
allowed_origin => $allowed_origin,
|
||||||
|
|
|
@ -17,7 +17,7 @@ class gnocchi::db (
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
) inherits gnocchi::params {
|
) inherits gnocchi::params {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
|
|
||||||
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
|
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
|
||||||
# to use gnocchi::<myparam> if gnocchi::db::<myparam> isn't specified.
|
# to use gnocchi::<myparam> if gnocchi::db::<myparam> isn't specified.
|
||||||
|
|
|
@ -43,7 +43,7 @@ class gnocchi::db::mysql(
|
||||||
$allowed_hosts = undef
|
$allowed_hosts = undef
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
|
|
||||||
validate_legacy(String, 'validate_string', $password)
|
validate_legacy(String, 'validate_string', $password)
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ class gnocchi::db::postgresql(
|
||||||
$privileges = 'ALL',
|
$privileges = 'ALL',
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
|
|
||||||
::openstacklib::db::postgresql { 'gnocchi':
|
::openstacklib::db::postgresql { 'gnocchi':
|
||||||
password_hash => postgresql_password($user, $password),
|
password_hash => postgresql_password($user, $password),
|
||||||
|
|
|
@ -15,7 +15,7 @@ class gnocchi::db::sync (
|
||||||
$extra_opts = undef,
|
$extra_opts = undef,
|
||||||
){
|
){
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
|
|
||||||
exec { 'gnocchi-db-sync':
|
exec { 'gnocchi-db-sync':
|
||||||
command => "gnocchi-upgrade --config-file /etc/gnocchi/gnocchi.conf ${extra_opts}",
|
command => "gnocchi-upgrade --config-file /etc/gnocchi/gnocchi.conf ${extra_opts}",
|
||||||
|
|
|
@ -23,8 +23,8 @@ class gnocchi (
|
||||||
$purge_config = false,
|
$purge_config = false,
|
||||||
) inherits gnocchi::params {
|
) inherits gnocchi::params {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
include ::gnocchi::db
|
include gnocchi::db
|
||||||
|
|
||||||
package { 'gnocchi':
|
package { 'gnocchi':
|
||||||
ensure => $package_ensure,
|
ensure => $package_ensure,
|
||||||
|
|
|
@ -79,7 +79,7 @@ class gnocchi::keystone::auth (
|
||||||
$service_description = 'OpenStack Metric Service',
|
$service_description = 'OpenStack Metric Service',
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
|
|
||||||
keystone::resource::service_identity { 'gnocchi':
|
keystone::resource::service_identity { 'gnocchi':
|
||||||
configure_user => $configure_user,
|
configure_user => $configure_user,
|
||||||
|
|
|
@ -214,7 +214,7 @@ class gnocchi::keystone::authtoken(
|
||||||
$service_token_roles_required = $::os_service_default,
|
$service_token_roles_required = $::os_service_default,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
|
|
||||||
if is_service_default($password) {
|
if is_service_default($password) {
|
||||||
fail('Please set password for Gnocchi service user')
|
fail('Please set password for Gnocchi service user')
|
||||||
|
|
|
@ -49,7 +49,7 @@ class gnocchi::logging(
|
||||||
$debug = $::os_service_default,
|
$debug = $::os_service_default,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
|
|
||||||
oslo::log { 'gnocchi_config':
|
oslo::log { 'gnocchi_config':
|
||||||
debug => $debug,
|
debug => $debug,
|
||||||
|
|
|
@ -36,7 +36,7 @@ class gnocchi::metricd (
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
) inherits gnocchi::params {
|
) inherits gnocchi::params {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
|
|
||||||
gnocchi_config {
|
gnocchi_config {
|
||||||
'metricd/workers': value => $workers;
|
'metricd/workers': value => $workers;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Parameters for puppet-gnocchi
|
# Parameters for puppet-gnocchi
|
||||||
#
|
#
|
||||||
class gnocchi::params {
|
class gnocchi::params {
|
||||||
include ::openstacklib::defaults
|
include openstacklib::defaults
|
||||||
$pyvers = $::openstacklib::defaults::pyvers
|
$pyvers = $::openstacklib::defaults::pyvers
|
||||||
|
|
||||||
$client_package_name = "python${pyvers}-gnocchiclient"
|
$client_package_name = "python${pyvers}-gnocchiclient"
|
||||||
|
|
|
@ -28,8 +28,8 @@ class gnocchi::policy (
|
||||||
$policy_path = '/etc/gnocchi/policy.json',
|
$policy_path = '/etc/gnocchi/policy.json',
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
include ::gnocchi::params
|
include gnocchi::params
|
||||||
|
|
||||||
validate_legacy(Hash, 'validate_hash', $policies)
|
validate_legacy(Hash, 'validate_hash', $policies)
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ class gnocchi::statsd (
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
) inherits gnocchi::params {
|
) inherits gnocchi::params {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
|
|
||||||
package { 'gnocchi-statsd':
|
package { 'gnocchi-statsd':
|
||||||
ensure => $package_ensure,
|
ensure => $package_ensure,
|
||||||
|
|
|
@ -35,7 +35,7 @@ class gnocchi::storage(
|
||||||
$metric_processing_delay = $::os_service_default,
|
$metric_processing_delay = $::os_service_default,
|
||||||
) inherits gnocchi::params {
|
) inherits gnocchi::params {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
|
|
||||||
if $coordination_url {
|
if $coordination_url {
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ class gnocchi::storage::ceph(
|
||||||
$manage_rados = false,
|
$manage_rados = false,
|
||||||
) inherits gnocchi::params {
|
) 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) {
|
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.')
|
fail('You need to specify either gnocchi::storage::ceph::ceph_keyring or gnocchi::storage::ceph::ceph_secret.')
|
||||||
|
|
|
@ -29,7 +29,7 @@ class gnocchi::storage::file(
|
||||||
$file_basepath = '/var/lib/gnocchi',
|
$file_basepath = '/var/lib/gnocchi',
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
|
|
||||||
gnocchi_config {
|
gnocchi_config {
|
||||||
'storage/driver': value => 'file';
|
'storage/driver': value => 'file';
|
||||||
|
|
|
@ -12,7 +12,7 @@ class gnocchi::storage::incoming::redis(
|
||||||
$redis_url = undef,
|
$redis_url = undef,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
|
|
||||||
gnocchi_config {
|
gnocchi_config {
|
||||||
'incoming/driver': value => 'redis';
|
'incoming/driver': value => 'redis';
|
||||||
|
|
|
@ -33,7 +33,7 @@ class gnocchi::storage::s3(
|
||||||
$s3_bucket_prefix = $::os_service_default,
|
$s3_bucket_prefix = $::os_service_default,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
|
|
||||||
gnocchi_config {
|
gnocchi_config {
|
||||||
'storage/driver': value => 's3';
|
'storage/driver': value => 's3';
|
||||||
|
|
|
@ -55,7 +55,7 @@ class gnocchi::storage::swift(
|
||||||
$swift_endpoint_type = $::os_service_default,
|
$swift_endpoint_type = $::os_service_default,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
|
|
||||||
gnocchi_config {
|
gnocchi_config {
|
||||||
'storage/driver': value => 'swift';
|
'storage/driver': value => 'swift';
|
||||||
|
|
|
@ -123,12 +123,12 @@ class gnocchi::wsgi::apache (
|
||||||
$custom_wsgi_process_options = {},
|
$custom_wsgi_process_options = {},
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::gnocchi::deps
|
include gnocchi::deps
|
||||||
include ::gnocchi::params
|
include gnocchi::params
|
||||||
include ::apache
|
include apache
|
||||||
include ::apache::mod::wsgi
|
include apache::mod::wsgi
|
||||||
if $ssl {
|
if $ssl {
|
||||||
include ::apache::mod::ssl
|
include apache::mod::ssl
|
||||||
}
|
}
|
||||||
|
|
||||||
::openstacklib::wsgi::apache { 'gnocchi_wsgi':
|
::openstacklib::wsgi::apache { 'gnocchi_wsgi':
|
||||||
|
|
|
@ -6,11 +6,11 @@ describe 'basic gnocchi' do
|
||||||
|
|
||||||
it 'should work with no errors' do
|
it 'should work with no errors' do
|
||||||
pp = <<-EOS
|
pp = <<-EOS
|
||||||
include ::openstack_integration
|
include openstack_integration
|
||||||
include ::openstack_integration::repos
|
include openstack_integration::repos
|
||||||
include ::openstack_integration::mysql
|
include openstack_integration::mysql
|
||||||
include ::openstack_integration::keystone
|
include openstack_integration::keystone
|
||||||
class { '::openstack_integration::gnocchi':
|
class { 'openstack_integration::gnocchi':
|
||||||
integration_enable => false,
|
integration_enable => false,
|
||||||
}
|
}
|
||||||
EOS
|
EOS
|
||||||
|
|
|
@ -4,8 +4,8 @@ describe 'gnocchi::api' do
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"class { 'gnocchi': }
|
"class { 'gnocchi': }
|
||||||
include ::gnocchi::db
|
include gnocchi::db
|
||||||
class { '::gnocchi::keystone::authtoken':
|
class { 'gnocchi::keystone::authtoken':
|
||||||
password => 'gnocchi-passw0rd',
|
password => 'gnocchi-passw0rd',
|
||||||
}"
|
}"
|
||||||
end
|
end
|
||||||
|
@ -25,10 +25,10 @@ describe 'gnocchi::api' do
|
||||||
end
|
end
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"include ::apache
|
"include apache
|
||||||
include ::gnocchi::db
|
include gnocchi::db
|
||||||
class { 'gnocchi': }
|
class { 'gnocchi': }
|
||||||
class { '::gnocchi::keystone::authtoken':
|
class { 'gnocchi::keystone::authtoken':
|
||||||
password => 'gnocchi-passw0rd',
|
password => 'gnocchi-passw0rd',
|
||||||
}"
|
}"
|
||||||
end
|
end
|
||||||
|
@ -121,10 +121,10 @@ describe 'gnocchi::api' do
|
||||||
end
|
end
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"include ::apache
|
"include apache
|
||||||
include ::gnocchi::db
|
include gnocchi::db
|
||||||
class { 'gnocchi': }
|
class { 'gnocchi': }
|
||||||
class { '::gnocchi::keystone::authtoken':
|
class { 'gnocchi::keystone::authtoken':
|
||||||
password => 'gnocchi-passw0rd',
|
password => 'gnocchi-passw0rd',
|
||||||
}"
|
}"
|
||||||
end
|
end
|
||||||
|
@ -145,10 +145,10 @@ describe 'gnocchi::api' do
|
||||||
end
|
end
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"include ::apache
|
"include apache
|
||||||
include ::gnocchi::db
|
include gnocchi::db
|
||||||
class { 'gnocchi': }
|
class { 'gnocchi': }
|
||||||
class { '::gnocchi::keystone::authtoken':
|
class { 'gnocchi::keystone::authtoken':
|
||||||
password => 'gnocchi-passw0rd',
|
password => 'gnocchi-passw0rd',
|
||||||
}"
|
}"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue