Convert all class usage to relative names

Change-Id: Iea5de7192d01739024d17e9813fe591f230aaf4d
This commit is contained in:
Tobias Urdin 2019-12-08 23:08:32 +01:00
parent 99f407cb33
commit 5e6151be97
46 changed files with 107 additions and 107 deletions

View File

@ -46,28 +46,28 @@ To utilize the ironic module's functionality you will need to declare multiple r
```puppet
# enable Ironic resources
class { '::ironic':
class { 'ironic':
default_transport_url => 'rabbit://ironic:an_even_bigger_secret@127.0.0.1:5672/ironic',
database_connection => 'mysql://ironic:a_big_secret@127.0.0.1/ironic?charset=utf8',
}
class { '::ironic::db::mysql':
class { 'ironic::db::mysql':
password => 'a_big_secret',
}
class { '::ironic::keystone::auth':
class { 'ironic::keystone::auth':
password => 'a_big_secret',
}
class { '::ironic::client': }
class { 'ironic::client': }
class { '::ironic::conductor': }
class { 'ironic::conductor': }
class { '::ironic::api':
class { 'ironic::api':
admin_password => 'a_big_secret',
}
class { '::ironic::drivers::ipmi': }
class { 'ironic::drivers::ipmi': }
# alternatively, you can deploy Ironic with Bifrost. It's a collection of Ansible playbooks to configure
# and install Ironic in a stand-alone fashion (for more information visit https://docs.openstack.org/bifrost/latest/)

View File

@ -60,15 +60,15 @@ $baremetal_json_hosts = '
node 'db' {
class { '::mysql::server':
class { 'mysql::server':
config_hash => {
'bind_address' => '0.0.0.0',
},
}
class { '::mysql::ruby': }
class { 'mysql::ruby': }
class { '::ironic::db::mysql':
class { 'ironic::db::mysql':
password => $db_password,
dbname => $db_name,
user => $db_username,
@ -80,7 +80,7 @@ node 'db' {
node 'controller' {
class { '::ironic':
class { 'ironic':
db_password => $db_password,
db_name => $db_name,
db_user => $db_username,
@ -96,13 +96,13 @@ node 'controller' {
glance_api_servers => $glance_api_servers,
}
class { '::ironic::api': }
class { 'ironic::api': }
class { '::ironic::conductor': }
class { 'ironic::conductor': }
class { '::ironic::drivers::ipmi': }
class { 'ironic::drivers::ipmi': }
class { '::ironic::drivers::pxe':
class { 'ironic::drivers::pxe':
deploy_kernel => $deploy_kernel,
deploy_ramdisk => $deploy_ramdisk,
}
@ -111,7 +111,7 @@ node 'controller' {
node 'bifrost-controller' {
class { '::ironic::bifrost':
class { 'ironic::bifrost':
network_interface => 'eth1',
ironic_db_password => 'changeme',
mysql_password => 'changemetoo',

View File

@ -82,10 +82,10 @@ class ironic::api (
$max_request_body_size = $::os_service_default,
) inherits ironic::params {
include ::ironic::deps
include ::ironic::params
include ::ironic::policy
include ::ironic::api::authtoken
include ironic::deps
include ironic::params
include ironic::policy
include ironic::api::authtoken
# Configure ironic.conf
ironic_config {
@ -122,7 +122,7 @@ class ironic::api (
}
Keystone_endpoint<||> -> Service['ironic-api']
} elsif $service_name == 'httpd' {
include ::apache::params
include apache::params
service { 'ironic-api':
ensure => 'stopped',
name => $::ironic::params::api_service,

View File

@ -215,7 +215,7 @@ class ironic::api::authtoken(
$service_token_roles_required = $::os_service_default,
) {
include ::ironic::deps
include ironic::deps
if is_service_default($password) {
fail('Please set password for Ironic API service user')

View File

@ -190,7 +190,7 @@ class ironic::bifrost (
$ipmi_bridging = 'no',
) {
include ::ironic::deps
include ironic::deps
git { $git_dest_repo_folder:
ensure => $ensure,

View File

@ -30,8 +30,8 @@ class ironic::client (
$package_ensure = present
) {
include ::ironic::deps
include ::ironic::params
include ironic::deps
include ironic::params
package { 'python-ironicclient':
ensure => $package_ensure,

View File

@ -241,11 +241,11 @@ class ironic::conductor (
$allow_provisioning_in_maintenance = $::os_service_default,
) {
include ::ironic::deps
include ::ironic::params
include ironic::deps
include ironic::params
# For backward compatibility
include ::ironic::glance
include ironic::glance
if ($cleaning_network_name and !is_service_default($cleaning_network)) {
fail('cleaning_network_name and cleaning_network can not be specified at the same time.')
@ -267,7 +267,7 @@ class ironic::conductor (
# NOTE(dtantsur): all in-tree drivers are IPA-based, so it won't hurt
# including its manifest (which only contains configuration options)
include ::ironic::drivers::agent
include ironic::drivers::agent
# On Ubuntu, ipmitool dependency is missing and ironic-conductor fails to start.
# https://bugs.launchpad.net/cloud-archive/+bug/1572800

View File

@ -28,7 +28,7 @@ class ironic::config (
$ironic_api_paste_ini = {},
) {
include ::ironic::deps
include ironic::deps
validate_legacy(Hash, 'validate_hash', $ironic_config)
validate_legacy(Hash, 'validate_hash', $ironic_api_paste_ini)

View File

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

View File

@ -62,7 +62,7 @@ class ironic::db (
$database_idle_timeout = undef,
) {
include ::ironic::deps
include ironic::deps
if $database_idle_timeout {
warning('The database_idle_timeout parameter is deprecated. Please use \

View File

@ -54,7 +54,7 @@ class ironic::db::mysql (
$collate = 'utf8_general_ci',
) {
include ::ironic::deps
include ironic::deps
::openstacklib::db::mysql { 'ironic':
user => $user,

View File

@ -19,8 +19,8 @@ class ironic::db::online_data_migrations(
$migration_params = undef,
) {
include ::ironic::deps
include ::ironic::params
include ironic::deps
include ironic::params
exec { 'ironic-db-online-data-migrations':
command => "${::ironic::params::dbsync_command} ${extra_params} online_data_migrations ${migration_params}",

View File

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

View File

@ -12,8 +12,8 @@ class ironic::db::sync(
$extra_params = undef,
) {
include ::ironic::deps
include ::ironic::params
include ironic::deps
include ironic::params
# NOTE(dtantsur): previous ironic-dbsync was run as root. it will fail to run
# as "ironic" user, if there is an old log file owned by root. Let's fix it.

View File

@ -73,7 +73,7 @@ class ironic::drivers::agent (
$deploy_logs_swift_days_to_expire = $::os_service_default,
) {
include ::ironic::deps
include ironic::deps
# Configure ironic.conf
ironic_config {

View File

@ -81,8 +81,8 @@ class ironic::drivers::ansible (
$default_python_interpreter = $::os_service_default,
) {
include ::ironic::deps
include ::ironic::params
include ironic::deps
include ironic::params
# Configure ironic.conf
ironic_config {

View File

@ -23,8 +23,8 @@ class ironic::drivers::drac (
$package_ensure = 'present',
) {
include ::ironic::deps
include ::ironic::params
include ironic::deps
include ironic::params
ensure_packages('python-dracclient',
{

View File

@ -35,7 +35,7 @@ define ironic::drivers::hardware_interface (
$default = $::os_service_default,
) {
include ::ironic::deps
include ironic::deps
if !is_service_default($enabled_list) and !empty($enabled_list){
validate_legacy(Array, 'validate_array', $enabled_list)

View File

@ -46,8 +46,8 @@ class ironic::drivers::ilo (
$package_ensure = 'present',
) {
include ::ironic::deps
include ::ironic::params
include ironic::deps
include ironic::params
# Configure ironic.conf
ironic_config {

View File

@ -80,7 +80,7 @@ class ironic::drivers::inspector (
$service_url = undef,
) {
include ::ironic::deps
include ironic::deps
if $service_url {
warning("The ironic::drivers::inspector::service_url parameter is deprecated and \

View File

@ -34,7 +34,7 @@ class ironic::drivers::ipmi (
$min_command_interval = $::os_service_default,
) {
include ::ironic::deps
include ironic::deps
# Configure ironic.conf
ironic_config {

View File

@ -112,8 +112,8 @@ class ironic::drivers::pxe (
$ip_version = $::os_service_default,
) {
include ::ironic::deps
include ::ironic::pxe::common
include ironic::deps
include ironic::pxe::common
$tftp_root_real = pick($::ironic::pxe::common::tftp_root, $tftp_root)
$ipxe_timeout_real = pick($::ironic::pxe::common::ipxe_timeout, $ipxe_timeout)

View File

@ -34,8 +34,8 @@ class ironic::drivers::redfish (
$connection_retry_interval = $::os_service_default,
) {
include ::ironic::deps
include ::ironic::params
include ironic::deps
include ironic::params
ironic_config {
'redfish/connection_attempts': value => $connection_attempts;

View File

@ -12,8 +12,8 @@ class ironic::drivers::staging (
$package_ensure = present
) {
include ::ironic::deps
include ::ironic::params
include ironic::deps
include ironic::params
package { 'ironic-staging-drivers':
ensure => $package_ensure,

View File

@ -330,12 +330,12 @@ class ironic (
$versioned_notifications_topics = $::os_service_default,
) {
include ::ironic::deps
include ::ironic::db
include ::ironic::params
include ironic::deps
include ironic::db
include ironic::params
include ::ironic::glance
include ::ironic::neutron
include ironic::glance
include ironic::neutron
ensure_resource( 'package', 'ironic-common', {
ensure => $package_ensure,
@ -362,11 +362,11 @@ class ironic (
}
if $sync_db {
include ::ironic::db::sync
include ironic::db::sync
}
if $db_online_data_migrations {
include ::ironic::db::online_data_migrations
include ironic::db::online_data_migrations
}
oslo::messaging::default {'ironic_config':

View File

@ -299,13 +299,13 @@ class ironic::inspector (
$default_transport_url = 'fake://',
) {
include ::ironic::deps
include ::ironic::params
include ::ironic::pxe::common
include ::ironic::inspector::db
include ironic::deps
include ironic::params
include ironic::pxe::common
include ironic::inspector::db
if $auth_strategy == 'keystone' {
include ::ironic::inspector::authtoken
include ironic::inspector::authtoken
}
if !is_array($dnsmasq_ip_subnets) {
@ -423,7 +423,7 @@ class ironic::inspector (
}
if $sync_db {
include ::ironic::inspector::db::sync
include ironic::inspector::db::sync
}
if $enabled {

View File

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

View File

@ -12,8 +12,8 @@ class ironic::inspector::client (
$package_ensure = present
) {
include ::ironic::deps
include ::ironic::params
include ironic::deps
include ironic::params
package { 'python-ironic-inspector-client':
ensure => $package_ensure,

View File

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

View File

@ -62,7 +62,7 @@ class ironic::inspector::db (
$database_idle_timeout = undef,
) {
include ::ironic::params
include ironic::params
if $database_idle_timeout {
warning('The database_idle_timeout parameter is deprecated. Please use \

View File

@ -3,8 +3,8 @@
#
class ironic::inspector::db::sync {
include ::ironic::deps
include ::ironic::params
include ironic::deps
include ironic::params
exec { 'ironic-inspector-dbsync':
command => $::ironic::params::inspector_dbsync_command,

View File

@ -114,7 +114,7 @@ class ironic::inspector::logging(
$log_date_format = $::os_service_default,
) {
include ::ironic::deps
include ironic::deps
oslo::log { 'ironic_inspector_config':
debug => $debug,

View File

@ -28,7 +28,7 @@ class ironic::inspector::pxe_filter (
$sync_period = $::os_service_default,
) {
include ::ironic::deps
include ironic::deps
ironic_inspector_config {
'pxe_filter/driver': value => $driver;

View File

@ -36,8 +36,8 @@ class ironic::inspector::pxe_filter::dnsmasq (
$purge_dhcp_hostsdir = $::os_service_default,
) {
include ::ironic::deps
include ::ironic::inspector
include ironic::deps
include ironic::inspector
$hostsdir = pick($::ironic::inspector::dnsmasq_dhcp_hostsdir, $::os_service_default)

View File

@ -104,7 +104,7 @@ class ironic::keystone::auth (
$internal_url = 'http://127.0.0.1:6385',
) {
include ::ironic::deps
include ironic::deps
if $configure_user_role {
Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'ironic-server' |>

View File

@ -95,7 +95,7 @@ class ironic::keystone::auth_inspector (
$internal_url = 'http://127.0.0.1:5050',
) {
include ::ironic::deps
include ironic::deps
$real_service_name = pick($service_name, $auth_name)

View File

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

View File

@ -20,7 +20,7 @@
# Parameters for puppet-ironic
#
class ironic::params {
include ::openstacklib::defaults
include openstacklib::defaults
$pyvers = $::openstacklib::defaults::pyvers
$pyver3 = $::openstacklib::defaults::pyver3

View File

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

View File

@ -62,8 +62,8 @@ class ironic::pxe (
$enable_ppc64le = false,
) inherits ::ironic::params {
include ::ironic::deps
include ::ironic::pxe::common
include ironic::deps
include ironic::pxe::common
$tftp_root_real = pick($::ironic::pxe::common::tftp_root, $tftp_root)
$http_root_real = pick($::ironic::pxe::common::http_root, $http_root)
@ -124,7 +124,7 @@ class ironic::pxe (
})
$options = "--map-file ${tftp_root_real}/map-file"
include ::xinetd
include xinetd
xinetd::service { 'tftp':
port => '69',
@ -186,7 +186,7 @@ class ironic::pxe (
require => Anchor['ironic-inspector::install::end'],
}
include ::apache
include apache
apache::vhost { 'ipxe_vhost':
priority => '10',

View File

@ -43,5 +43,5 @@ class ironic::pxe::common (
$http_port = undef,
$ipxe_timeout = undef,
) {
include ::ironic::deps
include ironic::deps
}

View File

@ -32,7 +32,7 @@ define ironic::pxe::tftpboot_file (
$destination_directory,
$file = $title,
) {
include ::ironic::deps
include ironic::deps
file {"${destination_directory}/${file}":
ensure => 'present',

View File

@ -55,7 +55,7 @@ class ironic::service_catalog (
$endpoint_override = $::os_service_default,
) {
include ::ironic::deps
include ironic::deps
ironic_config {
'service_catalog/auth_type': value => $auth_type;

View File

@ -120,12 +120,12 @@ class ironic::wsgi::apache (
$custom_wsgi_process_options = {},
) {
include ::ironic::deps
include ::ironic::params
include ::apache
include ::apache::mod::wsgi
include ironic::deps
include ironic::params
include apache
include apache::mod::wsgi
if $ssl {
include ::apache::mod::ssl
include apache::mod::ssl
}
::openstacklib::wsgi::apache { 'ironic_wsgi':

View File

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

View File

@ -22,7 +22,7 @@ require 'spec_helper'
describe 'ironic::api' do
let :pre_condition do
"class { '::ironic::api::authtoken':
"class { 'ironic::api::authtoken':
password => 'password',
}"
end
@ -120,10 +120,10 @@ describe 'ironic::api' do
end
let :pre_condition do
"class { '::ironic::api::authtoken':
"class { 'ironic::api::authtoken':
password => 'password',
}
include ::apache"
include apache"
end
it 'configures ironic-api service with Apache' do
@ -142,10 +142,10 @@ describe 'ironic::api' do
end
let :pre_condition do
"class { '::ironic::api::authtoken':
"class { 'ironic::api::authtoken':
password => 'password',
}
include ::apache"
include apache"
end
it_raises 'a Puppet::Error', /Invalid service_name/