Sahara support to Packstack in time for Juno

Change-Id: Ic5381aede97d03d79151700afa3257ae8b1fd277
This commit is contained in:
Robbie Harwood (frozencemetery)
2014-12-02 17:45:02 -05:00
parent e07307b436
commit 2edd3aeba8
11 changed files with 230 additions and 5 deletions

View File

@@ -41,6 +41,9 @@ Global Options
**CONFIG_SWIFT_INSTALL** **CONFIG_SWIFT_INSTALL**
Set to 'y' if you would like Packstack to install Swift ['y', 'n']. Set to 'y' if you would like Packstack to install Swift ['y', 'n'].
**CONFIG_SAHARA_INSTALL**
Set to 'y' if you would like Packstack to install Sahara ['y', 'n'].
**CONFIG_CLIENT_INSTALL** **CONFIG_CLIENT_INSTALL**
Set to 'y' if you would like Packstack to install the OpenStack Client packages. An admin "rc" file will also be installed ['y', 'n']. Set to 'y' if you would like Packstack to install the OpenStack Client packages. An admin "rc" file will also be installed ['y', 'n'].
@@ -509,7 +512,6 @@ Neutron Config Parameters
**CONFIG_NEUTRON_ML2_VNI_RANGES** **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. 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.
Provision Config Parameters Provision Config Parameters
--------------------------- ---------------------------
@@ -540,6 +542,18 @@ Provision Config Parameters
**CONFIG_PROVISION_TEMPEST_REPO_URI** **CONFIG_PROVISION_TEMPEST_REPO_URI**
The uri of the tempest git repository to use. The uri of the tempest git repository to use.
Sahara Config Parameters
------------------------
**CONFIG_SAHARA_DB_PW**
The password to use for Sahara to access DB.
**CONFIG_SAHARA_HOST**
The IP address of the server on which to install Sahara if Sahara is being installed.
**CONFIG_SAHARA_KS_PW**
The password to use for Sahara to authenticate with Keystone.
Log files and Debug info Log files and Debug info
------------------------ ------------------------

View File

@@ -105,7 +105,7 @@ def create_manifest(config, messages):
manifestdata.append(getManifestTemplate(template)) manifestdata.append(getManifestTemplate(template))
append_for("keystone", suffix) append_for("keystone", suffix)
for mod in ['nova', 'cinder', 'glance', 'neutron', 'heat']: for mod in ['nova', 'cinder', 'glance', 'neutron', 'heat', 'sahara']:
if config['CONFIG_%s_INSTALL' % mod.upper()] == 'y': if config['CONFIG_%s_INSTALL' % mod.upper()] == 'y':
append_for(mod, suffix) append_for(mod, suffix)

View File

@@ -234,6 +234,24 @@ def initConfig(controller):
"NEED_CONFIRM": False, "NEED_CONFIRM": False,
"CONDITION": False}, "CONDITION": False},
{"CMD_OPTION": "os-sahara-install",
"USAGE": (
"Set to 'y' if you would like Packstack to install "
"OpenStack Clustering (Sahara)"
),
"PROMPT": (
"Should Packstack install OpenStack Clustering (Sahara)"
),
"OPTION_LIST": ["y", "n"],
"VALIDATORS": [validators.validate_options],
"DEFAULT_VALUE": "n",
"MASK_INPUT": False,
"LOOSE_VALIDATION": False,
"CONF_NAME": "CONFIG_SAHARA_INSTALL",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "os-client-install", {"CMD_OPTION": "os-client-install",
"USAGE": ( "USAGE": (
"Set to 'y' if you would like Packstack to install " "Set to 'y' if you would like Packstack to install "
@@ -528,6 +546,23 @@ def initConfig(controller):
"USE_DEFAULT": False, "USE_DEFAULT": False,
"NEED_CONFIRM": False, "NEED_CONFIRM": False,
"CONDITION": False}, "CONDITION": False},
{"CONF_NAME": "CONFIG_SAHARA_HOST",
"CMD_OPTION": "os-sahara-host",
"USAGE": (
"(Unsupported!) The IP address of the server on which "
"to install OpenStack services specific to Sahara"
),
"PROMPT": "Enter the IP address of the Sahara host",
"OPTION_LIST": [],
"VALIDATORS": [validators.validate_ip,
validators.validate_ssh],
"DEFAULT_VALUE": utils.get_localhost_ip(),
"MASK_INPUT": False,
"LOOSE_VALIDATION": False,
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
] ]
} }

View File

@@ -176,9 +176,9 @@ def copy_puppet_modules(config, messages):
'inifile', 'keystone', 'memcached', 'mongodb', 'inifile', 'keystone', 'memcached', 'mongodb',
'mysql', 'neutron', 'nova', 'nssdb', 'openstack', 'mysql', 'neutron', 'nova', 'nssdb', 'openstack',
'packstack', 'qpid', 'rabbitmq', 'redis', 'remote', 'packstack', 'qpid', 'rabbitmq', 'redis', 'remote',
'rsync', 'ssh', 'stdlib', 'swift', 'sysctl', 'rsync', 'sahara', 'ssh', 'stdlib', 'swift',
'tempest', 'vcsrepo', 'vlan', 'vswitch', 'xinetd', 'sysctl', 'tempest', 'vcsrepo', 'vlan', 'vswitch',
'openstacklib')) 'xinetd', 'openstacklib'))
# write puppet manifest to disk # write puppet manifest to disk
manifestfiles.writeManifests() manifestfiles.writeManifests()

View File

