diff --git a/manifests/heat/api.pp b/manifests/heat/api.pp new file mode 100644 index 0000000..59ffdbd --- /dev/null +++ b/manifests/heat/api.pp @@ -0,0 +1,45 @@ +class kickstack::heat::api inherits kickstack { + + include pwgen + include ::kickstack::heat::config + + $apis = split($::kickstack::heat_apis,',') + + if 'heat' in $apis { + $heat_admin_password = pick(getvar("${fact_prefix}heat_keystone_password"),pwgen()) + class { '::heat::api': + enabled => true, + } + + kickstack::endpoint { 'heat': + service_password => $heat_admin_password, + require => Class['::heat::api'] + } + } + + if 'cfn' in $apis { + $cfn_admin_password = pick(getvar("${fact_prefix}heat_cfn_keystone_password"),pwgen()) + + class { '::heat::api_cfn': + enabled => true, + } + + kickstack::endpoint { 'heat_cfn': + servicename => 'heat', + classname => 'auth_cfn', + factname => "heat_cfn_keystone_password", + service_password => $cfn_admin_password, + require => Class['::heat::api_cfn'] + } + } + + if 'cloudwatch' in $apis { + class { '::heat::api_cloudwatch': + enabled => true, + } + + # The puppet-heat module has no facility for setting up the + # CloudWatch Keystone endpoint. + } + +} diff --git a/manifests/heat/config.pp b/manifests/heat/config.pp new file mode 100644 index 0000000..35e875f --- /dev/null +++ b/manifests/heat/config.pp @@ -0,0 +1,52 @@ +class kickstack::heat::config inherits kickstack { + include pwgen + + $admin_password = getvar("${fact_prefix}heat_keystone_password") + $auth_host = getvar("${fact_prefix}keystone_internal_address") + $auth_uri = "http://${auth_host}:5000/v2.0" + + $sql_conn = getvar("${fact_prefix}heat_sql_connection") + + case "$::kickstack::rpc" { + 'rabbitmq': { + $rabbit_host = getvar("${::kickstack::fact_prefix}rabbit_host") + $rabbit_password = getvar("${fact_prefix}rabbit_password") + class { '::heat': + package_ensure => $::kickstack::package_version, + auth_uri => $auth_uri, + sql_connection => $sql_conn, + rpc_backend => 'heat.openstack.common.rpc.impl_kombu', + rabbit_host => $rabbit_host, + rabbit_password => $rabbit_password, + rabbit_virtualhost => $::kickstack::rabbit_virtual_host, + rabbit_userid => $::kickstack::rabbit_userid, + keystone_host => $auth_host, + keystone_tenant => $kickstack::keystone_service_tenant, + keystone_user => 'heat', + keystone_password => $admin_password, + verbose => $::kickstack::verbose, + debug => $::kickstack::debug, + } + } + 'qpid': { + $qpid_hostname = getvar("${::kickstack::fact_prefix}qpid_hostname") + $qpid_password = getvar("${fact_prefix}qpid_password") + class { '::heat': + package_ensure => $::kickstack::package_version, + sql_connection => $sql_conn, + auth_uri => $auth_uri, + rpc_backend => 'heat.openstack.common.rpc.impl_qpid', + qpid_hostname => $qpid_hostname, + qpid_password => $qpid_password, + qpid_realm => $::kickstack::qpid_realm, + qpid_user => $::kickstack::qpid_user, + keystone_host => $auth_host, + keystone_tenant => $kickstack::keystone_service_tenant, + keystone_user => 'heat', + keystone_password => $admin_password, + verbose => $::kickstack::verbose, + debug => $::kickstack::debug, + } + } + } +} diff --git a/manifests/node/api.pp b/manifests/node/api.pp index 4714fd7..80c8299 100644 --- a/manifests/node/api.pp +++ b/manifests/node/api.pp @@ -45,4 +45,8 @@ class kickstack::node::api inherits kickstack { include kickstack::nova::neutronclient } } + + if $keystone_internal_address and $heat_sql_conn and $amqp_host and $amqp_password { + include kickstack::heat::api + } }