Convert all class usage to relative names

Change-Id: I9982b8476ca9dab8a338b66db75d6da6519f9266
This commit is contained in:
Tobias Urdin 2019-12-08 23:07:36 +01:00
parent b4ab38b179
commit 5f6411c3dd
29 changed files with 66 additions and 66 deletions

View File

@ -55,20 +55,20 @@ documentation to assist you in understanding the available deployment options.
```puppet
# enable heat resources
class { '::heat':
class { 'heat':
default_transport_url => 'rabbit://heat:an_even_bigger_secret@127.0.0.1:5672/heat',
database_connection => 'mysql+pymysql://heat:a_big_secret@127.0.0.1/heat?charset=utf8',
identity_uri => 'http://127.0.0.1:5000/',
keystone_password => 'a_big_secret',
}
class { '::heat::api': }
class { 'heat::api': }
class { '::heat::engine':
class { 'heat::engine':
auth_encryption_key => '1234567890AZERTYUIOPMLKJHGFDSQ12',
}
class { '::heat::api_cfn': }
class { 'heat::api_cfn': }
```
Implementation

View File

@ -4,27 +4,27 @@ node default {
}
# First, install a mysql server
class { '::mysql::server': }
class { 'mysql::server': }
# And create the database
class { '::heat::db::mysql':
class { 'heat::db::mysql':
password => 'heat',
}
class { '::heat::keystone::authtoken':
class { 'heat::keystone::authtoken':
password => 'password',
}
# Common class
class { '::heat':
class { 'heat':
sql_connection => 'mysql+pymysql://heat:heat@localhost/heat'
}
# Install heat-engine
class { '::heat::engine':
class { 'heat::engine':
auth_encryption_key => 'whatever-key-you-like',
}
# Install the heat-api service
class { '::heat::api': }
class { 'heat::api': }
}

View File

@ -68,10 +68,10 @@ class heat::api (
$service_name = $::heat::params::api_service_name,
) inherits heat::params {
include ::heat
include ::heat::deps
include ::heat::params
include ::heat::policy
include heat
include heat::deps
include heat::params
include heat::policy
if $use_ssl {
if is_service_default($cert_file) {
@ -106,7 +106,7 @@ class heat::api (
tag => 'heat-service',
}
} elsif $service_name == 'httpd' {
include ::apache::params
include apache::params
service { 'heat-api':
ensure => 'stopped',
name => $::heat::params::api_service_name,

View File

@ -71,10 +71,10 @@ class heat::api_cfn (
$service_name = $::heat::params::api_cfn_service_name,
) inherits heat::params {
include ::heat
include ::heat::deps
include ::heat::params
include ::heat::policy
include heat
include heat::deps
include heat::params
include heat::policy
if $use_ssl {
if is_service_default($cert_file) {
@ -109,7 +109,7 @@ class heat::api_cfn (
tag => 'heat-service',
}
} elsif $service_name == 'httpd' {
include ::apache::params
include apache::params
service { 'heat-api-cfn':
ensure => 'stopped',
name => $::heat::params::api_cfn_service_name,

View File

@ -102,7 +102,7 @@ class heat::cache (
$manage_backend_package = true,
) {
include ::heat::deps
include heat::deps
oslo::cache { 'heat_config':
config_prefix => $config_prefix,

View File

@ -11,8 +11,8 @@ class heat::client (
$ensure = 'present'
) {
include ::heat::deps
include ::heat::params
include heat::deps
include heat::params
package { 'python-heatclient':
ensure => $ensure,

View File

@ -28,7 +28,7 @@ class heat::config (
$heat_api_paste_ini = {},
) {
include ::heat::deps
include heat::deps
validate_legacy(Hash, 'validate_hash', $heat_config)
validate_legacy(Hash, 'validate_hash', $heat_api_paste_ini)

View File

@ -45,7 +45,7 @@ class heat::cors (
$allow_headers = $::os_service_default,
) {
include ::heat::deps
include heat::deps
oslo::cors { 'heat_config':
allowed_origin => $allowed_origin,

View File

@ -68,7 +68,7 @@ class heat::db (
$database_idle_timeout = undef,
) {
include ::heat::deps
include heat::deps
if $database_idle_timeout {
warning('The database_idle_timeout parameter is deprecated. Please use \
@ -102,7 +102,7 @@ database_connection_recycle_time instead.')
}
if $sync_db_real {
include ::heat::db::sync
include heat::db::sync
}
}

View File

@ -43,7 +43,7 @@ class heat::db::mysql(
$collate = 'utf8_general_ci',
) {
include ::heat::deps
include heat::deps
validate_legacy(String, 'validate_string', $password)

View File

@ -32,7 +32,7 @@ class heat::db::postgresql(
$privileges = 'ALL',
) {
include ::heat::deps
include heat::deps
::openstacklib::db::postgresql { 'heat':
password_hash => postgresql_password($user, $password),

View File

@ -13,7 +13,7 @@ class heat::db::sync(
$extra_params = '--config-file /etc/heat/heat.conf',
) {
include ::heat::deps
include heat::deps
exec { 'heat-dbsync':
command => "heat-manage ${extra_params} db_sync",

View File

@ -159,7 +159,7 @@ class heat::engine (
$heat_watch_server_url = undef,
) {
include ::heat::deps
include heat::deps
if $heat_watch_server_url {
warning('heat_watch_server_url has no effect and will be removed in a future release.')
@ -174,8 +174,8 @@ class heat::engine (
fail("${param_size} is not a correct size for auth_encryption_key parameter, it must be either 16, 24, 32 bytes long.")
}
include ::heat
include ::heat::params
include heat
include heat::params
# plugin_dirs value follows these rules:
# - default is $::os_service_default so Puppet won't try to configure it.

View File

@ -344,12 +344,12 @@ class heat(
$yaql_limit_iterators = $::os_service_default,
) {
include ::heat::db
include ::heat::deps
include ::heat::params
include heat::db
include heat::deps
include heat::params
if $auth_strategy == 'keystone' {
include ::heat::keystone::authtoken
include heat::keystone::authtoken
}
package { 'heat-common':

View File

@ -118,7 +118,7 @@ class heat::keystone::auth (
$manage_heat_stack_user_role = true,
) {
include ::heat::deps
include heat::deps
validate_legacy(String, 'validate_string', $password)

View File

@ -88,7 +88,7 @@ class heat::keystone::auth_cfn (
$internal_url = 'http://127.0.0.1:8000/v1',
) {
include ::heat::deps
include heat::deps
validate_legacy(String, 'validate_string', $password)

View File

@ -214,7 +214,7 @@ class heat::keystone::authtoken(
$service_token_roles_required = $::os_service_default,
) {
include ::heat::deps
include heat::deps
if is_service_default($password) {
fail('Please set password for heat service user')

View File

@ -45,8 +45,8 @@ class heat::keystone::domain (
$manage_config = true,
) {
include ::heat::deps
include ::heat::params
include heat::deps
include heat::params
if $manage_domain {
ensure_resource('keystone_domain', $domain_name, {

View File

@ -119,7 +119,7 @@ class heat::logging(
$log_date_format = $::os_service_default,
) {
include ::heat::deps
include heat::deps
oslo::log { 'heat_config':
debug => $debug,

View File

@ -3,7 +3,7 @@
# Parameters for puppet-heat
#
class heat::params {
include ::openstacklib::defaults
include openstacklib::defaults
$pyvers = $::openstacklib::defaults::pyvers
$client_package_name = "python${pyvers}-heatclient"

View File

@ -28,8 +28,8 @@ class heat::policy (
$policy_path = '/etc/heat/policy.json',
) {
include ::heat::deps
include ::heat::params
include heat::deps
include heat::params
validate_legacy(Hash, 'validate_hash', $policies)

View File

@ -129,12 +129,12 @@ define heat::wsgi::apache (
if $title !~ /^api(|_cfn)$/ {
fail('The valid options are api, api_cfn')
}
include ::heat::deps
include ::heat::params
include ::apache
include ::apache::mod::wsgi
include heat::deps
include heat::params
include apache
include apache::mod::wsgi
if $ssl {
include ::apache::mod::ssl
include apache::mod::ssl
}
::openstacklib::wsgi::apache { "heat_${title}_wsgi":

View File

@ -119,8 +119,8 @@ class heat::wsgi::apache_api_cfn (
) {
# See custom fragment below
include ::apache
include ::apache::mod::headers
include apache
include apache::mod::headers
validate_legacy(Integer, 'validate_integer', $port)

View File

@ -6,12 +6,12 @@ describe 'basic heat' do
it 'should work with no errors' do
pp= <<-EOS
include ::openstack_integration
include ::openstack_integration::repos
include ::openstack_integration::rabbitmq
include ::openstack_integration::mysql
include ::openstack_integration::keystone
include ::openstack_integration::heat
include openstack_integration
include openstack_integration::repos
include openstack_integration::rabbitmq
include openstack_integration::mysql
include openstack_integration::keystone
include openstack_integration::heat
EOS

View File

@ -97,7 +97,7 @@ describe 'heat::api_cfn' do
context 'with $sync_db set to false in ::heat' do
let :pre_condition do
"class { '::heat::keystone::authtoken':
"class { 'heat::keystone::authtoken':
password => 'a_big_secret',
}
class {'heat':

View File

@ -97,7 +97,7 @@ describe 'heat::api' do
context 'with $sync_db set to false in ::heat' do
let :pre_condition do
"class { '::heat::keystone::authtoken':
"class { 'heat::keystone::authtoken':
password => 'a_big_secret',
}
class {'heat':

View File

@ -21,7 +21,7 @@ describe 'heat::cron::purge_deleted' do
"class { 'heat::keystone::authtoken':
password => 'password',
}
include ::heat"
include heat"
end
describe 'with default parameters' do

View File

@ -7,11 +7,11 @@ describe 'heat::db::postgresql' do
end
let :pre_condition do
"include ::postgresql::server
class { '::heat::keystone::authtoken':
"include postgresql::server
class { 'heat::keystone::authtoken':
password => 'password',
}
include ::heat"
include heat"
end
context 'with only required parameters' do

View File

@ -2,7 +2,7 @@ require 'spec_helper'
describe 'heat' do
let :pre_condition do
"class { '::heat::keystone::authtoken':
"class { 'heat::keystone::authtoken':
password => 'secretpassword',
}"
end