@@ -0,0 +1,105 @@
# -*- coding: utf-8 -*-
"""
Installs and configures Sahara
"""
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)
#------------------ Sahara installer initialization ------------------
PLUGIN_NAME = "OS-Sahara"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, "blue")
def initConfig(controller):
params = [
{"CONF_NAME": "CONFIG_SAHARA_DB_PW",
"CMD_OPTION": "sahara-db-passwd",
"PROMPT": "Enter the password to use for Sahara to access the DB",
"USAGE": "The password to use for the Sahara 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_SAHARA_KS_PW",
"CMD_OPTION": "sahara-ks-passwd",
"USAGE": ("The password to use for Sahara to authenticate "
"with Keystone"),
"PROMPT": "Enter the password for Sahara 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},
]
group = {"GROUP_NAME": "SAHARA",
"DESCRIPTION": "Sahara Config parameters",
"PRE_CONDITION": "CONFIG_SAHARA_INSTALL",
"PRE_CONDITION_MATCH": "y",
"POST_CONDITION": False,
"POST_CONDITION_MATCH": True}
controller.addGroup(group, params)
def initSequences(controller):
conf = controller.CONF
if conf["CONFIG_SAHARA_INSTALL"] != 'y':
return
saharasteps = [
{"title": "Adding Sahara Keystone manifest entries",
"functions": [create_keystone_manifest]},
{"title": "Adding Sahara manifest entries",
"functions": [create_manifest]},
]
controller.addSequence("Installing Sahara", [], [], saharasteps)
#-------------------------- step functions --------------------------
def create_keystone_manifest(config, messages):
if config['CONFIG_UNSUPPORTED'] != 'y':
config['CONFIG_SAHARA_HOST'] = config['CONFIG_CONTROLLER_HOST']
manifestfile = "%s_keystone.pp" % config['CONFIG_CONTROLLER_HOST']
manifestdata = getManifestTemplate("keystone_sahara")
appendManifestFile(manifestfile, manifestdata)
def create_manifest(config, messages):
if config['CONFIG_UNSUPPORTED'] != 'y':
config['CONFIG_STORAGE_HOST'] = config['CONFIG_CONTROLLER_HOST']
manifestfile = "%s_sahara.pp" % config['CONFIG_STORAGE_HOST']
manifestdata = getManifestTemplate(get_mq(config, "sahara"))
manifestdata += getManifestTemplate("sahara.pp")
fw_details = dict()
key = "sahara-api"
fw_details.setdefault(key, {})
fw_details[key]["host"] = "ALL"
fw_details[key]["service_name"] = "sahara api"
fw_details[key]["chain"] = "INPUT"
fw_details[key]["ports"] = ["8386"]
fw_details[key]["proto"] = "tcp"
config["FIREWALL_SAHARA_CFN_RULES"] = fw_details
manifestdata += createFirewallResources("FIREWALL_SAHARA_CFN_RULES")
appendManifestFile(manifestfile, manifestdata, marker='sahara')

View File

@@ -0,0 +1,6 @@
class { 'sahara::keystone::auth':
password => hiera('CONFIG_SAHARA_KS_PW'),
public_address => hiera('CONFIG_SAHARA_HOST'),
admin_address => hiera('CONFIG_SAHARA_HOST'),
internal_address => hiera('CONFIG_SAHARA_HOST'),
}

View File

@@ -0,0 +1,5 @@
class { 'sahara::db::mysql':
password => hiera('CONFIG_SAHARA_DB_PW'),
host => '%%',
allowed_hosts => '%%',
}

View File

@@ -0,0 +1,28 @@
remote_database { 'sahara':
ensure => 'present',
charset => 'utf8',
db_host => hiera('CONFIG_MARIADB_HOST'),
db_user => hiera('CONFIG_MARIADB_USER'),
db_password => hiera('CONFIG_MARIADB_PW'),
provider => 'mysql',
}
$sahara_cfg_sahara_db_pw = hiera('CONFIG_SAHARA_DB_PW')
remote_database_user { 'sahara@%%':
password_hash => mysql_password($sahara_cfg_sahara_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['sahara'],
}
remote_database_grant { 'sahara@%%/sahara':
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['sahara@%%'],
}

View File

@@ -0,0 +1,19 @@
$sahara_cfg_sahara_db_pw = hiera('CONFIG_SAHARA_DB_PW')
$sahara_cfg_sahara_mariadb_host = hiera('CONFIG_MARIADB_HOST')
$sahara_cfg_config_neutron_install = hiera('CONFIG_NEUTRON_INSTALL')
$sahara_cfg_controller_host = hiera('CONFIG_CONTROLLER_HOST')
class { 'sahara':
database_connection =>
"mysql://sahara:${sahara_cfg_sahara_db_pw}@${sahara_cfg_sahara_mariadb_host}/sahara",
verbose => true,
debug => hiera('CONFIG_DEBUG_MODE'),
os_username => 'admin',
os_password => hiera('CONFIG_KEYSTONE_ADMIN_PW'),
os_tenant_name => 'admin',
os_auth_url => "http://${sahara_cfg_controller_host}:5000/v2.0",
identity_url => "http://${sahara_cfg_controller_host}:35357/",
use_neutron => ($sahara_cfg_controller_host == 'y'),
service_host => hiera('CONFIG_SAHARA_HOST'),
}

View File

@@ -0,0 +1,7 @@
class { 'sahara::notify::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_PASSWORD'),
}

View File

@@ -0,0 +1,6 @@
class { 'sahara::notify::rabbitmq':
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'),
}