Add if check to Sahara/Murano modules
- add 'if' check to Sahara module; - add 'if' check to Murano module; Partial blueprint: detach-components-from-controllers Change-Id: If92cad6e9841441a1a6f2443fdcd86fcbe0ae7f0
This commit is contained in:
parent
e1e57a565c
commit
c5359479c8
|
@ -25,123 +25,124 @@ $public_ssl = hiera_hash('public_ssl', {})
|
|||
|
||||
#################################################################
|
||||
|
||||
$public_protocol = pick($public_ssl['services'], false) ? {
|
||||
true => 'https',
|
||||
default => 'http',
|
||||
}
|
||||
|
||||
$public_address = pick($public_ssl['services'], false) ? {
|
||||
true => pick($public_ssl['hostname']),
|
||||
default => $public_ip,
|
||||
}
|
||||
|
||||
$firewall_rule = '202 murano-api'
|
||||
|
||||
$api_bind_port = '8082'
|
||||
$api_bind_host = get_network_role_property('murano/api', 'ipaddr')
|
||||
|
||||
$murano_user = pick($murano_hash['user'], 'murano')
|
||||
$tenant = pick($murano_hash['tenant'], 'services')
|
||||
$internal_url = "http://${service_endpoint}:${api_bind_port}"
|
||||
$db_user = pick($murano_hash['db_user'], 'murano')
|
||||
$db_name = pick($murano_hash['db_name'], 'murano')
|
||||
$db_password = pick($murano_hash['db_password'])
|
||||
$db_host = pick($murano_hash['db_host'], $database_ip)
|
||||
$read_timeout = '60'
|
||||
$sql_connection = "mysql://${db_user}:${db_password}@${db_host}/${db_name}?read_timeout=${read_timeout}"
|
||||
|
||||
$external_network = $use_neutron ? {
|
||||
true => get_ext_net_name($neutron_config['predefined_networks']),
|
||||
default => undef,
|
||||
}
|
||||
|
||||
$repository_url = has_key($murano_settings_hash, 'murano_repo_url') ? {
|
||||
true => $murano_settings_hash['murano_repo_url'],
|
||||
default => 'http://storage.apps.openstack.org',
|
||||
}
|
||||
|
||||
####### Disable upstart startup on install #######
|
||||
tweaks::ubuntu_service_override { ['murano-api', 'murano-engine']:
|
||||
package_name => 'murano',
|
||||
}
|
||||
|
||||
firewall { $firewall_rule :
|
||||
dport => $api_bind_port,
|
||||
proto => 'tcp',
|
||||
action => 'accept',
|
||||
}
|
||||
|
||||
class { 'murano' :
|
||||
verbose => $verbose,
|
||||
debug => $debug,
|
||||
use_syslog => $use_syslog,
|
||||
log_facility => $syslog_log_facility_murano,
|
||||
database_connection => $sql_connection,
|
||||
keystone_uri => "${public_protocol}://${public_address}:5000/v2.0/",
|
||||
keystone_username => $murano_user,
|
||||
keystone_password => $murano_hash['user_password'],
|
||||
keystone_tenant => $tenant,
|
||||
identity_uri => "http://${service_endpoint}:35357/",
|
||||
use_neutron => $use_neutron,
|
||||
rabbit_os_user => $rabbit_hash['user'],
|
||||
rabbit_os_password => $rabbit_hash['password'],
|
||||
rabbit_os_port => $amqp_port,
|
||||
rabbit_os_host => split($amqp_hosts, ','),
|
||||
rabbit_ha_queues => $rabbit_ha_queues,
|
||||
rabbit_own_host => $public_ip,
|
||||
rabbit_own_port => '55572',
|
||||
rabbit_own_user => 'murano',
|
||||
rabbit_own_password => $heat_hash['rabbit_password'],
|
||||
service_host => $api_bind_host,
|
||||
service_port => $api_bind_port,
|
||||
external_network => $external_network,
|
||||
}
|
||||
|
||||
class { 'murano::api':
|
||||
host => $api_bind_host,
|
||||
port => $api_bind_port,
|
||||
}
|
||||
|
||||
class { 'murano::engine': }
|
||||
|
||||
class { 'murano::client': }
|
||||
|
||||
class { 'murano::dashboard':
|
||||
api_url => $internal_url,
|
||||
repo_url => $repository_url,
|
||||
}
|
||||
|
||||
class { 'murano::rabbitmq':
|
||||
rabbit_user => 'murano',
|
||||
rabbit_password => $heat_hash['rabbit_password'],
|
||||
rabbit_port => '55572',
|
||||
}
|
||||
|
||||
$haproxy_stats_url = "http://${management_ip}:10000/;csv"
|
||||
|
||||
haproxy_backend_status { 'murano-api' :
|
||||
name => 'murano-api',
|
||||
url => $haproxy_stats_url,
|
||||
}
|
||||
|
||||
if ($node_role == 'primary-controller') {
|
||||
murano::application { 'io.murano' :
|
||||
os_tenant_name => $tenant,
|
||||
os_username => $murano_user,
|
||||
os_password => $murano_hash['user_password'],
|
||||
os_auth_url => "${public_protocol}://${public_address}:5000/v2.0/",
|
||||
os_region => $region,
|
||||
mandatory => true,
|
||||
if $murano_hash['enabled'] {
|
||||
$public_protocol = pick($public_ssl['services'], false) ? {
|
||||
true => 'https',
|
||||
default => 'http',
|
||||
}
|
||||
|
||||
Service['murano-api'] -> Murano::Application<| mandatory == true |>
|
||||
} else {
|
||||
notice("Node Role: ${node_role}")
|
||||
$public_address = pick($public_ssl['services'], false) ? {
|
||||
true => pick($public_ssl['hostname']),
|
||||
default => $public_ip,
|
||||
}
|
||||
|
||||
$firewall_rule = '202 murano-api'
|
||||
|
||||
$api_bind_port = '8082'
|
||||
$api_bind_host = get_network_role_property('murano/api', 'ipaddr')
|
||||
|
||||
$murano_user = pick($murano_hash['user'], 'murano')
|
||||
$tenant = pick($murano_hash['tenant'], 'services')
|
||||
$internal_url = "http://${service_endpoint}:${api_bind_port}"
|
||||
$db_user = pick($murano_hash['db_user'], 'murano')
|
||||
$db_name = pick($murano_hash['db_name'], 'murano')
|
||||
$db_password = pick($murano_hash['db_password'])
|
||||
$db_host = pick($murano_hash['db_host'], $database_ip)
|
||||
$read_timeout = '60'
|
||||
$sql_connection = "mysql://${db_user}:${db_password}@${db_host}/${db_name}?read_timeout=${read_timeout}"
|
||||
|
||||
$external_network = $use_neutron ? {
|
||||
true => get_ext_net_name($neutron_config['predefined_networks']),
|
||||
default => undef,
|
||||
}
|
||||
|
||||
$repository_url = has_key($murano_settings_hash, 'murano_repo_url') ? {
|
||||
true => $murano_settings_hash['murano_repo_url'],
|
||||
default => 'http://storage.apps.openstack.org',
|
||||
}
|
||||
|
||||
####### Disable upstart startup on install #######
|
||||
tweaks::ubuntu_service_override { ['murano-api', 'murano-engine']:
|
||||
package_name => 'murano',
|
||||
}
|
||||
|
||||
firewall { $firewall_rule :
|
||||
dport => $api_bind_port,
|
||||
proto => 'tcp',
|
||||
action => 'accept',
|
||||
}
|
||||
|
||||
class { 'murano' :
|
||||
verbose => $verbose,
|
||||
debug => $debug,
|
||||
use_syslog => $use_syslog,
|
||||
log_facility => $syslog_log_facility_murano,
|
||||
database_connection => $sql_connection,
|
||||
keystone_uri => "${public_protocol}://${public_address}:5000/v2.0/",
|
||||
keystone_username => $murano_user,
|
||||
keystone_password => $murano_hash['user_password'],
|
||||
keystone_tenant => $tenant,
|
||||
identity_uri => "http://${service_endpoint}:35357/",
|
||||
use_neutron => $use_neutron,
|
||||
rabbit_os_user => $rabbit_hash['user'],
|
||||
rabbit_os_password => $rabbit_hash['password'],
|
||||
rabbit_os_port => $amqp_port,
|
||||
rabbit_os_host => split($amqp_hosts, ','),
|
||||
rabbit_ha_queues => $rabbit_ha_queues,
|
||||
rabbit_own_host => $public_ip,
|
||||
rabbit_own_port => '55572',
|
||||
rabbit_own_user => 'murano',
|
||||
rabbit_own_password => $heat_hash['rabbit_password'],
|
||||
service_host => $api_bind_host,
|
||||
service_port => $api_bind_port,
|
||||
external_network => $external_network,
|
||||
}
|
||||
|
||||
class { 'murano::api':
|
||||
host => $api_bind_host,
|
||||
port => $api_bind_port,
|
||||
}
|
||||
|
||||
class { 'murano::engine': }
|
||||
|
||||
class { 'murano::client': }
|
||||
|
||||
class { 'murano::dashboard':
|
||||
api_url => $internal_url,
|
||||
repo_url => $repository_url,
|
||||
}
|
||||
|
||||
class { 'murano::rabbitmq':
|
||||
rabbit_user => 'murano',
|
||||
rabbit_password => $heat_hash['rabbit_password'],
|
||||
rabbit_port => '55572',
|
||||
}
|
||||
|
||||
$haproxy_stats_url = "http://${management_ip}:10000/;csv"
|
||||
|
||||
haproxy_backend_status { 'murano-api' :
|
||||
name => 'murano-api',
|
||||
url => $haproxy_stats_url,
|
||||
}
|
||||
|
||||
if ($node_role == 'primary-controller') {
|
||||
murano::application { 'io.murano' :
|
||||
os_tenant_name => $tenant,
|
||||
os_username => $murano_user,
|
||||
os_password => $murano_hash['user_password'],
|
||||
os_auth_url => "${public_protocol}://${public_address}:5000/v2.0/",
|
||||
os_region => $region,
|
||||
mandatory => true,
|
||||
}
|
||||
|
||||
Service['murano-api'] -> Murano::Application<| mandatory == true |>
|
||||
} else {
|
||||
notice("Node Role: ${node_role}")
|
||||
}
|
||||
|
||||
Firewall[$firewall_rule] -> Class['murano::api']
|
||||
Service['murano-api'] -> Haproxy_backend_status['murano-api']
|
||||
}
|
||||
|
||||
Firewall[$firewall_rule] -> Class['murano::api']
|
||||
Service['murano-api'] -> Haproxy_backend_status['murano-api']
|
||||
|
||||
#########################
|
||||
|
||||
class openstack::firewall {}
|
||||
|
|
|
@ -23,100 +23,101 @@ $amqp_hosts = hiera('amqp_hosts')
|
|||
|
||||
#################################################################
|
||||
|
||||
$firewall_rule = '201 sahara-api'
|
||||
$api_bind_port = '8386'
|
||||
$api_bind_host = get_network_role_property('sahara/api', 'ipaddr')
|
||||
$api_workers = '4'
|
||||
$public_address = $public_ssl_hash['services'] ? {
|
||||
true => $public_ssl_hash['hostname'],
|
||||
default => $public_vip,
|
||||
}
|
||||
$public_protocol = $public_ssl_hash['services'] ? {
|
||||
true => 'https',
|
||||
default => 'http',
|
||||
}
|
||||
$sahara_user = pick($sahara_hash['user'], 'sahara')
|
||||
$sahara_password = pick($sahara_hash['user_password'])
|
||||
$tenant = pick($sahara_hash['tenant'], 'services')
|
||||
$db_user = pick($sahara_hash['db_user'], 'sahara')
|
||||
$db_name = pick($sahara_hash['db_name'], 'sahara')
|
||||
$db_password = pick($sahara_hash['db_password'])
|
||||
$db_host = pick($sahara_hash['db_host'], $database_vip)
|
||||
$read_timeout = '60'
|
||||
$sql_connection = "mysql://${db_user}:${db_password}@${db_host}/${db_name}?read_timeout=${read_timeout}"
|
||||
|
||||
####### Disable upstart startup on install #######
|
||||
tweaks::ubuntu_service_override { 'sahara-api':
|
||||
package_name => 'sahara',
|
||||
}
|
||||
|
||||
firewall { $firewall_rule :
|
||||
dport => $api_bind_port,
|
||||
proto => 'tcp',
|
||||
action => 'accept',
|
||||
}
|
||||
|
||||
class { 'sahara' :
|
||||
verbose => $verbose,
|
||||
debug => $debug,
|
||||
use_syslog => $use_syslog,
|
||||
plugins => [ 'ambari', 'cdh', 'mapr', 'spark', 'vanilla' ],
|
||||
log_facility => $syslog_log_facility_sahara,
|
||||
database_connection => $sql_connection,
|
||||
auth_uri => "http://${service_endpoint}:5000/v2.0/",
|
||||
identity_uri => "http://${service_endpoint}:35357/",
|
||||
rpc_backend => 'rabbit',
|
||||
use_neutron => $use_neutron,
|
||||
admin_user => $sahara_user,
|
||||
admin_password => $sahara_password,
|
||||
admin_tenant_name => $tenant,
|
||||
rabbit_userid => $rabbit_hash['user'],
|
||||
rabbit_password => $rabbit_hash['password'],
|
||||
rabbit_ha_queues => $rabbit_ha_queues,
|
||||
rabbit_port => $amqp_port,
|
||||
rabbit_hosts => split($amqp_hosts, ',')
|
||||
}
|
||||
|
||||
class { 'sahara::api':
|
||||
api_workers => $api_workers,
|
||||
host => $api_bind_host,
|
||||
port => $api_bind_port,
|
||||
}
|
||||
|
||||
class { 'sahara::engine':
|
||||
infrastructure_engine => 'heat',
|
||||
}
|
||||
|
||||
class { 'sahara::client': }
|
||||
|
||||
if $ceilometer_hash['enabled'] {
|
||||
class { '::sahara::notify':
|
||||
enable_notifications => true,
|
||||
if $sahara_hash['enabled'] {
|
||||
$firewall_rule = '201 sahara-api'
|
||||
$api_bind_port = '8386'
|
||||
$api_bind_host = get_network_role_property('sahara/api', 'ipaddr')
|
||||
$api_workers = '4'
|
||||
$public_address = $public_ssl_hash['services'] ? {
|
||||
true => $public_ssl_hash['hostname'],
|
||||
default => $public_vip,
|
||||
}
|
||||
}
|
||||
$public_protocol = $public_ssl_hash['services'] ? {
|
||||
true => 'https',
|
||||
default => 'http',
|
||||
}
|
||||
$sahara_user = pick($sahara_hash['user'], 'sahara')
|
||||
$sahara_password = pick($sahara_hash['user_password'])
|
||||
$tenant = pick($sahara_hash['tenant'], 'services')
|
||||
$db_user = pick($sahara_hash['db_user'], 'sahara')
|
||||
$db_name = pick($sahara_hash['db_name'], 'sahara')
|
||||
$db_password = pick($sahara_hash['db_password'])
|
||||
$db_host = pick($sahara_hash['db_host'], $database_vip)
|
||||
$read_timeout = '60'
|
||||
$sql_connection = "mysql://${db_user}:${db_password}@${db_host}/${db_name}?read_timeout=${read_timeout}"
|
||||
|
||||
$haproxy_stats_url = "http://${management_vip}:10000/;csv"
|
||||
|
||||
haproxy_backend_status { 'sahara' :
|
||||
name => 'sahara',
|
||||
url => $haproxy_stats_url,
|
||||
}
|
||||
|
||||
if $primary_controller {
|
||||
class { 'sahara_templates::create_templates' :
|
||||
use_neutron => $use_neutron,
|
||||
auth_user => $access_admin['user'],
|
||||
auth_password => $access_admin['password'],
|
||||
auth_tenant => $access_admin['tenant'],
|
||||
auth_uri => "${public_protocol}://${public_address}:5000/v2.0/",
|
||||
####### Disable upstart startup on install #######
|
||||
tweaks::ubuntu_service_override { 'sahara-api':
|
||||
package_name => 'sahara',
|
||||
}
|
||||
|
||||
Haproxy_backend_status['sahara'] -> Class['sahara_templates::create_templates']
|
||||
firewall { $firewall_rule :
|
||||
dport => $api_bind_port,
|
||||
proto => 'tcp',
|
||||
action => 'accept',
|
||||
}
|
||||
|
||||
class { 'sahara' :
|
||||
verbose => $verbose,
|
||||
debug => $debug,
|
||||
use_syslog => $use_syslog,
|
||||
plugins => [ 'ambari', 'cdh', 'mapr', 'spark', 'vanilla' ],
|
||||
log_facility => $syslog_log_facility_sahara,
|
||||
database_connection => $sql_connection,
|
||||
auth_uri => "http://${service_endpoint}:5000/v2.0/",
|
||||
identity_uri => "http://${service_endpoint}:35357/",
|
||||
rpc_backend => 'rabbit',
|
||||
use_neutron => $use_neutron,
|
||||
admin_user => $sahara_user,
|
||||
admin_password => $sahara_password,
|
||||
admin_tenant_name => $tenant,
|
||||
rabbit_userid => $rabbit_hash['user'],
|
||||
rabbit_password => $rabbit_hash['password'],
|
||||
rabbit_ha_queues => $rabbit_ha_queues,
|
||||
rabbit_port => $amqp_port,
|
||||
rabbit_hosts => split($amqp_hosts, ',')
|
||||
}
|
||||
|
||||
class { 'sahara::api':
|
||||
api_workers => $api_workers,
|
||||
host => $api_bind_host,
|
||||
port => $api_bind_port,
|
||||
}
|
||||
|
||||
class { 'sahara::engine':
|
||||
infrastructure_engine => 'heat',
|
||||
}
|
||||
|
||||
class { 'sahara::client': }
|
||||
|
||||
if $ceilometer_hash['enabled'] {
|
||||
class { '::sahara::notify':
|
||||
enable_notifications => true,
|
||||
}
|
||||
}
|
||||
|
||||
$haproxy_stats_url = "http://${management_vip}:10000/;csv"
|
||||
|
||||
haproxy_backend_status { 'sahara' :
|
||||
name => 'sahara',
|
||||
url => $haproxy_stats_url,
|
||||
}
|
||||
|
||||
if $primary_controller {
|
||||
class { 'sahara_templates::create_templates' :
|
||||
use_neutron => $use_neutron,
|
||||
auth_user => $access_admin['user'],
|
||||
auth_password => $access_admin['password'],
|
||||
auth_tenant => $access_admin['tenant'],
|
||||
auth_uri => "${public_protocol}://${public_address}:5000/v2.0/",
|
||||
}
|
||||
|
||||
Haproxy_backend_status['sahara'] -> Class['sahara_templates::create_templates']
|
||||
}
|
||||
|
||||
Firewall[$firewall_rule] -> Class['sahara::api']
|
||||
Service['sahara-api'] -> Haproxy_backend_status['sahara']
|
||||
}
|
||||
|
||||
Firewall[$firewall_rule] -> Class['sahara::api']
|
||||
Service['sahara-api'] -> Haproxy_backend_status['sahara']
|
||||
|
||||
#########################
|
||||
|
||||
class openstack::firewall {}
|
||||
|
|
|
@ -7,6 +7,7 @@ describe manifest do
|
|||
|
||||
murano_user = Noop.hiera_structure('murano_hash/user', 'murano')
|
||||
murano_password = Noop.hiera_structure('murano_hash/user_password')
|
||||
murano_enabled = Noop.hiera_structure('murano_hash/enabled')
|
||||
tenant = Noop.hiera_structure('murano_hash/tenant', 'services')
|
||||
rabbit_os_user = Noop.hiera_structure('rabbit_hash/user')
|
||||
rabbit_os_password = Noop.hiera_structure('rabbit_hash/password')
|
||||
|
@ -35,105 +36,106 @@ describe manifest do
|
|||
predefined_networks = Noop.hiera_structure('neutron_config/predefined_networks')
|
||||
repository_url = Noop.hiera_structure('murano_settings/murano_repo_url')
|
||||
|
||||
api_bind_port = '8082'
|
||||
api_bind_host = internal_address
|
||||
if murano_enabled
|
||||
api_bind_port = '8082'
|
||||
api_bind_host = internal_address
|
||||
|
||||
internal_url = "http://#{service_endpoint}:#{api_bind_port}"
|
||||
internal_url = "http://#{service_endpoint}:#{api_bind_port}"
|
||||
|
||||
read_timeout = '60'
|
||||
sql_connection = "mysql://#{db_user}:#{db_password}@#{db_host}/#{db_name}?read_timeout=#{read_timeout}"
|
||||
read_timeout = '60'
|
||||
sql_connection = "mysql://#{db_user}:#{db_password}@#{db_host}/#{db_name}?read_timeout=#{read_timeout}"
|
||||
|
||||
if public_ssl
|
||||
public_protocol = 'https'
|
||||
public_address = Noop.hiera_structure('public_ssl/hostname')
|
||||
else
|
||||
public_protocol = 'http'
|
||||
public_address = public_ip
|
||||
end
|
||||
if public_ssl
|
||||
public_protocol = 'https'
|
||||
public_address = Noop.hiera_structure('public_ssl/hostname')
|
||||
else
|
||||
public_protocol = 'http'
|
||||
public_address = public_ip
|
||||
end
|
||||
|
||||
if use_neutron
|
||||
external_network = PuppetlabsSpec::PuppetInternals.scope.function_get_ext_net_name([predefined_networks])
|
||||
else
|
||||
external_network = nil
|
||||
end
|
||||
if use_neutron
|
||||
external_network = PuppetlabsSpec::PuppetInternals.scope.function_get_ext_net_name([predefined_networks])
|
||||
else
|
||||
external_network = nil
|
||||
end
|
||||
|
||||
if repository_url
|
||||
apps_repository = repository_url
|
||||
else
|
||||
apps_repository = 'http://storage.apps.openstack.org'
|
||||
end
|
||||
if repository_url
|
||||
apps_repository = repository_url
|
||||
else
|
||||
apps_repository = 'http://storage.apps.openstack.org'
|
||||
end
|
||||
|
||||
it 'should declare murano class correctly' do
|
||||
should contain_class('murano').with(
|
||||
'verbose' => verbose,
|
||||
'debug' => debug,
|
||||
'use_syslog' => use_syslog,
|
||||
'log_facility' => syslog_log_facility_murano,
|
||||
'database_connection' => sql_connection,
|
||||
'keystone_uri' => "#{public_protocol}://#{public_address}:5000/v2.0/",
|
||||
'keystone_username' => murano_user,
|
||||
'keystone_password' => murano_password,
|
||||
'keystone_tenant' => tenant,
|
||||
'identity_uri' => "http://#{service_endpoint}:35357/",
|
||||
'use_neutron' => use_neutron,
|
||||
'rabbit_os_user' => rabbit_os_user,
|
||||
'rabbit_os_password' => rabbit_os_password,
|
||||
'rabbit_os_port' => amqp_port,
|
||||
'rabbit_os_host' => amqp_hosts.split(','),
|
||||
'rabbit_ha_queues' => rabbit_ha_queues,
|
||||
'rabbit_own_host' => public_ip,
|
||||
'rabbit_own_port' => '55572',
|
||||
'rabbit_own_user' => 'murano',
|
||||
'rabbit_own_password' => rabbit_own_password,
|
||||
'service_host' => api_bind_host,
|
||||
'service_port' => api_bind_port,
|
||||
'external_network' => external_network,
|
||||
)
|
||||
end
|
||||
|
||||
it 'should declare murano::api class correctly' do
|
||||
should contain_class('murano::api').with(
|
||||
'host' => api_bind_host,
|
||||
'port' => api_bind_port,
|
||||
)
|
||||
end
|
||||
|
||||
it 'should declare murano::engine class coreclty' do
|
||||
should contain_class('murano::engine')
|
||||
end
|
||||
|
||||
it 'should declare murano::client class coreclty' do
|
||||
should contain_class('murano::client')
|
||||
end
|
||||
|
||||
it 'should declare murano::dashboard class correctly' do
|
||||
should contain_class('murano::dashboard').with(
|
||||
'api_url' => internal_url,
|
||||
'repo_url' => apps_repository,
|
||||
)
|
||||
end
|
||||
|
||||
it 'should declare murano::rabbitmq class correctly' do
|
||||
should contain_class('murano::rabbitmq').with(
|
||||
'rabbit_user' => 'murano',
|
||||
'rabbit_password' => rabbit_own_password,
|
||||
'rabbit_port' => '55572',
|
||||
)
|
||||
end
|
||||
|
||||
if node_role == 'primary-controller'
|
||||
it 'should declare murano::application resource correctly' do
|
||||
should contain_murano__application('io.murano').with(
|
||||
'os_tenant_name' => tenant,
|
||||
'os_username' => murano_user,
|
||||
'os_password' => murano_password,
|
||||
'os_auth_url' => "#{public_protocol}://#{public_address}:5000/v2.0/",
|
||||
'os_region' => region,
|
||||
'mandatory' => true,
|
||||
it 'should declare murano class correctly' do
|
||||
should contain_class('murano').with(
|
||||
'verbose' => verbose,
|
||||
'debug' => debug,
|
||||
'use_syslog' => use_syslog,
|
||||
'log_facility' => syslog_log_facility_murano,
|
||||
'database_connection' => sql_connection,
|
||||
'keystone_uri' => "#{public_protocol}://#{public_address}:5000/v2.0/",
|
||||
'keystone_username' => murano_user,
|
||||
'keystone_password' => murano_password,
|
||||
'keystone_tenant' => tenant,
|
||||
'identity_uri' => "http://#{service_endpoint}:35357/",
|
||||
'use_neutron' => use_neutron,
|
||||
'rabbit_os_user' => rabbit_os_user,
|
||||
'rabbit_os_password' => rabbit_os_password,
|
||||
'rabbit_os_port' => amqp_port,
|
||||
'rabbit_os_host' => amqp_hosts.split(','),
|
||||
'rabbit_ha_queues' => rabbit_ha_queues,
|
||||
'rabbit_own_host' => public_ip,
|
||||
'rabbit_own_port' => '55572',
|
||||
'rabbit_own_user' => 'murano',
|
||||
'rabbit_own_password' => rabbit_own_password,
|
||||
'service_host' => api_bind_host,
|
||||
'service_port' => api_bind_port,
|
||||
'external_network' => external_network,
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
it 'should declare murano::api class correctly' do
|
||||
should contain_class('murano::api').with(
|
||||
'host' => api_bind_host,
|
||||
'port' => api_bind_port,
|
||||
)
|
||||
end
|
||||
|
||||
it 'should declare murano::engine class coreclty' do
|
||||
should contain_class('murano::engine')
|
||||
end
|
||||
|
||||
it 'should declare murano::client class coreclty' do
|
||||
should contain_class('murano::client')
|
||||
end
|
||||
|
||||
it 'should declare murano::dashboard class correctly' do
|
||||
should contain_class('murano::dashboard').with(
|
||||
'api_url' => internal_url,
|
||||
'repo_url' => apps_repository,
|
||||
)
|
||||
end
|
||||
|
||||
it 'should declare murano::rabbitmq class correctly' do
|
||||
should contain_class('murano::rabbitmq').with(
|
||||
'rabbit_user' => 'murano',
|
||||
'rabbit_password' => rabbit_own_password,
|
||||
'rabbit_port' => '55572',
|
||||
)
|
||||
end
|
||||
|
||||
if node_role == 'primary-controller'
|
||||
it 'should declare murano::application resource correctly' do
|
||||
should contain_murano__application('io.murano').with(
|
||||
'os_tenant_name' => tenant,
|
||||
'os_username' => murano_user,
|
||||
'os_password' => murano_password,
|
||||
'os_auth_url' => "#{public_protocol}://#{public_address}:5000/v2.0/",
|
||||
'os_region' => region,
|
||||
'mandatory' => true,
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
test_ubuntu_and_centos manifest
|
||||
end
|
||||
end
|
||||
|
|
|
@ -8,6 +8,7 @@ describe manifest do
|
|||
use_neutron = Noop.hiera 'use_neutron'
|
||||
rabbit_user = Noop.hiera_structure 'rabbit_hash/user'
|
||||
rabbit_password = Noop.hiera_structure 'rabbit_hash/password'
|
||||
sahara_enabled = Noop.hiera_structure 'sahara_hash/enabled'
|
||||
ceilometer_enabled = Noop.hiera_structure 'ceilometer_hash/enabled'
|
||||
auth_user = Noop.hiera_structure 'access_hash/user'
|
||||
auth_password = Noop.hiera_structure 'access_hash/password'
|
||||
|
@ -26,87 +27,89 @@ describe manifest do
|
|||
rabbit_ha_queues = Noop.hiera('rabbit_ha_queues')
|
||||
public_ssl = Noop.hiera_structure('public_ssl/services')
|
||||
|
||||
firewall_rule = '201 sahara-api'
|
||||
api_bind_port = '8386'
|
||||
api_bind_host = internal_address
|
||||
api_workers = '4'
|
||||
sahara_plugins = [ 'ambari', 'cdh', 'mapr', 'spark', 'vanilla' ]
|
||||
if public_ssl
|
||||
public_address = Noop.hiera_structure('public_ssl/hostname')
|
||||
public_protocol = 'https'
|
||||
else
|
||||
public_address = public_vip
|
||||
public_protocol = 'http'
|
||||
end
|
||||
sahara_user = Noop.hiera_structure('sahara_hash/user', 'sahara')
|
||||
sahara_password = Noop.hiera_structure('sahara_hash/user_password')
|
||||
tenant = Noop.hiera_structure('sahara_hash/tenant', 'services')
|
||||
db_user = Noop.hiera_structure('sahara_hash/db_user', 'sahara')
|
||||
db_name = Noop.hiera_structure('sahara_hash/db_name', 'sahara')
|
||||
db_password = Noop.hiera_structure('sahara_hash/db_password')
|
||||
db_host = Noop.hiera_structure('sahara_hash/db_host', database_vip)
|
||||
read_timeout = '60'
|
||||
sql_connection = "mysql://#{db_user}:#{db_password}@#{db_host}/#{db_name}?read_timeout=#{read_timeout}"
|
||||
if sahara_enabled
|
||||
firewall_rule = '201 sahara-api'
|
||||
api_bind_port = '8386'
|
||||
api_bind_host = internal_address
|
||||
api_workers = '4'
|
||||
sahara_plugins = [ 'ambari', 'cdh', 'mapr', 'spark', 'vanilla' ]
|
||||
if public_ssl
|
||||
public_address = Noop.hiera_structure('public_ssl/hostname')
|
||||
public_protocol = 'https'
|
||||
else
|
||||
public_address = public_vip
|
||||
public_protocol = 'http'
|
||||
end
|
||||
sahara_user = Noop.hiera_structure('sahara_hash/user', 'sahara')
|
||||
sahara_password = Noop.hiera_structure('sahara_hash/user_password')
|
||||
tenant = Noop.hiera_structure('sahara_hash/tenant', 'services')
|
||||
db_user = Noop.hiera_structure('sahara_hash/db_user', 'sahara')
|
||||
db_name = Noop.hiera_structure('sahara_hash/db_name', 'sahara')
|
||||
db_password = Noop.hiera_structure('sahara_hash/db_password')
|
||||
db_host = Noop.hiera_structure('sahara_hash/db_host', database_vip)
|
||||
read_timeout = '60'
|
||||
sql_connection = "mysql://#{db_user}:#{db_password}@#{db_host}/#{db_name}?read_timeout=#{read_timeout}"
|
||||
|
||||
it 'should declare sahara class correctly' do
|
||||
should contain_class('sahara').with(
|
||||
'auth_uri' => "http://#{service_endpoint}:5000/v2.0/",
|
||||
'identity_uri' => "http://#{service_endpoint}:35357/",
|
||||
'plugins' => sahara_plugins,
|
||||
'rpc_backend' => 'rabbit',
|
||||
'use_neutron' => use_neutron,
|
||||
'admin_user' => sahara_user,
|
||||
'verbose' => verbose,
|
||||
'debug' => debug,
|
||||
'use_syslog' => use_syslog,
|
||||
'log_facility' => log_facility_sahara,
|
||||
'database_connection' => sql_connection,
|
||||
'admin_password' => sahara_password,
|
||||
'admin_tenant_name' => tenant,
|
||||
'rabbit_userid' => rabbit_user,
|
||||
'rabbit_password' => rabbit_password,
|
||||
'rabbit_ha_queues' => rabbit_ha_queues,
|
||||
'rabbit_port' => amqp_port,
|
||||
'rabbit_hosts' => amqp_hosts.split(","),
|
||||
)
|
||||
end
|
||||
|
||||
it 'should declare sahara::api class correctly' do
|
||||
should contain_class('sahara::api').with(
|
||||
'api_workers' => api_workers,
|
||||
'host' => api_bind_host,
|
||||
'port' => api_bind_port,
|
||||
)
|
||||
end
|
||||
|
||||
it 'should declare sahara::engine class correctly' do
|
||||
should contain_class('sahara::engine').with(
|
||||
'infrastructure_engine' => 'heat',
|
||||
)
|
||||
end
|
||||
|
||||
it 'should declare sahara::client class correctly' do
|
||||
should contain_class('sahara::client')
|
||||
end
|
||||
|
||||
if ceilometer_enabled
|
||||
it 'should declare sahara::notify class correctly' do
|
||||
should contain_class('sahara::notify').with(
|
||||
'enable_notifications' => true,
|
||||
it 'should declare sahara class correctly' do
|
||||
should contain_class('sahara').with(
|
||||
'auth_uri' => "http://#{service_endpoint}:5000/v2.0/",
|
||||
'identity_uri' => "http://#{service_endpoint}:35357/",
|
||||
'plugins' => sahara_plugins,
|
||||
'rpc_backend' => 'rabbit',
|
||||
'use_neutron' => use_neutron,
|
||||
'admin_user' => sahara_user,
|
||||
'verbose' => verbose,
|
||||
'debug' => debug,
|
||||
'use_syslog' => use_syslog,
|
||||
'log_facility' => log_facility_sahara,
|
||||
'database_connection' => sql_connection,
|
||||
'admin_password' => sahara_password,
|
||||
'admin_tenant_name' => tenant,
|
||||
'rabbit_userid' => rabbit_user,
|
||||
'rabbit_password' => rabbit_password,
|
||||
'rabbit_ha_queues' => rabbit_ha_queues,
|
||||
'rabbit_port' => amqp_port,
|
||||
'rabbit_hosts' => amqp_hosts.split(","),
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
if primary_controller
|
||||
it 'should declare sahara_templates class correctly' do
|
||||
should contain_class('sahara_templates::create_templates').with(
|
||||
'use_neutron' => use_neutron,
|
||||
'auth_uri' => "#{public_protocol}://#{public_address}:5000/v2.0/",
|
||||
'auth_password' => auth_password,
|
||||
'auth_user' => auth_user,
|
||||
'auth_tenant' => auth_tenant,
|
||||
it 'should declare sahara::api class correctly' do
|
||||
should contain_class('sahara::api').with(
|
||||
'api_workers' => api_workers,
|
||||
'host' => api_bind_host,
|
||||
'port' => api_bind_port,
|
||||
)
|
||||
end
|
||||
|
||||
it 'should declare sahara::engine class correctly' do
|
||||
should contain_class('sahara::engine').with(
|
||||
'infrastructure_engine' => 'heat',
|
||||
)
|
||||
end
|
||||
|
||||
it 'should declare sahara::client class correctly' do
|
||||
should contain_class('sahara::client')
|
||||
end
|
||||
|
||||
if ceilometer_enabled
|
||||
it 'should declare sahara::notify class correctly' do
|
||||
should contain_class('sahara::notify').with(
|
||||
'enable_notifications' => true,
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
if primary_controller
|
||||
it 'should declare sahara_templates class correctly' do
|
||||
should contain_class('sahara_templates::create_templates').with(
|
||||
'use_neutron' => use_neutron,
|
||||
'auth_uri' => "#{public_protocol}://#{public_address}:5000/v2.0/",
|
||||
'auth_password' => auth_password,
|
||||
'auth_user' => auth_user,
|
||||
'auth_tenant' => auth_tenant,
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
test_ubuntu_and_centos manifest
|
||||
|
|
Loading…
Reference in New Issue