Add template for quantum API server

This patch move the puppet template for quantum API server into its
own template. This template will only be used when a node is defined
to be a quantum API server.

Change-Id: I398148d1d4c8f01922ef6e3fd60e93dfe61943ef
This commit is contained in:
Ryan O'Hara
2013-06-05 14:08:38 -05:00
parent c2f70cd138
commit 3d1c7a5656
3 changed files with 20 additions and 19 deletions

View File

@@ -311,15 +311,17 @@ def initSequences(controller):
def createManifest(config): def createManifest(config):
global q_hosts global q_hosts
for host in q_hosts: for host in q_hosts:
if host in api_hosts:
controller.CONF['CONFIG_QUANTUM_SERVER_ENABLE'] = 'true'
else:
controller.CONF['CONFIG_QUANTUM_SERVER_ENABLE'] = 'false'
manifest_file = "%s_quantum.pp" % (host,) manifest_file = "%s_quantum.pp" % (host,)
manifest_data = getManifestTemplate("quantum.pp") manifest_data = getManifestTemplate("quantum.pp")
appendManifestFile(manifest_file, manifest_data, 'quantum') appendManifestFile(manifest_file, manifest_data, 'quantum')
if host in api_hosts:
manifest_file = "%s_quantum.pp" % (host,)
manifest_data = getManifestTemplate("quantum_api.pp")
appendManifestFile(manifest_file, manifest_data, 'quantum')
# Set up any l2 plugin configs we need anywhere we install quantum # Set up any l2 plugin configs we need anywhere we install quantum
# XXX I am not completely sure about this, but it seems necessary # XXX I am not completely sure about this, but it seems necessary
if controller.CONF['CONFIG_QUANTUM_L2_PLUGIN'] == 'openvswitch': if controller.CONF['CONFIG_QUANTUM_L2_PLUGIN'] == 'openvswitch':
@@ -336,6 +338,7 @@ def createKeystoneManifest(config):
def createL3Manifests(config): def createL3Manifests(config):
global l3_hosts global l3_hosts
for host in l3_hosts: for host in l3_hosts:
controller.CONF['CONFIG_QUANTUM_L3_HOST'] = host controller.CONF['CONFIG_QUANTUM_L3_HOST'] = host
controller.CONF['CONFIG_QUANTUM_L3_INTERFACE_DRIVER'] = getInterfaceDriver() controller.CONF['CONFIG_QUANTUM_L3_INTERFACE_DRIVER'] = getInterfaceDriver()

View File

@@ -1,26 +1,13 @@
$quantum_db_host = '%(CONFIG_MYSQL_HOST)s' $quantum_db_host = '%(CONFIG_MYSQL_HOST)s'
$quantum_db_name = '%(CONFIG_QUANTUM_L2_DBNAME)s' $quantum_db_name = '%(CONFIG_QUANTUM_L2_DBNAME)s'
$quantum_db_user = 'quantum' $quantum_db_user = 'quantum'
$quantum_db_password = '%(CONFIG_QUANTUM_DB_PW)s' $quantum_db_password = '%(CONFIG_QUANTUM_DB_PW)s'
$quantum_sql_connection = "mysql://${quantum_db_user}:${quantum_db_password}@${quantum_db_host}/${quantum_db_name}" $quantum_sql_connection = "mysql://${quantum_db_user}:${quantum_db_password}@${quantum_db_host}/${quantum_db_name}"
$quantum_user_password = '%(CONFIG_QUANTUM_KS_PW)s' $quantum_user_password = '%(CONFIG_QUANTUM_KS_PW)s'
# set up a quantum server
class { 'quantum': class { 'quantum':
rpc_backend => 'quantum.openstack.common.rpc.impl_qpid', rpc_backend => 'quantum.openstack.common.rpc.impl_qpid',
qpid_hostname => '%(CONFIG_QPID_HOST)s', qpid_hostname => '%(CONFIG_QPID_HOST)s',
verbose => true, verbose => true,
} }
class { 'quantum::server':
auth_password => $quantum_user_password,
auth_host => '%(CONFIG_KEYSTONE_HOST)s',
enabled => '%(CONFIG_QUANTUM_SERVER_ENABLE)s',
}
firewall { '001 quantum incoming':
proto => 'tcp',
dport => ['9696'],
action => 'accept',
}

View File

@@ -0,0 +1,11 @@
class { 'quantum::server':
auth_password => $quantum_user_password,
auth_host => '%(CONFIG_KEYSTONE_HOST)s',
enabled => true,
}
firewall { '001 quantum incoming':
proto => 'tcp',
dport => ['9696'],
action => 'accept',
}