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 ```puppet
# enable heat resources # enable heat resources
class { '::heat': class { 'heat':
default_transport_url => 'rabbit://heat:an_even_bigger_secret@127.0.0.1:5672/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', database_connection => 'mysql+pymysql://heat:a_big_secret@127.0.0.1/heat?charset=utf8',
identity_uri => 'http://127.0.0.1:5000/', identity_uri => 'http://127.0.0.1:5000/',
keystone_password => 'a_big_secret', keystone_password => 'a_big_secret',
} }
class { '::heat::api': } class { 'heat::api': }
class { '::heat::engine': class { 'heat::engine':
auth_encryption_key => '1234567890AZERTYUIOPMLKJHGFDSQ12', auth_encryption_key => '1234567890AZERTYUIOPMLKJHGFDSQ12',
} }
class { '::heat::api_cfn': } class { 'heat::api_cfn': }
``` ```
Implementation Implementation

View File

@ -4,27 +4,27 @@ node default {
} }
# First, install a mysql server # First, install a mysql server
class { '::mysql::server': } class { 'mysql::server': }
# And create the database # And create the database
class { '::heat::db::mysql': class { 'heat::db::mysql':
password => 'heat', password => 'heat',
} }
class { '::heat::keystone::authtoken': class { 'heat::keystone::authtoken':
password => 'password', password => 'password',
} }
# Common class # Common class
class { '::heat': class { 'heat':
sql_connection => 'mysql+pymysql://heat:heat@localhost/heat' sql_connection => 'mysql+pymysql://heat:heat@localhost/heat'
} }
# Install heat-engine # Install heat-engine
class { '::heat::engine': class { 'heat::engine':
auth_encryption_key => 'whatever-key-you-like', auth_encryption_key => 'whatever-key-you-like',
} }
# Install the heat-api service # 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, $service_name = $::heat::params::api_service_name,
) inherits heat::params { ) inherits heat::params {
include ::heat include heat
include ::heat::deps include heat::deps
include ::heat::params include heat::params
include ::heat::policy include heat::policy
if $use_ssl { if $use_ssl {
if is_service_default($cert_file) { if is_service_default($cert_file) {
@ -106,7 +106,7 @@ class heat::api (
tag => 'heat-service', tag => 'heat-service',
} }
} elsif $service_name == 'httpd' { } elsif $service_name == 'httpd' {
include ::apache::params include apache::params
service { 'heat-api': service { 'heat-api':
ensure => 'stopped', ensure => 'stopped',
name => $::heat::params::api_service_name, name => $::heat::params::api_service_name,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -68,7 +68,7 @@ class heat::db (
$database_idle_timeout = undef, $database_idle_timeout = undef,
) { ) {
include ::heat::deps include heat::deps
if $database_idle_timeout { if $database_idle_timeout {
warning('The database_idle_timeout parameter is deprecated. Please use \ warning('The database_idle_timeout parameter is deprecated. Please use \
@ -102,7 +102,7 @@ database_connection_recycle_time instead.')
} }
if $sync_db_real { 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', $collate = 'utf8_general_ci',
) { ) {
include ::heat::deps include heat::deps
validate_legacy(String, 'validate_string', $password) validate_legacy(String, 'validate_string', $password)

View File

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

View File

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

View File

@ -159,7 +159,7 @@ class heat::engine (
$heat_watch_server_url = undef, $heat_watch_server_url = undef,
) { ) {
include ::heat::deps include heat::deps
if $heat_watch_server_url { if $heat_watch_server_url {
warning('heat_watch_server_url has no effect and will be removed in a future release.') 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.") 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
include ::heat::params include heat::params
# plugin_dirs value follows these rules: # plugin_dirs value follows these rules:
# - default is $::os_service_default so Puppet won't try to configure it. # - 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, $yaql_limit_iterators = $::os_service_default,
) { ) {
include ::heat::db include heat::db
include ::heat::deps include heat::deps
include ::heat::params include heat::params
if $auth_strategy == 'keystone' { if $auth_strategy == 'keystone' {
include ::heat::keystone::authtoken include heat::keystone::authtoken
} }
package { 'heat-common': package { 'heat-common':

View File

@ -118,7 +118,7 @@ class heat::keystone::auth (
$manage_heat_stack_user_role = true, $manage_heat_stack_user_role = true,
) { ) {
include ::heat::deps include heat::deps
validate_legacy(String, 'validate_string', $password) 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', $internal_url = 'http://127.0.0.1:8000/v1',
) { ) {
include ::heat::deps include heat::deps
validate_legacy(String, 'validate_string', $password) validate_legacy(String, 'validate_string', $password)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,12 +6,12 @@ describe 'basic heat' 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::rabbitmq include openstack_integration::rabbitmq
include ::openstack_integration::mysql include openstack_integration::mysql
include ::openstack_integration::keystone include openstack_integration::keystone
include ::openstack_integration::heat include openstack_integration::heat
EOS EOS

View File

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

View File

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

View File

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

View File

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

View File

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