77 lines
2.5 KiB
Puppet
77 lines
2.5 KiB
Puppet
# Installs & configure the heat engine service
|
|
|
|
class heat::engine (
|
|
$enabled = true,
|
|
$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',
|
|
) {
|
|
|
|
include heat::params
|
|
|
|
validate_string($keystone_password)
|
|
|
|
Heat_config<||> ~> Service['heat-engine']
|
|
|
|
Package['heat-engine'] -> Heat_config<||>
|
|
Package['heat-engine'] -> Service['heat-engine']
|
|
package { 'heat-engine':
|
|
ensure => installed,
|
|
name => $::heat::params::engine_package_name,
|
|
}
|
|
|
|
file { '/etc/heat/heat-engine.conf':
|
|
owner => 'heat',
|
|
group => 'heat',
|
|
mode => '0640',
|
|
}
|
|
|
|
if $enabled {
|
|
$service_ensure = 'running'
|
|
} else {
|
|
$service_ensure = 'stopped'
|
|
}
|
|
|
|
service { 'heat-engine':
|
|
ensure => $service_ensure,
|
|
name => $::heat::params::engine_service_name,
|
|
enable => $enabled,
|
|
hasstatus => true,
|
|
hasrestart => true,
|
|
require => [ File['/etc/heat/heat-engine.conf'],
|
|
Exec['heat-encryption-key-replacement'],
|
|
Package['heat-common'],
|
|
Package['heat-engine'],
|
|
Class['heat::db']],
|
|
}
|
|
|
|
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',
|
|
path => [ '/usr/bin', '/bin'],
|
|
onlyif => 'grep -c ENCRYPTION_KEY /etc/heat/heat-engine.conf',
|
|
}
|
|
|
|
heat_config {
|
|
'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;
|
|
}
|
|
}
|