From 431487cb4e2accf1d4fdadf03015bca17707004b Mon Sep 17 00:00:00 2001 From: Florian Haas Date: Sun, 7 Jul 2013 17:50:34 +0000 Subject: [PATCH] Add Cinder API --- manifests/cinder/api.pp | 15 +++++++++++++ manifests/cinder/config.pp | 45 ++++++++++++++++++++++++++++++++++++++ manifests/node/api.pp | 2 ++ 3 files changed, 62 insertions(+) create mode 100644 manifests/cinder/api.pp create mode 100644 manifests/cinder/config.pp diff --git a/manifests/cinder/api.pp b/manifests/cinder/api.pp new file mode 100644 index 0000000..31cae45 --- /dev/null +++ b/manifests/cinder/api.pp @@ -0,0 +1,15 @@ +class kickstack::cinder::api inherits kickstack { + + include kickstack::cinder::config + + $service_password = getvar("${fact_prefix}cinder_keystone_password") + $keystone_internal_address = getvar("${fact_prefix}keystone_internal_address") + + class { '::cinder::api': + keystone_tenant => $kickstack::keystone_service_tenant, + keystone_user => 'cinder', + keystone_password => $service_password, + keystone_auth_host => $keystone_internal_address + } + +} diff --git a/manifests/cinder/config.pp b/manifests/cinder/config.pp new file mode 100644 index 0000000..0b800b5 --- /dev/null +++ b/manifests/cinder/config.pp @@ -0,0 +1,45 @@ +class kickstack::cinder::config inherits kickstack { + + $sql_conn = getvar("${fact_prefix}cinder_sql_connection") + + case "$::kickstack::rpc" { + "rabbitmq": { + $rabbit_host = getvar("${fact_prefix}rabbit_host") + $rabbit_password = getvar("${fact_prefix}rabbit_password") + if $rabbit_host and $rabbit_password { + class { 'cinder': + sql_connection => "$sql_conn", + rpc_backend => 'cinder.openstack.common.rpc.impl_kombu', + rabbit_host => "$rabbit_host", + rabbit_virtual_host => "$::kickstack::rabbit_virtual_host", + rabbit_userid => "$::kickstack::rabbit_userid", + rabbit_password => $rabbit_password, + verbose => $::kickstack::verbose, + debug => $::kickstack::debug, + } + } + else { + warning("Facts ${fact_prefix}rabbit_host or ${fact_prefix}rabbit_password unset, cannot configure cinder") + } + } + "qpid": { + $qpid_hostname = getvar("${fact_prefix}qpid_hostname") + $qpid_password = getvar("${fact_prefix}rabbit_password") + if $qpid_hostname and $qpid_password { + class { 'cinder': + sql_connection => "$sql_conn", + rpc_backend => 'cinder.openstack.common.rpc.impl_qpid', + qpid_hostname => "$qpid_hostname", + qpid_realm => "$::kickstack::qpid_realm", + qpid_username => "$::kickstack::qpid_username", + qpid_password => $qpid_password, + verbose => $::kickstack::verbose, + debug => $::kickstack::debug, + } + } + else { + warning("Facts ${fact_prefix}qpid_hostname or ${fact_prefix}qpid_password unset, cannot configure cinder") + } + } + } +} diff --git a/manifests/node/api.pp b/manifests/node/api.pp index a207043..fc7e16c 100644 --- a/manifests/node/api.pp +++ b/manifests/node/api.pp @@ -5,4 +5,6 @@ class kickstack::node::api inherits kickstack { include kickstack::glance::api include kickstack::glance::endpoint + + include kickstack::cinder::api }