From 57af2573d691fee356eb2f89abd715f32d6cec70 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sun, 8 Dec 2019 15:15:52 +0100 Subject: [PATCH] Convert all class usage to relative names Change-Id: I3c86c44a0e190ea92180e792a291d4ee5ff63da0 --- examples/init.pp | 2 +- manifests/api.pp | 14 +-- manifests/api/logging.pp | 2 +- manifests/client.pp | 6 +- manifests/config.pp | 4 +- manifests/db.pp | 2 +- manifests/db/mysql.pp | 4 +- manifests/db/postgresql.pp | 4 +- manifests/db/sync.pp | 2 +- manifests/init.pp | 2 +- manifests/keystone/auth.pp | 2 +- manifests/keystone/authtoken.pp | 2 +- manifests/keystone/notification.pp | 2 +- manifests/params.pp | 2 +- manifests/plugins/dogtag.pp | 4 +- manifests/plugins/kmip.pp | 2 +- manifests/plugins/p11_crypto.pp | 2 +- manifests/plugins/simple_crypto.pp | 2 +- manifests/policy.pp | 4 +- manifests/quota.pp | 12 +-- manifests/worker.pp | 2 +- manifests/wsgi/apache.pp | 136 ++++++++++++------------- spec/acceptance/basic_barbican_spec.rb | 10 +- spec/classes/barbican_api_spec.rb | 16 +-- 24 files changed, 115 insertions(+), 125 deletions(-) diff --git a/examples/init.pp b/examples/init.pp index 89ff4f7f..17c222fa 100644 --- a/examples/init.pp +++ b/examples/init.pp @@ -9,4 +9,4 @@ # Learn more about module testing here: # https://puppet.com/docs/puppet/latest/bgtm.html#testing-your-module # -include ::barbican +include barbican diff --git a/manifests/api.pp b/manifests/api.pp index 9987f597..eedbb714 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -305,10 +305,10 @@ class barbican::api ( $max_request_body_size = $::os_service_default, ) inherits barbican::params { - include ::barbican::deps - include ::barbican::db - include ::barbican::client - include ::barbican::policy + include barbican::deps + include barbican::db + include barbican::client + include barbican::policy # TODO: Remove the posix users and permissions and merge this definition # with the previous one, once the barbican package has been updated @@ -410,7 +410,7 @@ class barbican::api ( # keystone config if $auth_strategy == 'keystone' { - include ::barbican::keystone::authtoken + include barbican::keystone::authtoken barbican_api_paste_ini { 'pipeline:barbican_api/pipeline': value => 'cors authtoken context apiapp'; @@ -463,7 +463,7 @@ class barbican::api ( } if $sync_db { - include ::barbican::db::sync + include barbican::db::sync } if $service_name == 'barbican-api' { @@ -487,7 +487,7 @@ class barbican::api ( } } elsif $service_name == 'httpd' { - include ::apache::params + include apache::params # Ubuntu packages does not have a barbican-api service if $::os_package_type != 'ubuntu' { service { 'barbican-api': diff --git a/manifests/api/logging.pp b/manifests/api/logging.pp index ed158a05..9b76bd65 100644 --- a/manifests/api/logging.pp +++ b/manifests/api/logging.pp @@ -123,7 +123,7 @@ class barbican::api::logging( $log_date_format = $::os_service_default, ) { - include ::barbican::deps + include barbican::deps oslo::log { 'barbican_config': debug => $debug, diff --git a/manifests/client.pp b/manifests/client.pp index e65d2ec3..7a58e4fd 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -12,8 +12,8 @@ class barbican::client ( $ensure = 'present', ) { - include ::barbican::deps - include ::barbican::params + include barbican::deps + include barbican::params package { 'python-barbicanclient': ensure => $ensure, @@ -21,5 +21,5 @@ class barbican::client ( tag => 'openstack', } - include '::openstacklib::openstackclient' + include openstacklib::openstackclient } diff --git a/manifests/config.pp b/manifests/config.pp index c145ecc8..2717ac9d 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -27,11 +27,11 @@ # or Puppet catalog compilation will fail with duplicate resources. # class barbican::config ( - $api_config = {}, + $api_config = {}, $api_paste_ini_config = {}, ) { - include ::barbican::deps + include barbican::deps validate_legacy(Hash, 'validate_hash', $api_config) validate_legacy(Hash, 'validate_hash', $api_paste_ini_config) diff --git a/manifests/db.pp b/manifests/db.pp index 130bd173..05812e44 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -73,7 +73,7 @@ class barbican::db ( $database_idle_timeout = undef, ) { - include ::barbican::deps + include barbican::deps if $database_idle_timeout { warning('The database_idle_timeout parameter is deprecated. Please use \ diff --git a/manifests/db/mysql.pp b/manifests/db/mysql.pp index 410b6f47..993829ff 100644 --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@ -43,11 +43,11 @@ class barbican::db::mysql( $allowed_hosts = undef ) { - include ::barbican::deps + include barbican::deps validate_legacy(String, 'validate_string', $password) - ::openstacklib::db::mysql { 'barbican': + openstacklib::db::mysql { 'barbican': user => $user, password_hash => mysql::password($password), dbname => $dbname, diff --git a/manifests/db/postgresql.pp b/manifests/db/postgresql.pp index 54f99962..ecf694ef 100644 --- a/manifests/db/postgresql.pp +++ b/manifests/db/postgresql.pp @@ -32,9 +32,9 @@ class barbican::db::postgresql( $privileges = 'ALL', ) { - include ::barbican::deps + include barbican::deps - ::openstacklib::db::postgresql { 'barbican': + openstacklib::db::postgresql { 'barbican': password_hash => postgresql_password($user, $password), dbname => $dbname, user => $user, diff --git a/manifests/db/sync.pp b/manifests/db/sync.pp index bd0b9173..040de0db 100644 --- a/manifests/db/sync.pp +++ b/manifests/db/sync.pp @@ -18,7 +18,7 @@ class barbican::db::sync( $secret_store_extra_params = undef, ) { - include ::barbican::deps + include barbican::deps exec { 'barbican-db-manage': command => "barbican-manage db upgrade ${extra_params}", diff --git a/manifests/init.pp b/manifests/init.pp index a8731221..1df7f237 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -9,6 +9,6 @@ # class barbican { - include ::barbican::params + include barbican::params } diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index faa9cf37..d3d00585 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -79,7 +79,7 @@ class barbican::keystone::auth ( $admin_url = 'http://127.0.0.1:9311', ) { - include ::barbican::deps + include barbican::deps if $configure_user_role { Keystone_user_role["${auth_name}@${tenant}"] ~> Anchor['barbican::service::end'] diff --git a/manifests/keystone/authtoken.pp b/manifests/keystone/authtoken.pp index 8ab03071..6e6550b2 100644 --- a/manifests/keystone/authtoken.pp +++ b/manifests/keystone/authtoken.pp @@ -214,7 +214,7 @@ class barbican::keystone::authtoken( $service_token_roles_required = $::os_service_default, ) { - include ::barbican::deps + include barbican::deps if is_service_default($password) { fail('Please set password for barbican service user') diff --git a/manifests/keystone/notification.pp b/manifests/keystone/notification.pp index bc0a47b6..697dab02 100644 --- a/manifests/keystone/notification.pp +++ b/manifests/keystone/notification.pp @@ -32,7 +32,7 @@ class barbican::keystone::notification ( $keystone_notification_thread_pool_size = $::os_service_default, ) { - include ::barbican::deps + include barbican::deps barbican_config { 'keystone_notifications/enable': value => $enable_keystone_notification; diff --git a/manifests/params.pp b/manifests/params.pp index bbc2d6e6..4bcd7537 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -3,7 +3,7 @@ # Parameters for puppet-barbican # class barbican::params { - include ::openstacklib::defaults + include openstacklib::defaults $pyvers = $::openstacklib::defaults::pyvers $client_package_name = "python${pyvers}-barbicanclient" diff --git a/manifests/plugins/dogtag.pp b/manifests/plugins/dogtag.pp index 135318c9..21b2b19d 100644 --- a/manifests/plugins/dogtag.pp +++ b/manifests/plugins/dogtag.pp @@ -57,8 +57,8 @@ class barbican::plugins::dogtag ( $global_default = false, ) { - include ::barbican::deps - include ::barbican::params + include barbican::deps + include barbican::params if $dogtag_plugin_nss_password == undef { fail('dogtag_plugin_nss_password must be defined') diff --git a/manifests/plugins/kmip.pp b/manifests/plugins/kmip.pp index 7aced576..153544e2 100644 --- a/manifests/plugins/kmip.pp +++ b/manifests/plugins/kmip.pp @@ -49,7 +49,7 @@ class barbican::plugins::kmip ( $global_default = false, ) { - include ::barbican::deps + include barbican::deps if $kmip_plugin_host == undef { fail('kmip_plugin_host must be defined') diff --git a/manifests/plugins/p11_crypto.pp b/manifests/plugins/p11_crypto.pp index 289f9553..052753a4 100644 --- a/manifests/plugins/p11_crypto.pp +++ b/manifests/plugins/p11_crypto.pp @@ -71,7 +71,7 @@ class barbican::plugins::p11_crypto ( $global_default = false, ) { - include ::barbican::deps + include barbican::deps if $p11_crypto_plugin_library_path == undef { fail('p11_crypto_plugin_library_path must be defined') diff --git a/manifests/plugins/simple_crypto.pp b/manifests/plugins/simple_crypto.pp index aac5da7c..c822325f 100644 --- a/manifests/plugins/simple_crypto.pp +++ b/manifests/plugins/simple_crypto.pp @@ -17,7 +17,7 @@ class barbican::plugins::simple_crypto ( $global_default = false, ) { - include ::barbican::deps + include barbican::deps barbican_config { 'secretstore:simple_crypto/secret_store_plugin': value => 'store_crypto'; diff --git a/manifests/policy.pp b/manifests/policy.pp index 41412ceb..bafe7ffc 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -28,8 +28,8 @@ class barbican::policy ( $policy_path = '/etc/barbican/policy.json', ) { - include ::barbican::deps - include ::barbican::params + include barbican::deps + include barbican::params validate_legacy(Hash, 'validate_hash', $policies) diff --git a/manifests/quota.pp b/manifests/quota.pp index 38308dc3..2618aee5 100644 --- a/manifests/quota.pp +++ b/manifests/quota.pp @@ -25,14 +25,14 @@ # Defaults to $::os_service_default # class barbican::quota ( - $quota_secrets = $::os_service_default, - $quota_orders = $::os_service_default, - $quota_containers = $::os_service_default, - $quota_consumers = $::os_service_default, - $quota_cas = $::os_service_default, + $quota_secrets = $::os_service_default, + $quota_orders = $::os_service_default, + $quota_containers = $::os_service_default, + $quota_consumers = $::os_service_default, + $quota_cas = $::os_service_default, ) { - include ::barbican::deps + include barbican::deps barbican_config { 'quotas/quota_secrets': value => $quota_secrets; diff --git a/manifests/worker.pp b/manifests/worker.pp index fc4050d1..24e8810a 100644 --- a/manifests/worker.pp +++ b/manifests/worker.pp @@ -39,7 +39,7 @@ class barbican::worker ( $enabled = true, ) inherits barbican::params { - include ::barbican::deps + include barbican::deps package { 'barbican-worker': ensure => $package_ensure, diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index aebdf013..1d9d7e47 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -9,81 +9,81 @@ # # == Parameters # -# [*servername*] -# The servername for the virtualhost. -# Optional. Defaults to $::fqdn +# [*servername*] +# The servername for the virtualhost. +# Optional. Defaults to $::fqdn # -# [*public_port*] -# The public port. -# Optional. Defaults to 9311 +# [*public_port*] +# The public port. +# Optional. Defaults to 9311 # -# [*bind_host*] -# The host/ip address Apache will listen on. -# Optional. Defaults to undef (listen on all ip addresses). +# [*bind_host*] +# The host/ip address Apache will listen on. +# Optional. Defaults to undef (listen on all ip addresses). # -# [*public_path*] -# The prefix for the public endpoint. -# Optional. Defaults to '/' +# [*public_path*] +# The prefix for the public endpoint. +# Optional. Defaults to '/' # -# [*ssl*] -# Use ssl ? (boolean) -# Optional. Defaults to true +# [*ssl*] +# Use ssl ? (boolean) +# Optional. Defaults to true # -# [*workers*] -# Number of WSGI workers to spawn. -# Optional. Defaults to $::os_workers +# [*workers*] +# Number of WSGI workers to spawn. +# Optional. Defaults to $::os_workers # -# [*ssl_cert*] -# (optional) Path to SSL certificate -# Default to apache::vhost 'ssl_*' defaults. +# [*ssl_cert*] +# (optional) Path to SSL certificate +# Default to apache::vhost 'ssl_*' defaults. # -# [*ssl_key*] -# (optional) Path to SSL key -# Default to apache::vhost 'ssl_*' defaults. +# [*ssl_key*] +# (optional) Path to SSL key +# Default to apache::vhost 'ssl_*' defaults. # -# [*ssl_chain*] -# (optional) SSL chain -# Default to apache::vhost 'ssl_*' defaults. +# [*ssl_chain*] +# (optional) SSL chain +# Default to apache::vhost 'ssl_*' defaults. # -# [*ssl_ca*] -# (optional) Path to SSL certificate authority -# Default to apache::vhost 'ssl_*' defaults. +# [*ssl_ca*] +# (optional) Path to SSL certificate authority +# Default to apache::vhost 'ssl_*' defaults. # -# [*ssl_crl_path*] -# (optional) Path to SSL certificate revocation list -# Default to apache::vhost 'ssl_*' defaults. +# [*ssl_crl_path*] +# (optional) Path to SSL certificate revocation list +# Default to apache::vhost 'ssl_*' defaults. # -# [*ssl_crl*] -# (optional) SSL certificate revocation list name -# Default to apache::vhost 'ssl_*' defaults. +# [*ssl_crl*] +# (optional) SSL certificate revocation list name +# Default to apache::vhost 'ssl_*' defaults. # -# [*ssl_certs_dir*] -# apache::vhost ssl parameters. -# Optional. Default to apache::vhost 'ssl_*' defaults. +# [*ssl_certs_dir*] +# apache::vhost ssl parameters. +# Optional. Default to apache::vhost 'ssl_*' defaults. # -# [*priority*] -# (optional) The priority for the vhost. -# Defaults to '10' +# [*priority*] +# (optional) The priority for the vhost. +# Defaults to '10' # -# [*threads*] -# (optional) The number of threads for the vhost. -# Defaults to 1 +# [*threads*] +# (optional) The number of threads for the vhost. +# Defaults to 1 # -# [*wsgi_process_display_name*] -# (optional) Name of the WSGI process display-name. -# Defaults to undef +# [*wsgi_process_display_name*] +# (optional) Name of the WSGI process display-name. +# Defaults to undef # -# [*access_log_file*] -# The log file name for the virtualhost. -# Optional. Defaults to false. +# [*access_log_file*] +# The log file name for the virtualhost. +# Optional. Defaults to false. # -# [*access_log_format*] -# The log format for the virtualhost. -# Optional. Defaults to false. +# [*access_log_format*] +# The log format for the virtualhost. +# Optional. Defaults to false. # -# [*error_log_file*] -# The error log file name for the virtualhost. -# Optional. Defaults to undef. +# [*error_log_file*] +# The error log file name for the virtualhost. +# Optional. Defaults to undef. # # [*custom_wsgi_process_options*] # (optional) gives you the oportunity to add custom process options or to @@ -93,16 +93,6 @@ # { python-path => '/my/python/virtualenv' } # Defaults to {} # -# == Dependencies -# -# requires Class['apache'] & Class['barbican'] -# -# == Examples -# -# include apache -# -# class { 'barbican::wsgi::apache': } -# # == Authors # # Ade Lee @@ -134,12 +124,12 @@ class barbican::wsgi::apache ( $custom_wsgi_process_options = {}, ) { - include ::barbican::deps - include ::barbican::params - include ::apache - include ::apache::mod::wsgi + include barbican::deps + include barbican::params + include apache + include apache::mod::wsgi if $ssl { - include ::apache::mod::ssl + include apache::mod::ssl } Service['httpd'] -> Keystone_endpoint <| |> @@ -162,7 +152,7 @@ class barbican::wsgi::apache ( Package<| tag == 'barbican-api' |> -> File[$::barbican::params::httpd_config_file] File[$::barbican::params::httpd_config_file] ~> Service['httpd'] - ::openstacklib::wsgi::apache { 'barbican_wsgi_main': + openstacklib::wsgi::apache { 'barbican_wsgi_main': bind_host => $bind_host, bind_port => $public_port, group => 'barbican', diff --git a/spec/acceptance/basic_barbican_spec.rb b/spec/acceptance/basic_barbican_spec.rb index 6b6092a5..2802b0fa 100644 --- a/spec/acceptance/basic_barbican_spec.rb +++ b/spec/acceptance/basic_barbican_spec.rb @@ -21,11 +21,11 @@ require 'spec_helper_acceptance' describe 'barbican::api basic test class' do context 'default parameters' do pp= <<-EOS - include ::openstack_integration - include ::openstack_integration::repos - include ::openstack_integration::mysql - include ::openstack_integration::keystone - include ::openstack_integration::barbican + include openstack_integration + include openstack_integration::repos + include openstack_integration::mysql + include openstack_integration::keystone + include openstack_integration::barbican EOS it 'should work with no errors' do diff --git a/spec/classes/barbican_api_spec.rb b/spec/classes/barbican_api_spec.rb index 4d32c480..301782d0 100644 --- a/spec/classes/barbican_api_spec.rb +++ b/spec/classes/barbican_api_spec.rb @@ -114,7 +114,7 @@ describe 'barbican::api' do describe "when #{param_set == {} ? "using default" : "specifying"} class parameters" do let :pre_condition do 'class { "barbican::keystone::authtoken": password => "secret", } - include ::apache' + include apache' end let :param_hash do @@ -203,7 +203,7 @@ describe 'barbican::api' do describe 'with enable_proxy_headers_parsing' do let :pre_condition do 'class { "barbican::keystone::authtoken": password => "secret", } - include ::apache' + include apache' end let :params do @@ -218,7 +218,7 @@ describe 'barbican::api' do describe 'with max_request_body_size' do let :pre_condition do 'class { "barbican::keystone::authtoken": password => "secret", } - include ::apache' + include apache' end let :params do @@ -233,7 +233,7 @@ describe 'barbican::api' do describe 'with SSL socket options set' do let :pre_condition do 'class { "barbican::keystone::authtoken": password => "secret", } - include ::apache' + include apache' end let :params do @@ -253,7 +253,7 @@ describe 'barbican::api' do describe 'with SSL socket options left by default' do let :pre_condition do 'class { "barbican::keystone::authtoken": password => "secret", } - include ::apache' + include apache' end let :params do @@ -270,7 +270,7 @@ describe 'barbican::api' do describe 'with SSL socket options set wrongly configured' do let :pre_condition do 'class { "barbican::keystone::authtoken": password => "secret", } - include ::apache' + include apache' end let :params do @@ -287,7 +287,7 @@ describe 'barbican::api' do describe 'with keystone auth' do let :pre_condition do 'class { "barbican::keystone::authtoken": password => "secret", } - include ::apache' + include apache' end let :params do @@ -367,7 +367,7 @@ describe 'barbican::api' do it_behaves_like 'barbican api redhat' when 'Debian' let :pre_condition do - 'include ::apache' + 'include apache' end let (:platform_params) do { :service_name => 'httpd' }