Configure api-cnf.pp manifest

This commit is contained in:
Émilien Macchi 2013-05-30 18:46:11 +02:00
parent fbaeef4c7f
commit 7c9893532c
1 changed files with 73 additions and 0 deletions

View File

@ -0,0 +1,73 @@
# Installs & configure the heat CloudFormation api service
#
# == Parameters
# [*enabled*]
# should the service be enabled. Optional. Defaults to true
#
# [*keystone_host*]
# keystone's admin endpoint IP/Host. Optional. Defaults to 127.0.0.1
#
# [*keystone_port*]
# keystone's admin endpoint port. Optional. Defaults to 35357
#
# [*keystone_protocol*] http/https
# Optional. Defaults to https
#
# [*keytone_user*] user to authenticate with
# Optional. Defaults to heat
#
# [*keystone_tenant*] tenant to authenticate with
# Optional. Defaults to services
#
# [*keystone_password*] password to authenticate with
# Mandatory.
#
class heat::api (
$enabled = true,
$keystone_host = '127.0.0.1',
$keystone_port = '35357',
$keystone_protocol = 'http',
$keystone_user = 'heat',
$keystone_tenant = 'services',
$keystone_password = false,
) {
include heat::params
validate_string($keystone_password)
heat_config<||> ~> Service['heat-api-cnf']
Package['heat-api-cnf'] -> heat_config<||>
Package['heat-api-cnf'] -> Service['heat-api-cnf']
package { 'heat-api-cnf':
ensure => installed,
name => $::heat::params::api_package_name,
}
if $enabled {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
Package['heat-common'] -> Service['heat-api-cnf']
service { 'heat-api-cnf':
ensure => $service_ensure,
name => $::heat::params::api_service_name,
enable => $enabled,
hasstatus => true,
hasrestart => true,
require => Class['heat::db'],
subscribe => Exec['heat-dbsync']
}
heat_config {
'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;
}
}