Trove Support
This commit adds support for Trove to Packstack. Change-Id: I8a4c00099da3f78f44a7fd25c094a42fa54bb447
This commit is contained in:
parent
fafb92e9c8
commit
ab47974d48
|
@ -68,6 +68,9 @@ Global Options
|
|||
**CONFIG_MARIADB_INSTALL**
|
||||
Set to 'y' if you would like Packstack to install MariaDB.
|
||||
|
||||
**CONFIG_TROVE_INSTALL**
|
||||
Set to 'y' if you would like Packstack to install Openstack Database (Trove)
|
||||
|
||||
**CONFIG_CONTROLLER_HOST**
|
||||
The IP address of the server on which to install OpenStack services specific to controller role such as API servers, Horizon, etc. This parameter replaced following deprecated parameters: CONFIG_CEILOMETER_HOST, CONFIG_CINDER_HOST, CONFIG_GLANCE_HOST, CONFIG_HORIZON_HOST, CONFIG_HEAT_HOST, CONFIG_KEYSTONE_HOST, CONFIG_NAGIOS_HOST, CONFIG_NEUTRON_SERVER_HOST, CONFIG_NEUTRON_LBAAS_HOSTS, CONFIG_NOVA_API_HOST, CONFIG_NOVA_CERT_HOST, CONFIG_NOVA_VNCPROXY_HOST, CONFIG_NOVA_SCHED_HOST, CONFIG_OSCLIENT_HOST, CONFIG_SWIFT_PROXY_HOSTS.
|
||||
|
||||
|
@ -512,6 +515,24 @@ Neutron Config Parameters
|
|||
**CONFIG_NEUTRON_ML2_VNI_RANGES**
|
||||
A comma separated list of **<vni_min>:<vni_max>** tuples enumerating ranges of VXLAN VNI IDs that are available for tenant network allocation. Min value is 0 and Max value is 16777215.
|
||||
|
||||
Trove Config Parameters
|
||||
-----------------------
|
||||
|
||||
**CONFIG_TROVE_DB_PW**
|
||||
The password to use for Trove to access DB.
|
||||
|
||||
**CONFIG_TROVE_KS_PW**
|
||||
The password to use for Trove to authenticate with Keystone.
|
||||
|
||||
**CONFIG_TROVE_NOVA_USER**
|
||||
The user to use when Trove launches instances in Nova
|
||||
|
||||
**CONFIG_TROVE_NOVA_TENANT**
|
||||
The tenant to use when Trove launches instances in Nova
|
||||
|
||||
**CONFIG_TROVE_NOVA_PW**
|
||||
The password to use when Trove launches instances in Nova
|
||||
|
||||
Provision Config Parameters
|
||||
---------------------------
|
||||
|
||||
|
|
|
@ -105,7 +105,8 @@ def create_manifest(config, messages):
|
|||
manifestdata.append(getManifestTemplate(template))
|
||||
|
||||
append_for("keystone", suffix)
|
||||
for mod in ['nova', 'cinder', 'glance', 'neutron', 'heat', 'sahara']:
|
||||
for mod in ['nova', 'cinder', 'glance', 'neutron', 'heat', 'sahara',
|
||||
'trove']:
|
||||
if config['CONFIG_%s_INSTALL' % mod.upper()] == 'y':
|
||||
append_for(mod, suffix)
|
||||
|
||||
|
|
|
@ -252,6 +252,24 @@ def initConfig(controller):
|
|||
"NEED_CONFIRM": False,
|
||||
"CONDITION": False},
|
||||
|
||||
{"CMD_OPTION": "os-trove-install",
|
||||
"USAGE": (
|
||||
"Set to 'y' if you would like Packstack to install "
|
||||
"OpenStack Database (Trove)"
|
||||
),
|
||||
"PROMPT": (
|
||||
"Should Packstack install OpenStack Database (Trove)"
|
||||
),
|
||||
"OPTION_LIST": ["y", "n"],
|
||||
"VALIDATORS": [validators.validate_options],
|
||||
"DEFAULT_VALUE": "n",
|
||||
"MASK_INPUT": False,
|
||||
"LOOSE_VALIDATION": False,
|
||||
"CONF_NAME": "CONFIG_TROVE_INSTALL",
|
||||
"USE_DEFAULT": False,
|
||||
"NEED_CONFIRM": False,
|
||||
"CONDITION": False},
|
||||
|
||||
{"CMD_OPTION": "os-client-install",
|
||||
"USAGE": (
|
||||
"Set to 'y' if you would like Packstack to install "
|
||||
|
|
|
@ -173,12 +173,13 @@ def install_deps(config, messages):
|
|||
def copy_puppet_modules(config, messages):
|
||||
os_modules = ' '.join(('apache', 'ceilometer', 'certmonger', 'cinder',
|
||||
'concat', 'firewall', 'glance', 'heat', 'horizon',
|
||||
'inifile', 'keystone', 'memcached', 'mongodb',
|
||||
'mysql', 'neutron', 'nova', 'nssdb', 'openstack',
|
||||
'packstack', 'qpid', 'rabbitmq', 'redis', 'remote',
|
||||
'rsync', 'sahara', 'ssh', 'stdlib', 'swift',
|
||||
'sysctl', 'tempest', 'vcsrepo', 'vlan', 'vswitch',
|
||||
'xinetd', 'openstacklib'))
|
||||
'inifile', 'keystone', 'memcached',
|
||||
'mongodb', 'mysql', 'neutron', 'nova', 'nssdb',
|
||||
'openstack', 'packstack', 'qpid', 'rabbitmq',
|
||||
'redis', 'remote', 'rsync', 'sahara', 'ssh',
|
||||
'stdlib', 'swift', 'sysctl', 'tempest', 'trove',
|
||||
'vcsrepo', 'vlan', 'vswitch', 'xinetd',
|
||||
'openstacklib'))
|
||||
|
||||
# write puppet manifest to disk
|
||||
manifestfiles.writeManifests()
|
||||
|
|
|
@ -0,0 +1,159 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
Installs and configures Trove
|
||||
"""
|
||||
|
||||
import uuid
|
||||
|
||||
from packstack.installer import utils
|
||||
from packstack.installer import validators
|
||||
from packstack.installer import processors
|
||||
from packstack.modules.shortcuts import get_mq
|
||||
from packstack.modules.ospluginutils import (getManifestTemplate,
|
||||
appendManifestFile,
|
||||
createFirewallResources)
|
||||
|
||||
|
||||
# ------------------ Trove Packstack Plugin initialization ------------------
|
||||
|
||||
PLUGIN_NAME = "OS-Trove"
|
||||
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
|
||||
|
||||
|
||||
# NOVA_USER, NOVA_TENANT, NOVA_PW
|
||||
|
||||
def process_trove_nova_pw(param, param_name, config=None):
|
||||
if (param == 'PW_PLACEHOLDER' and
|
||||
config['CONFIG_TROVE_NOVA_USER'] == 'admin'):
|
||||
return config['CONFIG_KEYSTONE_ADMIN_PW']
|
||||
else:
|
||||
return param
|
||||
|
||||
|
||||
def initConfig(controller):
|
||||
parameters = [
|
||||
{"CONF_NAME": "CONFIG_TROVE_DB_PW",
|
||||
"CMD_OPTION": "trove-db-passwd",
|
||||
"PROMPT": "Enter the password to use for Trove to access the DB",
|
||||
"USAGE": "The password to use for the Trove DB access",
|
||||
"OPTION_LIST": [],
|
||||
"VALIDATORS": [validators.validate_not_empty],
|
||||
"DEFAULT_VALUE": "PW_PLACEHOLDER",
|
||||
"PROCESSORS": [processors.process_password],
|
||||
"MASK_INPUT": True,
|
||||
"LOOSE_VALIDATION": False,
|
||||
"USE_DEFAULT": False,
|
||||
"NEED_CONFIRM": True,
|
||||
"CONDITION": False},
|
||||
|
||||
{"CONF_NAME": "CONFIG_TROVE_KS_PW",
|
||||
"CMD_OPTION": "trove-ks-passwd",
|
||||
"USAGE": ("The password to use for Trove to authenticate "
|
||||
"with Keystone"),
|
||||
"PROMPT": "Enter the password for Trove Keystone access",
|
||||
"OPTION_LIST": [],
|
||||
"VALIDATORS": [validators.validate_not_empty],
|
||||
"DEFAULT_VALUE": "PW_PLACEHOLDER",
|
||||
"PROCESSORS": [processors.process_password],
|
||||
"MASK_INPUT": True,
|
||||
"LOOSE_VALIDATION": False,
|
||||
"USE_DEFAULT": False,
|
||||
"NEED_CONFIRM": True,
|
||||
"CONDITION": False},
|
||||
|
||||
{"CONF_NAME": "CONFIG_TROVE_NOVA_USER",
|
||||
"CMD_OPTION": "trove-nova-user",
|
||||
"USAGE": "The user to use when Trove connects to Nova",
|
||||
"PROMPT": "Enter the user for Trove to use to connect to Nova",
|
||||
"OPTION_LIST": [],
|
||||
"VALIDATORS": [validators.validate_not_empty],
|
||||
"DEFAULT_VALUE": "admin",
|
||||
"MASK_INPUT": False,
|
||||
"LOOSE_VALIDATION": False,
|
||||
"USE_DEFAULT": True,
|
||||
"NEED_CONFIRM": True,
|
||||
"CONDITION": False},
|
||||
|
||||
{"CONF_NAME": "CONFIG_TROVE_NOVA_TENANT",
|
||||
"CMD_OPTION": "trove-nova-tenant",
|
||||
"USAGE": "The tenant to use when Trove connects to Nova",
|
||||
"PROMPT": "Enter the tenant for Trove to use to connect to Nova",
|
||||
"OPTION_LIST": [],
|
||||
"VALIDATORS": [validators.validate_not_empty],
|
||||
"DEFAULT_VALUE": "services",
|
||||
"MASK_INPUT": False,
|
||||
"LOOSE_VALIDATION": False,
|
||||
"USE_DEFAULT": True,
|
||||
"NEED_CONFIRM": True,
|
||||
"CONDITION": False},
|
||||
|
||||
{"CONF_NAME": "CONFIG_TROVE_NOVA_PW",
|
||||
"CMD_OPTION": "trove-nova-passwd",
|
||||
"USAGE": "The password to use when Trove connects to Nova",
|
||||
"PROMPT": "Enter the password for Trove to use to connect to Nova",
|
||||
"OPTION_LIST": [],
|
||||
"VALIDATORS": [validators.validate_not_empty],
|
||||
"DEFAULT_VALUE": "PW_PLACEHOLDER", # default is admin pass
|
||||
"PROCESSORS": [process_trove_nova_pw],
|
||||
"MASK_INPUT": True,
|
||||
"LOOSE_VALIDATION": False,
|
||||
"USE_DEFAULT": False,
|
||||
"NEED_CONFIRM": True,
|
||||
"CONDITION": False},
|
||||
]
|
||||
|
||||
group = {"GROUP_NAME": "Trove",
|
||||
"DESCRIPTION": "Trove config parameters",
|
||||
"PRE_CONDITION": "CONFIG_TROVE_INSTALL",
|
||||
"PRE_CONDITION_MATCH": "y",
|
||||
"POST_CONDITION": False,
|
||||
"POST_CONDITION_MATCH": True}
|
||||
|
||||
controller.addGroup(group, parameters)
|
||||
|
||||
|
||||
def initSequences(controller):
|
||||
config = controller.CONF
|
||||
if config['CONFIG_TROVE_INSTALL'] != 'y':
|
||||
return
|
||||
|
||||
steps = [
|
||||
{'title': 'Adding Trove Keystone manifest entries',
|
||||
'functions': [create_keystone_manifest]},
|
||||
{'title': 'Adding Trove manifest entries',
|
||||
'functions': [create_manifest]},
|
||||
]
|
||||
|
||||
controller.addSequence("Installing Trove", [], [], steps)
|
||||
|
||||
# ------------------------ step functions --------------------------
|
||||
|
||||
|
||||
def create_keystone_manifest(config, messages):
|
||||
manifestfile = "%s_keystone.pp" % config['CONFIG_CONTROLLER_HOST']
|
||||
manifestdata = getManifestTemplate("keystone_trove.pp")
|
||||
appendManifestFile(manifestfile, manifestdata)
|
||||
|
||||
|
||||
def create_manifest(config, messages):
|
||||
if (config['CONFIG_TROVE_NOVA_USER'] == 'admin' and
|
||||
config['CONFIG_TROVE_NOVA_PW'] == ''):
|
||||
config['CONFIG_TROVE_NOVA_PW'] = config['CONFIG_KEYSTONE_ADMIN_PW']
|
||||
|
||||
manifestfile = "%s_trove.pp" % config["CONFIG_CONTROLLER_HOST"]
|
||||
manifestdata = getManifestTemplate(get_mq(config, "trove"))
|
||||
manifestdata += getManifestTemplate('trove.pp')
|
||||
|
||||
fw_details = dict()
|
||||
key = "trove"
|
||||
fw_details.setdefault(key, {})
|
||||
fw_details[key]['host'] = "ALL"
|
||||
fw_details[key]['service_name'] = "trove api"
|
||||
fw_details[key]['chain'] = "INPUT"
|
||||
fw_details[key]['ports'] = ['8779']
|
||||
fw_details[key]['proto'] = "tcp"
|
||||
config['FIREWALL_TROVE_API_RULES'] = fw_details
|
||||
|
||||
manifestdata += createFirewallResources('FIREWALL_TROVE_API_RULES')
|
||||
appendManifestFile(manifestfile, manifestdata, marker='trove')
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
class { 'trove::keystone::auth':
|
||||
region => hiera('CONFIG_KEYSTONE_REGION'),
|
||||
password => hiera('CONFIG_TROVE_KS_PW'),
|
||||
public_address => hiera('CONFIG_CONTROLLER_HOST'),
|
||||
admin_address => hiera('CONFIG_CONTROLLER_HOST'),
|
||||
internal_address => hiera('CONFIG_CONTROLLER_HOST'),
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
class { 'trove::db::mysql':
|
||||
password => hiera('CONFIG_TROVE_DB_PW'),
|
||||
host => '%%',
|
||||
allowed_hosts => '%%',
|
||||
charset => 'utf8',
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
remote_database {'trove':
|
||||
ensure => 'present',
|
||||
charset => 'utf8',
|
||||
db_host => hiera('CONFIG_MARIADB_HOST'),
|
||||
db_user => hiera('CONFIG_MARIADB_USER'),
|
||||
db_password => hiera('CONFIG_MARIADB_PW'),
|
||||
provider => 'mysql',
|
||||
}
|
||||
|
||||
$trove_cfg_trove_db_pw = hiera('CONFIG_TROVE_DB_PW')
|
||||
|
||||
remote_database_user { 'trove@%%':
|
||||
password_hash => mysql_password($trove_cfg_trove_db_pw),
|
||||
db_host => hiera('CONFIG_MARIADB_HOST'),
|
||||
db_user => hiera('CONFIG_MARIADB_USER'),
|
||||
db_password => hiera('CONFIG_MARIADB_PW'),
|
||||
provider => 'mysql',
|
||||
require => Remote_database['trove'],
|
||||
}
|
||||
|
||||
remote_database_grant { 'trove@%%/trove':
|
||||
privileges => "all",
|
||||
db_host => hiera('CONFIG_MARIADB_HOST'),
|
||||
db_user => hiera('CONFIG_MARIADB_USER'),
|
||||
db_password => hiera('CONFIG_MARIADB_PW'),
|
||||
provider => 'mysql',
|
||||
require => Remote_database_user['trove@%%'],
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
class { 'trove::api':
|
||||
enabled => true,
|
||||
keystone_password => hiera('CONFIG_TROVE_KS_PW'),
|
||||
auth_host => hiera('CONFIG_CONTROLLER_HOST'),
|
||||
auth_port => 35357,
|
||||
cert_file => false,
|
||||
key_file => false,
|
||||
ca_file => false,
|
||||
verbose => true,
|
||||
debug => hiera('CONFIG_DEBUG_MODE'),
|
||||
}
|
||||
|
||||
$trove_cfg_ctrl_host = hiera('CONFIG_CONTROLLER_HOST')
|
||||
|
||||
class { 'trove::conductor':
|
||||
auth_url => "http://${trove_cfg_ctrl_host}:5000/v2.0",
|
||||
verbose => true,
|
||||
debug => hiera('CONFIG_DEBUG_MODE'),
|
||||
}
|
||||
|
||||
class { 'trove::taskmanager':
|
||||
auth_url => "http://${trove_cfg_ctrl_host}:5000/v2.0",
|
||||
verbose => true,
|
||||
debug => hiera('CONFIG_DEBUG_MODE'),
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
$trove_qpid_cfg_trove_db_pw = hiera('CONFIG_TROVE_DB_PW')
|
||||
$trove_qpid_cfg_mariadb_host = hiera('CONFIG_MARIADB_HOST')
|
||||
$trove_qpid_cfg_controller_host = hiera('CONFIG_CONTROLLER_HOST')
|
||||
|
||||
class { 'trove':
|
||||
rpc_backend => 'trove.openstack.common.rpc.impl_qpid',
|
||||
qpid_hostname => hiera('CONFIG_AMQP_HOST'),
|
||||
qpid_port => hiera('CONFIG_AMQP_CLIENTS_PORT'),
|
||||
qpid_protocol => hiera('CONFIG_AMQP_PROTOCOL'),
|
||||
qpid_username => hiera('CONFIG_AMQP_AUTH_USER'),
|
||||
qpid_password => hiera('CONFIG_AMQP_AUTH_PASSWORD'),
|
||||
database_connection => "mysql://trove:${trove_qpid_cfg_trove_db_pw}@${trove_qpid_cfg_mariadb_host}/trove",
|
||||
nova_proxy_admin_user => hiera('CONFIG_TROVE_NOVA_USER'),
|
||||
nova_proxy_admin_tenant_name => hiera('CONFIG_TROVE_NOVA_TENANT'),
|
||||
nova_proxy_admin_pass => hiera('CONFIG_TROVE_NOVA_PW'),
|
||||
nova_compute_url => "http://${trove_qpid_cfg_controller_host}:8774/v2",
|
||||
cinder_url => "http://${trove_qpid_cfg_controller_host}:8776/v1",
|
||||
swift_url => "http://${trove_qpid_cfg_controller_host}:8080/v1/AUTH_",
|
||||
use_neutron => hiera('CONFIG_NEUTRON_INSTALL'),
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
$trove_rabmq_cfg_trove_db_pw = hiera('CONFIG_TROVE_DB_PW')
|
||||
$trove_rabmq_cfg_mariadb_host = hiera('CONFIG_MARIADB_HOST')
|
||||
$trove_rabmq_cfg_controller_host = hiera('CONFIG_CONTROLLER_HOST')
|
||||
|
||||
class { 'trove':
|
||||
rpc_backend => 'trove.openstack.common.rpc.impl_kombu',
|
||||
rabbit_host => hiera('CONFIG_AMQP_HOST'),
|
||||
rabbit_port => hiera('CONFIG_AMQP_CLIENTS_PORT'),
|
||||
rabbit_userid => hiera('CONFIG_AMQP_AUTH_USER'),
|
||||
rabbit_password => hiera('CONFIG_AMQP_AUTH_PASSWORD'),
|
||||
database_connection => "mysql://trove:${trove_rabmq_cfg_trove_db_pw}@${trove_rabmq_cfg_mariadb_host}/trove",
|
||||
nova_proxy_admin_user => hiera('CONFIG_TROVE_NOVA_USER'),
|
||||
nova_proxy_admin_tenant_name => hiera('CONFIG_TROVE_NOVA_TENANT'),
|
||||
nova_proxy_admin_pass => hiera('CONFIG_TROVE_NOVA_PW'),
|
||||
nova_compute_url => "http://${trove_rabmq_cfg_controller_host}:8774/v2",
|
||||
cinder_url => "http://${trove_rabmq_cfg_controller_host}:8776/v1",
|
||||
swift_url => "http://${trove_rabmq_cfg_controller_host}:8080/v1/AUTH_",
|
||||
use_neutron => hiera('CONFIG_NEUTRON_INSTALL'),
|
||||
}
|
Loading…
Reference in New Issue