Update heat for havanna
This commit is contained in:
parent
fcdd5c045e
commit
776841b902
@ -0,0 +1,22 @@
|
||||
Puppet::Type.type(:heat_config).provide(
|
||||
:ini_setting,
|
||||
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
|
||||
) do
|
||||
|
||||
def section
|
||||
resource[:name].split('/', 2).first
|
||||
end
|
||||
|
||||
def setting
|
||||
resource[:name].split('/', 2).last
|
||||
end
|
||||
|
||||
def separator
|
||||
'='
|
||||
end
|
||||
|
||||
def file_path
|
||||
'/etc/heat/heat.conf'
|
||||
end
|
||||
|
||||
end
|
20
deployment/puppet/heat/lib/puppet/type/heat_config.rb
Normal file
20
deployment/puppet/heat/lib/puppet/type/heat_config.rb
Normal file
@ -0,0 +1,20 @@
|
||||
Puppet::Type.newtype(:heat_config) do
|
||||
|
||||
ensurable
|
||||
|
||||
newparam(:name, :namevar => true) do
|
||||
desc 'Section/setting name to manage from heat-engine.conf'
|
||||
newvalues(/\S+\/\S+/)
|
||||
end
|
||||
|
||||
newproperty(:value) do
|
||||
desc 'The value of the setting to be defined.'
|
||||
munge do |value|
|
||||
puts value
|
||||
value = value.to_s.strip
|
||||
value.capitalize! if value =~ /^(true|false)$/i
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -1,31 +1,7 @@
|
||||
class heat::api (
|
||||
$pacemaker = false,
|
||||
$keystone_host = '127.0.0.1',
|
||||
$keystone_port = '35357',
|
||||
$keystone_service_port = '5000',
|
||||
$keystone_protocol = 'http',
|
||||
$keystone_user = 'heat',
|
||||
$keystone_tenant = 'services',
|
||||
$keystone_password = false,
|
||||
$keystone_ec2_uri = 'http://127.0.0.1:5000/v2.0/ec2tokens',
|
||||
$auth_uri = 'http://127.0.0.1:5000/v2.0',
|
||||
$firewall_rule_name = '204 heat-api',
|
||||
$bind_host = '0.0.0.0',
|
||||
$bind_port = '8004',
|
||||
$verbose = 'False',
|
||||
$debug = 'False',
|
||||
$rabbit_hosts = '',
|
||||
$rabbit_host = '127.0.0.1',
|
||||
$rabbit_userid = '',
|
||||
$rabbit_ha_queues = '',
|
||||
$rabbit_password = '',
|
||||
$rabbit_virtualhost = '/',
|
||||
$rabbit_port = '5672',
|
||||
$rabbit_queue_host = 'heat',
|
||||
$log_file = '/var/log/heat/api.log',
|
||||
$rpc_backend = 'heat.openstack.common.rpc.impl_kombu',
|
||||
$use_stderr = 'False',
|
||||
$use_syslog = 'False',
|
||||
$firewall_rule_name = '204 heat-api',
|
||||
) {
|
||||
|
||||
include heat::params
|
||||
@ -43,22 +19,6 @@ class heat::api (
|
||||
require => Package['python-routes'],
|
||||
}
|
||||
|
||||
if $rabbit_hosts {
|
||||
heat_api_config { 'DEFAULT/rabbit_host': ensure => absent }
|
||||
heat_api_config { 'DEFAULT/rabbit_port': ensure => absent }
|
||||
heat_api_config { 'DEFAULT/rabbit_hosts': value => join($rabbit_hosts, ',') }
|
||||
} else {
|
||||
heat_api_config { 'DEFAULT/rabbit_host': value => $rabbit_host }
|
||||
heat_api_config { 'DEFAULT/rabbit_port': value => $rabbit_port }
|
||||
heat_api_config { 'DEFAULT/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" }
|
||||
}
|
||||
|
||||
if size($rabbit_hosts) > 1 {
|
||||
heat_api_config { 'DEFAULT/rabbit_ha_queues': value => true }
|
||||
} else {
|
||||
heat_api_config { 'DEFAULT/rabbit_ha_queues': value => false }
|
||||
}
|
||||
|
||||
service { 'heat-api':
|
||||
ensure => 'running',
|
||||
name => $::heat::params::api_service_name,
|
||||
@ -67,54 +27,14 @@ class heat::api (
|
||||
hasrestart => true,
|
||||
}
|
||||
|
||||
heat_api_config {
|
||||
'DEFAULT/rabbit_userid' : value => $rabbit_userid;
|
||||
'DEFAULT/rabbit_password' : value => $rabbit_password;
|
||||
'DEFAULT/rabbit_virtualhost' : value => $rabbit_virtualhost;
|
||||
'DEFAULT/host' : value => $rabbit_queue_host;
|
||||
'DEFAULT/debug' : value => $debug;
|
||||
'DEFAULT/verbose' : value => $verbose;
|
||||
'DEFAULT/log_dir' : value => $::heat::params::log_dir;
|
||||
'DEFAULT/bind_host' : value => $bind_host;
|
||||
'DEFAULT/bind_port' : value => $bind_port;
|
||||
'DEFAULT/log_file' : value => $log_file;
|
||||
'DEFAULT/rpc_backend' : value => $rpc_backend;
|
||||
'DEFAULT/use_stderr' : value => $use_stderr;
|
||||
'DEFAULT/use_syslog' : value => $use_syslog;
|
||||
'ec2authtoken/keystone_ec2_uri' : value => $keystone_ec2_uri;
|
||||
'ec2authtoken/auth_uri' : value => $auth_uri;
|
||||
'keystone_authtoken/auth_host' : value => $keystone_host;
|
||||
'keystone_authtoken/auth_port' : value => $keystone_port;
|
||||
'keystone_authtoken/auth_protocol' : value => $keystone_protocol;
|
||||
'keystone_authtoken/admin_tenant_name' : value => $keystone_tenant;
|
||||
'keystone_authtoken/admin_user' : value => $keystone_user;
|
||||
'keystone_authtoken/admin_password' : value => $keystone_password;
|
||||
'keystone_authtoken/auth_uri' : value => "${keystone_protocol}://${keystone_host}:${keystone_service_port}/v2";
|
||||
}
|
||||
|
||||
heat_api_paste_ini {
|
||||
'filter:authtoken/paste.filter_factory' : value => "heat.common.auth_token:filter_factory";
|
||||
'filter:authtoken/service_protocol' : value => $keystone_protocol;
|
||||
'filter:authtoken/service_host' : value => $keystone_host;
|
||||
'filter:authtoken/service_port' : value => $keystone_service_port;
|
||||
'filter:authtoken/auth_host' : value => $keystone_host;
|
||||
'filter:authtoken/auth_port' : value => $keystone_port;
|
||||
'filter:authtoken/auth_protocol' : value => $keystone_protocol;
|
||||
'filter:authtoken/auth_uri' : value => "${keystone_protocol}://${keystone_host}:${keystone_port}/v2.0";
|
||||
'filter:authtoken/admin_tenant_name' : value => $keystone_tenant;
|
||||
'filter:authtoken/admin_user' : value => $keystone_user;
|
||||
'filter:authtoken/admin_password' : value => $keystone_password;
|
||||
}
|
||||
|
||||
firewall { $firewall_rule_name :
|
||||
dport => [ $bind_port ],
|
||||
proto => 'tcp',
|
||||
action => 'accept',
|
||||
}
|
||||
|
||||
Package['heat-common'] -> Package['heat-api'] -> Heat_api_config<||> -> Heat_api_paste_ini<||>
|
||||
Heat_api_config<||> ~> Service['heat-api']
|
||||
Heat_api_paste_ini<||> ~> Service['heat-api']
|
||||
Package['heat-common'] -> Package['heat-api'] -> Heat_config<||>
|
||||
Heat_config<||> ~> Service['heat-api']
|
||||
Package['heat-api'] ~> Service['heat-api']
|
||||
Class['heat::db'] -> Service['heat-api']
|
||||
Exec['heat_db_sync'] -> Service['heat-api']
|
||||
|
@ -1,32 +1,7 @@
|
||||
class heat::api_cfn (
|
||||
$pacemaker = false,
|
||||
$keystone_host = '127.0.0.1',
|
||||
$keystone_port = '35357',
|
||||
$keystone_service_port = '5000',
|
||||
$keystone_protocol = 'http',
|
||||
$keystone_user = 'heat',
|
||||
$keystone_tenant = 'services',
|
||||
$keystone_password = false,
|
||||
$keystone_ec2_uri = 'http://127.0.0.1:5000/v2.0/ec2tokens',
|
||||
$auth_uri = 'http://127.0.0.1:5000/v2.0',
|
||||
$firewall_rule_name = '205 heat-api-cfn',
|
||||
$bind_host = '0.0.0.0',
|
||||
$bind_port = '8000',
|
||||
$verbose = 'False',
|
||||
$debug = 'False',
|
||||
$rabbit_hosts = '',
|
||||
$rabbit_host = '127.0.0.1',
|
||||
$rabbit_userid = '',
|
||||
$rabbit_ha_queues = '',
|
||||
$rabbit_password = '',
|
||||
$rabbit_virtualhost = '/',
|
||||
$rabbit_port = '5672',
|
||||
$rabbit_queue_host = 'heat',
|
||||
$log_file = '/var/log/heat/api-cloudwatch.log',
|
||||
$rpc_backend = 'heat.openstack.common.rpc.impl_kombu',
|
||||
$use_stderr = 'False',
|
||||
$use_syslog = 'False',
|
||||
$firewall_rule_name = '205 heat-api-cfn',
|
||||
|
||||
) {
|
||||
|
||||
include heat::params
|
||||
@ -38,22 +13,6 @@ class heat::api_cfn (
|
||||
name => $::heat::params::api_cfn_package_name,
|
||||
}
|
||||
|
||||
if $rabbit_hosts {
|
||||
heat_api_cfn_config { 'DEFAULT/rabbit_host': ensure => absent }
|
||||
heat_api_cfn_config { 'DEFAULT/rabbit_port': ensure => absent }
|
||||
heat_api_cfn_config { 'DEFAULT/rabbit_hosts': value => join($rabbit_hosts, ',') }
|
||||
} else {
|
||||
heat_api_cfn_config { 'DEFAULT/rabbit_host': value => $rabbit_host }
|
||||
heat_api_cfn_config { 'DEFAULT/rabbit_port': value => $rabbit_port }
|
||||
heat_api_cfn_config { 'DEFAULT/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" }
|
||||
}
|
||||
|
||||
if size($rabbit_hosts) > 1 {
|
||||
heat_api_cfn_config { 'DEFAULT/rabbit_ha_queues': value => true }
|
||||
} else {
|
||||
heat_api_cfn_config { 'DEFAULT/rabbit_ha_queues': value => false }
|
||||
}
|
||||
|
||||
service { 'heat-api-cfn':
|
||||
ensure => 'running',
|
||||
name => $::heat::params::api_cfn_service_name,
|
||||
@ -62,54 +21,14 @@ class heat::api_cfn (
|
||||
hasrestart => true,
|
||||
}
|
||||
|
||||
heat_api_cfn_config {
|
||||
'DEFAULT/rabbit_userid' : value => $rabbit_userid;
|
||||
'DEFAULT/rabbit_password' : value => $rabbit_password;
|
||||
'DEFAULT/rabbit_virtualhost' : value => $rabbit_virtualhost;
|
||||
'DEFAULT/host' : value => $rabbit_queue_host;
|
||||
'DEFAULT/debug' : value => $debug;
|
||||
'DEFAULT/verbose' : value => $verbose;
|
||||
'DEFAULT/log_dir' : value => $::heat::params::log_dir;
|
||||
'DEFAULT/bind_host' : value => $bind_host;
|
||||
'DEFAULT/bind_port' : value => $bind_port;
|
||||
'DEFAULT/log_file' : value => $log_file;
|
||||
'DEFAULT/rpc_backend' : value => $rpc_backend;
|
||||
'DEFAULT/use_stderr' : value => $use_stderr;
|
||||
'DEFAULT/use_syslog' : value => $use_syslog;
|
||||
'ec2authtoken/keystone_ec2_uri' : value => $keystone_ec2_uri;
|
||||
'ec2authtoken/auth_uri' : value => $auth_uri;
|
||||
'keystone_authtoken/auth_host' : value => $keystone_host;
|
||||
'keystone_authtoken/auth_port' : value => $keystone_port;
|
||||
'keystone_authtoken/auth_protocol' : value => $keystone_protocol;
|
||||
'keystone_authtoken/admin_tenant_name' : value => $keystone_tenant;
|
||||
'keystone_authtoken/admin_user' : value => $keystone_user;
|
||||
'keystone_authtoken/admin_password' : value => $keystone_password;
|
||||
'keystone_authtoken/auth_uri' : value => "${keystone_protocol}${keystone_host}:5000/v2";
|
||||
}
|
||||
|
||||
heat_api_cfn_paste_ini {
|
||||
'filter:authtoken/paste.filter_factory' : value => "heat.common.auth_token:filter_factory";
|
||||
'filter:authtoken/service_protocol' : value => $keystone_protocol;
|
||||
'filter:authtoken/service_host' : value => $keystone_host;
|
||||
'filter:authtoken/service_port' : value => $keystone_service_port;
|
||||
'filter:authtoken/auth_host' : value => $keystone_host;
|
||||
'filter:authtoken/auth_port' : value => $keystone_port;
|
||||
'filter:authtoken/auth_protocol' : value => $keystone_protocol;
|
||||
'filter:authtoken/auth_uri' : value => "${keystone_protocol}://${keystone_host}:${keystone_port}/v2.0";
|
||||
'filter:authtoken/admin_tenant_name' : value => $keystone_tenant;
|
||||
'filter:authtoken/admin_user' : value => $keystone_user;
|
||||
'filter:authtoken/admin_password' : value => $keystone_password;
|
||||
}
|
||||
|
||||
firewall { $firewall_rule_name :
|
||||
dport => [ $bind_port ],
|
||||
proto => 'tcp',
|
||||
action => 'accept',
|
||||
}
|
||||
|
||||
Package['heat-common'] -> Package['heat-api-cfn'] -> Heat_api_cfn_config<||> -> Heat_api_cfn_paste_ini<||>
|
||||
Heat_api_cfn_config<||> ~> Service['heat-api-cfn']
|
||||
Heat_api_cfn_paste_ini<||> ~> Service['heat-api-cfn']
|
||||
Package['heat-common'] -> Package['heat-api-cfn'] -> Heat_config<||>
|
||||
Heat_config<||> ~> Service['heat-api-cfn']
|
||||
Package['heat-api-cfn'] ~> Service['heat-api-cfn']
|
||||
Class['heat::db'] -> Service['heat-api-cfn']
|
||||
Exec['heat_db_sync'] -> Service['heat-api-cfn']
|
||||
|
@ -1,31 +1,7 @@
|
||||
class heat::api_cloudwatch (
|
||||
$pacemaker = false,
|
||||
$keystone_host = '127.0.0.1',
|
||||
$keystone_port = '35357',
|
||||
$keystone_service_port = '5000',
|
||||
$keystone_protocol = 'http',
|
||||
$keystone_user = 'heat',
|
||||
$keystone_tenant = 'services',
|
||||
$keystone_password = false,
|
||||
$keystone_ec2_uri = 'http://127.0.0.1:5000/v2.0/ec2tokens',
|
||||
$auth_uri = 'http://127.0.0.1:5000/v2.0',
|
||||
$firewall_rule_name = '206 heat-api-cloudwatch',
|
||||
$bind_host = '0.0.0.0',
|
||||
$bind_port = '8003',
|
||||
$verbose = 'False',
|
||||
$debug = 'False',
|
||||
$rabbit_hosts = '',
|
||||
$rabbit_host = '127.0.0.1',
|
||||
$rabbit_userid = '',
|
||||
$rabbit_ha_queues = '',
|
||||
$rabbit_password = '',
|
||||
$rabbit_virtualhost = '/',
|
||||
$rabbit_port = '5672',
|
||||
$rabbit_queue_host = 'heat',
|
||||
$log_file = '/var/log/heat/api-cloudwatch.log',
|
||||
$rpc_backend = 'heat.openstack.common.rpc.impl_kombu',
|
||||
$use_stderr = 'False',
|
||||
$use_syslog = 'False',
|
||||
$firewall_rule_name = '206 heat-api-cloudwatch',
|
||||
) {
|
||||
|
||||
include heat::params
|
||||
@ -37,22 +13,6 @@ class heat::api_cloudwatch (
|
||||
name => $::heat::params::api_cloudwatch_package_name,
|
||||
}
|
||||
|
||||
if $rabbit_hosts {
|
||||
heat_api_config { 'DEFAULT/rabbit_host': ensure => absent }
|
||||
heat_api_config { 'DEFAULT/rabbit_port': ensure => absent }
|
||||
heat_api_config { 'DEFAULT/rabbit_hosts': value => join($rabbit_hosts, ',') }
|
||||
} else {
|
||||
heat_api_cloudwatch_config { 'DEFAULT/rabbit_host': value => $rabbit_host }
|
||||
heat_api_cloudwatch_config { 'DEFAULT/rabbit_port': value => $rabbit_port }
|
||||
heat_api_cloudwatch_config { 'DEFAULT/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" }
|
||||
}
|
||||
|
||||
if size($rabbit_hosts) > 1 {
|
||||
heat_api_cloudwatch_config { 'DEFAULT/rabbit_ha_queues': value => true }
|
||||
} else {
|
||||
heat_api_cloudwatch_config { 'DEFAULT/rabbit_ha_queues': value => false }
|
||||
}
|
||||
|
||||
service { 'heat-api-cloudwatch':
|
||||
ensure => 'running',
|
||||
name => $::heat::params::api_cloudwatch_service_name,
|
||||
@ -61,53 +21,14 @@ class heat::api_cloudwatch (
|
||||
hasrestart => true,
|
||||
}
|
||||
|
||||
heat_api_cloudwatch_config {
|
||||
'DEFAULT/rabbit_userid' : value => $rabbit_userid;
|
||||
'DEFAULT/rabbit_password' : value => $rabbit_password;
|
||||
'DEFAULT/rabbit_virtualhost' : value => $rabbit_virtualhost;
|
||||
'DEFAULT/host' : value => $rabbit_queue_host;
|
||||
'DEFAULT/debug' : value => $debug;
|
||||
'DEFAULT/verbose' : value => $verbose;
|
||||
'DEFAULT/log_dir' : value => $::heat::params::log_dir;
|
||||
'DEFAULT/bind_host' : value => $bind_host;
|
||||
'DEFAULT/bind_port' : value => $bind_port;
|
||||
'DEFAULT/log_file' : value => $log_file;
|
||||
'DEFAULT/rpc_backend' : value => $rpc_backend;
|
||||
'DEFAULT/use_stderr' : value => $use_stderr;
|
||||
'DEFAULT/use_syslog' : value => $use_syslog;
|
||||
'ec2authtoken/keystone_ec2_uri' : value => $keystone_ec2_uri;
|
||||
'ec2authtoken/auth_uri' : value => $auth_uri;
|
||||
'keystone_authtoken/auth_host' : value => $keystone_host;
|
||||
'keystone_authtoken/auth_port' : value => $keystone_port;
|
||||
'keystone_authtoken/auth_protocol' : value => $keystone_protocol;
|
||||
'keystone_authtoken/admin_tenant_name' : value => $keystone_tenant;
|
||||
'keystone_authtoken/admin_user' : value => $keystone_user;
|
||||
'keystone_authtoken/admin_password' : value => $keystone_password;
|
||||
}
|
||||
|
||||
heat_api_cloudwatch_paste_ini {
|
||||
'filter:authtoken/paste.filter_factory' : value => "heat.common.auth_token:filter_factory";
|
||||
'filter:authtoken/service_protocol' : value => $keystone_protocol;
|
||||
'filter:authtoken/service_host' : value => $keystone_host;
|
||||
'filter:authtoken/service_port' : value => $keystone_service_port;
|
||||
'filter:authtoken/auth_host' : value => $keystone_host;
|
||||
'filter:authtoken/auth_port' : value => $keystone_port;
|
||||
'filter:authtoken/auth_protocol' : value => $keystone_protocol;
|
||||
'filter:authtoken/auth_uri' : value => "${keystone_protocol}://${keystone_host}:${keystone_port}/v2.0";
|
||||
'filter:authtoken/admin_tenant_name' : value => $keystone_tenant;
|
||||
'filter:authtoken/admin_user' : value => $keystone_user;
|
||||
'filter:authtoken/admin_password' : value => $keystone_password;
|
||||
}
|
||||
|
||||
firewall { $firewall_rule_name :
|
||||
dport => [ $bind_port ],
|
||||
proto => 'tcp',
|
||||
action => 'accept',
|
||||
}
|
||||
|
||||
Package['heat-common'] -> Package['heat-api-cloudwatch'] -> Heat_api_cloudwatch_config<||> -> Heat_api_cloudwatch_paste_ini<||>
|
||||
Heat_api_cloudwatch_config<||> ~> Service['heat-api-cloudwatch']
|
||||
Heat_api_cloudwatch_paste_ini<||> ~> Service['heat-api-cloudwatch']
|
||||
Package['heat-common'] -> Package['heat-api-cloudwatch'] -> Heat_config<||>
|
||||
Heat_config<||> ~> Service['heat-api-cloudwatch']
|
||||
Package['heat-api-cloudwatch'] ~> Service['heat-api-cloudwatch']
|
||||
Class['heat::db'] -> Service['heat-api-cloudwatch']
|
||||
Exec['heat_db_sync'] -> Service['heat-api-cloudwatch']
|
||||
|
@ -30,7 +30,7 @@ class heat::db (
|
||||
}
|
||||
}
|
||||
|
||||
heat_engine_config {
|
||||
heat_config {
|
||||
'DEFAULT/sql_connection': value => $sql_connection;
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ class heat::db (
|
||||
refreshonly => true,
|
||||
logoutput => 'on_failure',
|
||||
}
|
||||
|
||||
|
||||
File['db_sync_script'] ~> Exec['heat_db_sync']
|
||||
Package['heat-engine'] ~> Exec['heat_db_sync']
|
||||
Package['heat-api'] ~> Exec['heat_db_sync']
|
||||
|
@ -1,37 +1,7 @@
|
||||
class heat::engine (
|
||||
$pacemaker = false,
|
||||
$keystone_host = '127.0.0.1',
|
||||
$keystone_port = '35357',
|
||||
$keystone_protocol = 'http',
|
||||
$keystone_user = 'heat',
|
||||
$keystone_tenant = 'services',
|
||||
$keystone_password = 'password',
|
||||
$bind_host = '0.0.0.0',
|
||||
$bind_port = '8001',
|
||||
$verbose = 'False',
|
||||
$debug = 'False',
|
||||
$heat_stack_user_role = 'heat_stack_user',
|
||||
$heat_metadata_server_url = 'http://127.0.0.1:8000',
|
||||
$heat_waitcondition_server_url = 'http://127.0.0.1:8000/v1/waitcondition',
|
||||
$heat_watch_server_url = 'http://127.0.0.1:8003',
|
||||
$rabbit_hosts = '',
|
||||
$rabbit_host = '',
|
||||
$rabbit_userid = '',
|
||||
$rabbit_ha_queues = '',
|
||||
$rabbit_password = '',
|
||||
$rabbit_virtualhost = '/',
|
||||
$rabbit_port = '5672',
|
||||
$rabbit_queue_host = 'heat',
|
||||
$auth_encryption_key = '%ENCRYPTION_KEY%',
|
||||
$db_backend = 'heat.db.sqlalchemy.api',
|
||||
$instance_connection_https_validate_certificates = '1',
|
||||
$instance_connection_is_secure = '0',
|
||||
$log_file = '/var/log/heat/engine.log',
|
||||
$rpc_backend = 'heat.openstack.common.rpc.impl_kombu',
|
||||
$use_stderr = 'False',
|
||||
$use_syslog = 'False',
|
||||
$ocf_scripts_dir = '/usr/lib/ocf/resource.d',
|
||||
$ocf_scripts_provider = 'mirantis',
|
||||
$pacemaker = false,
|
||||
$ocf_scripts_dir = '/usr/lib/ocf/resource.d',
|
||||
$ocf_scripts_provider = 'mirantis',
|
||||
) {
|
||||
|
||||
include heat::params
|
||||
@ -45,48 +15,19 @@ class heat::engine (
|
||||
name => $package_name,
|
||||
}
|
||||
|
||||
file { '/etc/heat/heat-engine.conf':
|
||||
owner => 'heat',
|
||||
group => 'heat',
|
||||
mode => '0640',
|
||||
}
|
||||
|
||||
if $rabbit_hosts {
|
||||
if is_array($rabbit_hosts) {
|
||||
$rabbit_hosts_v = join($rabbit_hosts, ',')
|
||||
} else {
|
||||
$rabbit_hosts_v = $rabbit_hosts
|
||||
}
|
||||
heat_engine_config { 'DEFAULT/rabbit_host': ensure => absent }
|
||||
heat_engine_config { 'DEFAULT/rabbit_port': ensure => absent }
|
||||
heat_engine_config { 'DEFAULT/rabbit_hosts': value => $rabbit_hosts_v }
|
||||
} else {
|
||||
heat_engine_config { 'DEFAULT/rabbit_host': value => $rabbit_host }
|
||||
heat_engine_config { 'DEFAULT/rabbit_port': value => $rabbit_port }
|
||||
heat_engine_config { 'DEFAULT/rabbit_hosts':
|
||||
value => "${rabbit_host}:${rabbit_port}"
|
||||
}
|
||||
}
|
||||
|
||||
if size($rabbit_hosts) > 1 {
|
||||
heat_engine_config { 'DEFAULT/rabbit_ha_queues': value => true }
|
||||
} else {
|
||||
heat_engine_config { 'DEFAULT/rabbit_ha_queues': value => false }
|
||||
}
|
||||
|
||||
if !$pacemaker {
|
||||
|
||||
# standard service mode
|
||||
|
||||
service { 'heat-engine':
|
||||
ensure => 'running',
|
||||
name => $service_name,
|
||||
enable => true,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
}
|
||||
service { 'heat-engine':
|
||||
ensure => 'running',
|
||||
name => $service_name,
|
||||
enable => true,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
}
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
# pacemaker resource mode
|
||||
|
||||
@ -113,7 +54,7 @@ class heat::engine (
|
||||
hasrestart => true,
|
||||
provider => 'pacemaker',
|
||||
}
|
||||
|
||||
|
||||
cs_shadow { $service_name :
|
||||
cib => $service_name,
|
||||
}
|
||||
@ -121,9 +62,9 @@ class heat::engine (
|
||||
cs_commit { $service_name :
|
||||
cib => $service_name,
|
||||
}
|
||||
|
||||
|
||||
corosync::cleanup { $service_name : }
|
||||
|
||||
|
||||
cs_resource { $service_name :
|
||||
ensure => present,
|
||||
cib => $service_name,
|
||||
@ -136,10 +77,10 @@ class heat::engine (
|
||||
'stop' => { 'timeout' => '60' },
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
File['heat-engine-ocf'] -> Cs_shadow[$service_name] -> Cs_resource[$service_name] -> Cs_commit[$service_name] ~> Corosync::Cleanup[$service_name] -> Service['heat-engine']
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
exec {'heat-encryption-key-replacement':
|
||||
command => 'sed -i "s/%ENCRYPTION_KEY%/`hexdump -n 16 -v -e \'/1 "%02x"\' /dev/random`/" /etc/heat/heat-engine.conf',
|
||||
@ -147,34 +88,10 @@ class heat::engine (
|
||||
onlyif => 'grep -c ENCRYPTION_KEY /etc/heat/heat-engine.conf',
|
||||
}
|
||||
|
||||
heat_engine_config {
|
||||
'DEFAULT/rabbit_userid' : value => $rabbit_userid;
|
||||
'DEFAULT/rabbit_password' : value => $rabbit_password;
|
||||
'DEFAULT/rabbit_virtualhost' : value => $rabbit_virtualhost;
|
||||
'DEFAULT/host' : value => $rabbit_queue_host;
|
||||
'DEFAULT/debug' : value => $debug;
|
||||
'DEFAULT/verbose' : value => $verbose;
|
||||
'DEFAULT/log_dir' : value => $::heat::params::log_dir;
|
||||
'DEFAULT/bind_host' : value => $bind_host;
|
||||
'DEFAULT/bind_port' : value => $bind_port;
|
||||
'DEFAULT/heat_stack_user_role' : value => $heat_stack_user_role;
|
||||
'DEFAULT/heat_metadata_server_url' : value => $heat_metadata_server_url;
|
||||
'DEFAULT/heat_waitcondition_server_url' : value => $heat_waitcondition_server_url;
|
||||
'DEFAULT/heat_watch_server_url' : value => $heat_watch_server_url;
|
||||
'DEFAULT/auth_encryption_key' : value => $auth_encryption_key;
|
||||
'DEFAULT/db_backend' : value => $db_backend;
|
||||
'DEFAULT/instance_connection_https_validate_certificates' : value => $instance_connection_https_validate_certificates;
|
||||
'DEFAULT/instance_connection_is_secure' : value => $instance_connection_is_secure;
|
||||
'DEFAULT/log_file' : value => $log_file;
|
||||
'DEFAULT/rpc_backend' : value => $rpc_backend;
|
||||
'DEFAULT/use_stderr' : value => $use_stderr;
|
||||
'DEFAULT/use_syslog' : value => $use_syslog;
|
||||
}
|
||||
|
||||
Package['heat-common'] -> Package['heat-engine'] -> File['/etc/heat/heat-engine.conf'] -> Heat_engine_config<||> ~> Service['heat-engine']
|
||||
File['/etc/heat/heat-engine.conf'] -> Exec['heat-encryption-key-replacement'] -> Service['heat-engine']
|
||||
File['/etc/heat/heat-engine.conf'] ~> Service['heat-engine']
|
||||
Package['heat-common'] -> Package['heat-engine'] -> File['/etc/heat/heat.conf'] -> Heat_config<||> ~> Service['heat-engine']
|
||||
File['/etc/heat/heat.conf'] -> Exec['heat-encryption-key-replacement'] -> Service['heat-engine']
|
||||
File['/etc/heat/heat.conf'] ~> Service['heat-engine']
|
||||
Class['heat::db'] -> Service['heat-engine']
|
||||
Heat_engine_config<||> -> Exec['heat_db_sync'] -> Service['heat-engine']
|
||||
Heat_config<||> -> Exec['heat_db_sync'] -> Service['heat-engine']
|
||||
|
||||
}
|
||||
|
@ -1,16 +1,14 @@
|
||||
class heat(
|
||||
$pacemaker = false,
|
||||
$external_ip = '127.0.0.1',
|
||||
$external_ip = '127.0.0.1',
|
||||
|
||||
# keystone
|
||||
$heat_keystone_host = '127.0.0.1',
|
||||
$heat_keystone_port = '5000',
|
||||
$heat_keystone_protocol = 'http',
|
||||
$heat_keystone_user = 'heat',
|
||||
$heat_keystone_tenant = 'services',
|
||||
$heat_keystone_password = 'heat',
|
||||
$heat_keystone_password = 'heat',
|
||||
|
||||
# database
|
||||
$heat_db_user = 'heat',
|
||||
$heat_db_password = 'heat',
|
||||
$heat_db_host = '127.0.0.1',
|
||||
@ -38,7 +36,7 @@ class heat(
|
||||
$heat_rabbit_port = '5672',
|
||||
$heat_rabbit_queue_host = 'heat',
|
||||
) {
|
||||
|
||||
|
||||
$heat_keystone_ec2_uri = "${heat_keystone_protocol}://${heat_keystone_host}:${heat_keystone_port}/v2.0/ec2tokens"
|
||||
$heat_auth_uri = "${heat_keystone_protocol}://${heat_keystone_host}:${heat_keystone_port}/v2.0"
|
||||
$heat_metadata_server_url = "http://${external_ip}:${heat_api_cfn_bind_port}"
|
||||
@ -54,21 +52,12 @@ class heat(
|
||||
}
|
||||
|
||||
class { 'heat::install' :
|
||||
}
|
||||
|
||||
class { 'heat::client' :
|
||||
}
|
||||
|
||||
class { 'heat::engine' :
|
||||
pacemaker => $pacemaker,
|
||||
keystone_host => $heat_keystone_host,
|
||||
keystone_port => $heat_keystone_port,
|
||||
keystone_protocol => $heat_keystone_protocol,
|
||||
keystone_user => $heat_keystone_user,
|
||||
keystone_tenant => $heat_keystone_tenant,
|
||||
keystone_password => $heat_keystone_password,
|
||||
bind_host => $heat_engine_bind_host,
|
||||
bind_port => $heat_engine_bind_port,
|
||||
heat_stack_user_role => $heat_stack_user_role,
|
||||
heat_metadata_server_url => $heat_metadata_server_url,
|
||||
heat_waitcondition_server_url => $heat_waitcondition_server_url,
|
||||
@ -76,7 +65,6 @@ class heat(
|
||||
verbose => $heat_verbose,
|
||||
debug => $heat_debug,
|
||||
rpc_backend => $heat_rpc_backend,
|
||||
|
||||
rabbit_host => $heat_rabbit_host,
|
||||
rabbit_userid => $heat_rabbit_login,
|
||||
rabbit_ha_queues => $heat_rabbit_ha_queues,
|
||||
@ -84,31 +72,24 @@ class heat(
|
||||
rabbit_virtualhost => $heat_rabbit_virtualhost,
|
||||
rabbit_port => $heat_rabbit_port,
|
||||
rabbit_queue_host => $heat_rabbit_queue_host,
|
||||
api_bind_host => $heat_api_bind_host,
|
||||
api_bind_port => $heat_api_bind_port,
|
||||
api_cfn_bind_host => $heat_api_cfn_bind_host,
|
||||
api_cfn_bind_port => $heat_api_cfn_bind_port,
|
||||
api_cloudwatch_bind_host => $heat_api_cloudwatch_bind_host,
|
||||
api_cloudwatch_bind_port => $heat_api_cloudwatch_bind_port,
|
||||
}
|
||||
|
||||
class { 'heat::client' :
|
||||
}
|
||||
|
||||
class { 'heat::engine' :
|
||||
pacemaker => $pacemaker,
|
||||
}
|
||||
|
||||
class { 'heat::api' :
|
||||
pacemaker => $pacemaker,
|
||||
keystone_host => $heat_keystone_host,
|
||||
keystone_port => $heat_keystone_port,
|
||||
keystone_protocol => $heat_keystone_protocol,
|
||||
keystone_user => $heat_keystone_user,
|
||||
keystone_tenant => $heat_keystone_tenant,
|
||||
keystone_password => $heat_keystone_password,
|
||||
keystone_ec2_uri => $heat_keystone_ec2_uri,
|
||||
auth_uri => $heat_auth_uri,
|
||||
bind_host => $heat_api_bind_host,
|
||||
bind_port => $heat_api_bind_port,
|
||||
verbose => $heat_verbose,
|
||||
debug => $heat_debug,
|
||||
rpc_backend => $heat_rpc_backend,
|
||||
|
||||
rabbit_host => $heat_rabbit_host,
|
||||
rabbit_userid => $heat_rabbit_login,
|
||||
rabbit_ha_queues => $heat_rabbit_ha_queues,
|
||||
rabbit_password => $heat_rabbit_password,
|
||||
rabbit_virtualhost => $heat_rabbit_virtualhost,
|
||||
rabbit_port => $heat_rabbit_port,
|
||||
rabbit_queue_host => $heat_rabbit_queue_host,
|
||||
}
|
||||
|
||||
class { 'heat::keystone::auth' :
|
||||
@ -128,53 +109,13 @@ class heat(
|
||||
}
|
||||
|
||||
class { 'heat::api_cfn' :
|
||||
pacemaker => $pacemaker,
|
||||
keystone_host => $heat_keystone_host,
|
||||
keystone_port => $heat_keystone_port,
|
||||
keystone_protocol => $heat_keystone_protocol,
|
||||
keystone_user => $heat_keystone_user,
|
||||
keystone_tenant => $heat_keystone_tenant,
|
||||
keystone_password => $heat_keystone_password,
|
||||
keystone_ec2_uri => $heat_keystone_ec2_uri,
|
||||
auth_uri => $heat_auth_uri,
|
||||
bind_host => $heat_api_cfn_bind_host,
|
||||
bind_port => $heat_api_cfn_bind_port,
|
||||
verbose => $heat_verbose,
|
||||
debug => $heat_debug,
|
||||
rpc_backend => $heat_rpc_backend,
|
||||
|
||||
rabbit_host => $heat_rabbit_host,
|
||||
rabbit_userid => $heat_rabbit_login,
|
||||
rabbit_ha_queues => $heat_rabbit_ha_queues,
|
||||
rabbit_password => $heat_rabbit_password,
|
||||
rabbit_virtualhost => $heat_rabbit_virtualhost,
|
||||
rabbit_port => $heat_rabbit_port,
|
||||
rabbit_queue_host => $heat_rabbit_queue_host,
|
||||
}
|
||||
|
||||
class { 'heat::api_cloudwatch' :
|
||||
pacemaker => $pacemaker,
|
||||
keystone_host => $heat_keystone_host,
|
||||
keystone_port => $heat_keystone_port,
|
||||
keystone_protocol => $heat_keystone_protocol,
|
||||
keystone_user => $heat_keystone_user,
|
||||
keystone_tenant => $heat_keystone_tenant,
|
||||
keystone_password => $heat_keystone_password,
|
||||
keystone_ec2_uri => $heat_keystone_ec2_uri,
|
||||
auth_uri => $heat_auth_uri,
|
||||
bind_host => $heat_api_cloudwatch_bind_host,
|
||||
bind_port => $heat_api_cloudwatch_bind_port,
|
||||
verbose => $heat_verbose,
|
||||
debug => $heat_debug,
|
||||
rpc_backend => $heat_rpc_backend,
|
||||
|
||||
rabbit_host => $heat_rabbit_host,
|
||||
rabbit_userid => $heat_rabbit_login,
|
||||
rabbit_ha_queues => $heat_rabbit_ha_queues,
|
||||
rabbit_password => $heat_rabbit_password,
|
||||
rabbit_virtualhost => $heat_rabbit_virtualhost,
|
||||
rabbit_port => $heat_rabbit_port,
|
||||
rabbit_queue_host => $heat_rabbit_queue_host,
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,55 @@
|
||||
class heat::install {
|
||||
class heat::install (
|
||||
$keystone_host = '127.0.0.1',
|
||||
$keystone_port = '35357',
|
||||
$keystone_service_port = '5000',
|
||||
$keystone_protocol = 'http',
|
||||
$keystone_user = 'heat',
|
||||
$keystone_tenant = 'services',
|
||||
$keystone_password = false,
|
||||
$keystone_ec2_uri = 'http://127.0.0.1:5000/v2.0/ec2tokens',
|
||||
$auth_uri = 'http://127.0.0.1:5000/v2.0',
|
||||
$verbose = 'False',
|
||||
$debug = 'False',
|
||||
$rabbit_hosts = '',
|
||||
$rabbit_host = '127.0.0.1',
|
||||
$rabbit_userid = '',
|
||||
$rabbit_ha_queues = '',
|
||||
$rabbit_password = '',
|
||||
$rabbit_virtualhost = '/',
|
||||
$rabbit_port = '5672',
|
||||
$rabbit_queue_host = 'heat',
|
||||
$log_file = '/var/log/heat/heat.log',
|
||||
$rpc_backend = 'heat.openstack.common.rpc.impl_kombu',
|
||||
$use_stderr = 'False',
|
||||
$use_syslog = 'False',
|
||||
$heat_stack_user_role = 'heat_stack_user',
|
||||
$heat_metadata_server_url = 'http://127.0.0.1:8000',
|
||||
$heat_waitcondition_server_url = 'http://127.0.0.1:8000/v1/waitcondition',
|
||||
$heat_watch_server_url = 'http://127.0.0.1:8003',
|
||||
$rabbit_queue_host = 'heat',
|
||||
$auth_encryption_key = '%ENCRYPTION_KEY%',
|
||||
$db_backend = 'heat.db.sqlalchemy.api',
|
||||
$instance_connection_https_validate_certificates = '1',
|
||||
$instance_connection_is_secure = '0',
|
||||
$api_bind_host = '0.0.0.0',
|
||||
$api_bind_port = '8004',
|
||||
$api_cfn_bind_host = '0.0.0.0',
|
||||
$api_cfn_bind_port = '8000',
|
||||
$api_cloudwatch_bind_host = '0.0.0.0',
|
||||
$api_cloudwatch_bind_port = '8003',
|
||||
|
||||
){
|
||||
|
||||
include heat::params
|
||||
|
||||
Package['heat-common'] -> Group['heat'] -> User['heat'] -> File['/etc/heat']
|
||||
|
||||
file { '/etc/heat/heat.conf':
|
||||
owner => 'heat',
|
||||
group => 'heat',
|
||||
mode => '0640',
|
||||
}
|
||||
|
||||
group { 'heat' :
|
||||
ensure => present,
|
||||
name => 'heat',
|
||||
@ -27,6 +75,60 @@ class heat::install {
|
||||
name => $::heat::params::common_package_name,
|
||||
}
|
||||
|
||||
Package['heat-common'] -> Group['heat'] -> User['heat'] -> File['/etc/heat']
|
||||
if $rabbit_hosts {
|
||||
if is_array($rabbit_hosts) {
|
||||
$rabbit_hosts_v = join($rabbit_hosts, ',')
|
||||
} else {
|
||||
$rabbit_hosts_v = $rabbit_hosts
|
||||
}
|
||||
heat_config { 'DEFAULT/rabbit_host': ensure => absent }
|
||||
heat_config { 'DEFAULT/rabbit_port': ensure => absent }
|
||||
heat_config { 'DEFAULT/rabbit_hosts': value => $rabbit_hosts_v }
|
||||
} else {
|
||||
heat_config { 'DEFAULT/rabbit_host': value => $rabbit_host }
|
||||
heat_config { 'DEFAULT/rabbit_port': value => $rabbit_port }
|
||||
heat_config { 'DEFAULT/rabbit_hosts':
|
||||
value => "${rabbit_host}:${rabbit_port}"
|
||||
}
|
||||
}
|
||||
|
||||
if size($rabbit_hosts) > 1 {
|
||||
heat_config { 'DEFAULT/rabbit_ha_queues': value => true }
|
||||
} else {
|
||||
heat_config { 'DEFAULT/rabbit_ha_queues': value => false }
|
||||
}
|
||||
|
||||
heat_config {
|
||||
'DEFAULT/heat_stack_user_role' : value => $heat_stack_user_role;
|
||||
'DEFAULT/heat_metadata_server_url' : value => $heat_metadata_server_url;
|
||||
'DEFAULT/heat_waitcondition_server_url' : value => $heat_waitcondition_server_url;
|
||||
'DEFAULT/heat_watch_server_url' : value => $heat_watch_server_url;
|
||||
'DEFAULT/auth_encryption_key' : value => $auth_encryption_key;
|
||||
'DEFAULT/db_backend' : value => $db_backend;
|
||||
'DEFAULT/instance_connection_https_validate_certificates' : value => $instance_connection_https_validate_certificates;
|
||||
'DEFAULT/instance_connection_is_secure' : value => $instance_connection_is_secure;
|
||||
'DEFAULT/log_file' : value => $log_file;
|
||||
'DEFAULT/rpc_backend' : value => $rpc_backend;
|
||||
'DEFAULT/use_stderr' : value => $use_stderr;
|
||||
'DEFAULT/use_syslog' : value => $use_syslog;
|
||||
'DEFAULT/rabbit_userid' : value => $rabbit_userid;
|
||||
'DEFAULT/rabbit_password' : value => $rabbit_password;
|
||||
'DEFAULT/rabbit_virtualhost' : value => $rabbit_virtualhost;
|
||||
'ec2authtoken/keystone_ec2_uri' : value => $keystone_ec2_uri;
|
||||
'ec2authtoken/auth_uri' : value => $auth_uri;
|
||||
'heat_api_cloudwatch/bind_host' : value => $api_clowdwatch_bind_host;
|
||||
'heat_api_cloudwatch/bind_port' : value => $api_clowdwatch_bind_port;
|
||||
'heat_api/bind_host' : value => $api_bind_host;
|
||||
'heat_api/bind_port' : value => $api_bind_port;
|
||||
'heat_api_cfn/bind_host' : value => $api_cfn_bind_host;
|
||||
'heat_api_cfn/bind_port' : value => $api_cfn_bind_port;
|
||||
'keystone_authtoken/auth_host' : value => $keystone_host;
|
||||
'keystone_authtoken/auth_port' : value => $keystone_port;
|
||||
'keystone_authtoken/auth_protocol' : value => $keystone_protocol;
|
||||
'keystone_authtoken/admin_tenant_name' : value => $keystone_tenant;
|
||||
'keystone_authtoken/admin_user' : value => $keystone_user;
|
||||
'keystone_authtoken/admin_password' : value => $keystone_password;
|
||||
'keystone_authtoken/auth_uri' : value => "${keystone_protocol}://${keystone_host}:${keystone_service_port}/v2.0";
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user