From 42c8e39d4051e060011368bbed3c251a9082a3f2 Mon Sep 17 00:00:00 2001 From: Florian Haas Date: Sun, 14 Jul 2013 10:13:01 +0000 Subject: [PATCH] Fix prerequisites for network nodes --- manifests/node/network.pp | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/manifests/node/network.pp b/manifests/node/network.pp index c019dc9..8f7c174 100644 --- a/manifests/node/network.pp +++ b/manifests/node/network.pp @@ -1,6 +1,32 @@ class kickstack::node::network inherits kickstack { - include kickstack::quantum::agent::l2 - include kickstack::quantum::agent::dhcp - include kickstack::quantum::agent::l3 - include kickstack::quantum::agent::metadata + + # Network nodes require a quantum Keystone endpoint. + # The L2 agents need an SQL connection. + # The metadata agent also requires the shared secret set by Nova API. + + case $::kickstack::rpc { + 'rabbitmq': { + $amqp_host = getvar("${::kickstack::fact_prefix}rabbit_host") + $amqp_password = getvar("${::kickstack::fact_prefix}rabbit_password") + } + 'qpid': { + $amqp_host = getvar("${::kickstack::fact_prefix}qpid_host") + $amqp_password = getvar("${::kickstack::fact_prefix}qpid_password") + } + } + + $quantum_sql_conn = getvar("${::kickstack::fact_prefix}quantum_sql_connection") + $quantum_keystone_password = getvar("${::kickstack::fact_prefix}quantum_keystone_password") + $quantum_metadata_shared_secret = getvar("${::kickstack::fact_prefix}quantum_metadata_shared_secret") + + if $amqp_host and $amqp_password and $quantum_keystone_password { + include kickstack::quantum::agent::dhcp + include kickstack::quantum::agent::l3 + if $quantum_sql_conn { + include kickstack::quantum::agent::l2 + } + if $quantum_metadata_shared_secret { + include kickstack::quantum::agent::metadata + } + } }