From 72690e0b3c64a94a1ccd737b12a55f92edc3a2d3 Mon Sep 17 00:00:00 2001 From: Ryan Hefner Date: Thu, 9 Oct 2014 01:07:17 -0400 Subject: [PATCH] Enable Manila in Packstack Enables the configuration of the Manila File Share Service in Packstack. Uses the puppet-manila module for installation and configuration. Change-Id: I4509c9fbdc9317e03b32964b7b02672439e306fc --- packstack/plugins/manila_255.py | 347 ++++++++++++++++++ packstack/plugins/mariadb_003.py | 2 +- packstack/plugins/prescript_000.py | 19 + packstack/plugins/puppet_950.py | 12 +- packstack/puppet/templates/keystone_manila.pp | 7 + packstack/puppet/templates/manila.pp | 29 ++ packstack/puppet/templates/manila_generic.pp | 23 ++ packstack/puppet/templates/manila_netapp.pp | 10 + packstack/puppet/templates/manila_qpid.pp | 15 + packstack/puppet/templates/manila_rabbitmq.pp | 13 + .../templates/mariadb_manila_install.pp | 5 + .../templates/mariadb_manila_noinstall.pp | 29 ++ .../puppet/templates/openstack_client.pp | 4 + 13 files changed, 508 insertions(+), 7 deletions(-) create mode 100644 packstack/plugins/manila_255.py create mode 100644 packstack/puppet/templates/keystone_manila.pp create mode 100644 packstack/puppet/templates/manila.pp create mode 100644 packstack/puppet/templates/manila_generic.pp create mode 100644 packstack/puppet/templates/manila_netapp.pp create mode 100644 packstack/puppet/templates/manila_qpid.pp create mode 100644 packstack/puppet/templates/manila_rabbitmq.pp create mode 100644 packstack/puppet/templates/mariadb_manila_install.pp create mode 100644 packstack/puppet/templates/mariadb_manila_noinstall.pp diff --git a/packstack/plugins/manila_255.py b/packstack/plugins/manila_255.py new file mode 100644 index 000000000..1a7a77c16 --- /dev/null +++ b/packstack/plugins/manila_255.py @@ -0,0 +1,347 @@ +# -*- coding: utf-8 -*- +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Installs and configures Manila +""" +from packstack.installer import processors +from packstack.installer import validators +from packstack.installer import utils + +from packstack.modules.shortcuts import get_mq +from packstack.modules.ospluginutils import getManifestTemplate +from packstack.modules.ospluginutils import appendManifestFile +from packstack.modules.ospluginutils import createFirewallResources + +# ------------- Manila Packstack Plugin Initialization -------------- + +PLUGIN_NAME = "OS-Manila" +PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') + + +def initConfig(controller): + conf_params = { + "MANILA": [ + {"CMD_OPTION": "manila-db-passwd", + "USAGE": "The password to use for the Manila to access DB", + "PROMPT": "Enter the password for the Manila DB access", + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": "PW_PLACEHOLDER", + "PROCESSORS": [processors.process_password], + "MASK_INPUT": True, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_MANILA_DB_PW", + "USE_DEFAULT": False, + "NEED_CONFIRM": True, + "CONDITION": False}, + + {"CMD_OPTION": "manila-ks-passwd", + "USAGE": ("The password to use for the Manila to authenticate " + "with Keystone"), + "PROMPT": "Enter the password for the Manila Keystone access", + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": "PW_PLACEHOLDER", + "PROCESSORS": [processors.process_password], + "MASK_INPUT": True, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_MANILA_KS_PW", + "USE_DEFAULT": False, + "NEED_CONFIRM": True, + "CONDITION": False}, + + {"CMD_OPTION": "manila-backend", + "USAGE": ("The Manila backend to use, valid options are: " + "generic, netapp"), + "PROMPT": "Enter the Manila backend to be configured", + "OPTION_LIST": ["generic", "netapp"], + "VALIDATORS": [validators.validate_options], + "DEFAULT_VALUE": "generic", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_MANILA_BACKEND", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + ], + + "MANILANETAPP": [ + {"CMD_OPTION": "manila-netapp-nas-transport-type", + "USAGE": ("The transport protocol used when " + "communicating with ONTAPI on the storage system or " + "proxy server. Valid values are http or https. " + "Defaults to http"), + "PROMPT": ("Enter a NetApp transport type"), + "OPTION_LIST": ["http", "https"], + "VALIDATORS": [validators.validate_options], + "DEFAULT_VALUE": "http", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_MANILA_NETAPP_NAS_TRANSPORT_TYPE", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + + {"CMD_OPTION": "manila-netapp-nas-login", + "USAGE": ("Administrative user account name used to " + "access the storage system or proxy server. "), + "PROMPT": ("Enter a NetApp login"), + "OPTION_LIST": [""], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": "admin", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_MANILA_NETAPP_NAS_LOGIN", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + + {"CMD_OPTION": "manila-netapp-nas-password", + "USAGE": ("Password for the administrative user " + "account specified in the netapp_nas_login parameter."), + "PROMPT": ("Enter a NetApp password"), + "OPTION_LIST": [""], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": "", + "MASK_INPUT": True, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_MANILA_NETAPP_NAS_PASSWORD", + "USE_DEFAULT": False, + "NEED_CONFIRM": True, + "CONDITION": False}, + + {"CMD_OPTION": "manila-netapp-nas-server-hostname", + "USAGE": ("The hostname (or IP address) for the " + "storage system or proxy server."), + "PROMPT": ("Enter a NetApp hostname"), + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "PROCESSORS": [processors.process_add_quotes_around_values], + "DEFAULT_VALUE": "", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_MANILA_NETAPP_NAS_SERVER_HOSTNAME", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + + {"CMD_OPTION": "manila-netapp-aggregate-name-search-pattern", + "USAGE": ("Pattern for searching available aggregates " + "for provisioning."), + "PROMPT": ("Enter a NetApp aggregate name search pattern"), + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": "(.*)", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_MANILA_NETAPP_AGGREGATE_NAME_SEARCH_PATTERN", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + + {"CMD_OPTION": "manila-netapp-root-volume-aggregate", + "USAGE": ("Name of aggregate to create root volume " + "on. "), + "PROMPT": ("Enter a NetApp root volume aggregate"), + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": "", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_MANILA_NETAPP_ROOT_VOLUME_AGGREGATE", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + + {"CMD_OPTION": "manila-netapp-root-volume-name", + "USAGE": ("Root volume name. "), + "PROMPT": ("Enter a NetApp root volume name"), + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": "root", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_MANILA_NETAPP_ROOT_VOLUME_NAME", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + ], + + "MANILAGENERIC": [ + {"CMD_OPTION": "manila-generic-volume-name-template", + "USAGE": ("Volume name template. " + "Defaults to manila-share-%s"), + "PROMPT": ("Enter a volume name template"), + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": "manila-share-%s", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_MANILA_GENERIC_VOLUME_NAME_TEMPLATE", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + + {"CMD_OPTION": "manila-generic-share-mount-path", + "USAGE": ("Share mount path. " + "Defaults to /shares"), + "PROMPT": ("Enter a share mount path"), + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": "/shares", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_MANILA_GENERIC_SHARE_MOUNT_PATH", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + + {"CMD_OPTION": "manila-service-image-location", + "USAGE": ("Location of disk image for service " + "instance."), + "PROMPT": ("Enter a service image location"), + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": 'https://www.dropbox.com/s/vi5oeh10q1qkckh/' + 'ubuntu_1204_nfs_cifs.qcow2', + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_MANILA_SERVICE_IMAGE_LOCATION", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + + {"CMD_OPTION": "manila-service-instance-user", + "USAGE": ("User in service instance."), + "PROMPT": ("Enter a service instance user"), + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": 'ubuntu', + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_MANILA_SERVICE_INSTANCE_USER", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + + {"CMD_OPTION": "manila-service-instance-password", + "USAGE": ("Password to service instance user."), + "PROMPT": ("Enter a service instance password"), + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": 'ubuntu', + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_MANILA_SERVICE_INSTANCE_PASSWORD", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + ] + } + + conf_groups = [ + {"GROUP_NAME": "MANILA", + "DESCRIPTION": "Manila Config parameters", + "PRE_CONDITION": "CONFIG_MANILA_INSTALL", + "PRE_CONDITION_MATCH": "y", + "POST_CONDITION": False, + "POST_CONDITION_MATCH": True}, + + {"GROUP_NAME": "MANILANETAPP", + "DESCRIPTION": "Manila NetApp configuration", + "PRE_CONDITION": check_netapp_options, + "PRE_CONDITION_MATCH": True, + "POST_CONDITION": False, + "POST_CONDITION_MATCH": True}, + + {"GROUP_NAME": "MANILAGENERIC", + "DESCRIPTION": "Manila generic driver configuration", + "PRE_CONDITION": check_generic_options, + "PRE_CONDITION_MATCH": True, + "POST_CONDITION": False, + "POST_CONDITION_MATCH": True}, + ] + for group in conf_groups: + params = conf_params[group["GROUP_NAME"]] + controller.addGroup(group, params) + + +def initSequences(controller): + config = controller.CONF + if config['CONFIG_MANILA_INSTALL'] != 'y': + return + + config['CONFIG_MANILA_BACKEND'] = ( + [i.strip() for i in config['CONFIG_MANILA_BACKEND'].split(',') if i] + ) + + manila_steps = [ + {'title': 'Adding Manila Keystone manifest entries', + 'functions': [create_keystone_manifest]}, + {'title': 'Adding Manila manifest entries', + 'functions': [create_manifest]} + ] + + controller.addSequence("Installing OpenStack Manila", [], [], manila_steps) + + +# ------------------------- helper functions ------------------------- + +def check_netapp_options(config): + return (config.get('CONFIG_MANILA_INSTALL', 'n') == 'y' and + config.get('CONFIG_MANILA_BACKEND', 'generic') == 'netapp') + + +def check_generic_options(config): + return (config.get('CONFIG_MANILA_INSTALL', 'n') == 'y' and + config.get('CONFIG_MANILA_BACKEND', 'generic') == 'generic') + + +# -------------------------- step functions -------------------------- + +def create_keystone_manifest(config, messages): + if config['CONFIG_UNSUPPORTED'] != 'y': + config['CONFIG_STORAGE_HOST'] = config['CONFIG_CONTROLLER_HOST'] + + manifestfile = "%s_keystone.pp" % config['CONFIG_CONTROLLER_HOST'] + manifestdata = getManifestTemplate("keystone_manila.pp") + appendManifestFile(manifestfile, manifestdata) + + +def create_manifest(config, messages): + if config['CONFIG_UNSUPPORTED'] != 'y': + config['CONFIG_STORAGE_HOST'] = config['CONFIG_CONTROLLER_HOST'] + + manifestdata = getManifestTemplate(get_mq(config, "manila")) + manifestfile = "%s_manila.pp" % config['CONFIG_STORAGE_HOST'] + manifestdata += getManifestTemplate("manila.pp") + + backends = config['CONFIG_MANILA_BACKEND'] + for backend in backends: + manifestdata += getManifestTemplate('manila_%s.pp' % backend) + + # manila API should be open for everyone + fw_details = dict() + key = "manila_api" + fw_details.setdefault(key, {}) + fw_details[key]['host'] = "ALL" + fw_details[key]['service_name'] = "manila-api" + fw_details[key]['chain'] = "INPUT" + fw_details[key]['ports'] = ['8786'] + fw_details[key]['proto'] = "tcp" + config['FIREWALL_MANILA_API_RULES'] = fw_details + manifestdata += createFirewallResources('FIREWALL_MANILA_API_RULES') + + appendManifestFile(manifestfile, manifestdata) diff --git a/packstack/plugins/mariadb_003.py b/packstack/plugins/mariadb_003.py index 99a06d9c0..2431bf1b8 100644 --- a/packstack/plugins/mariadb_003.py +++ b/packstack/plugins/mariadb_003.py @@ -117,7 +117,7 @@ def create_manifest(config, messages): append_for("keystone", suffix) for mod in ['nova', 'cinder', 'glance', 'neutron', 'heat', 'sahara', - 'trove', 'ironic']: + 'trove', 'ironic', 'manila']: if config['CONFIG_%s_INSTALL' % mod.upper()] == 'y': append_for(mod, suffix) diff --git a/packstack/plugins/prescript_000.py b/packstack/plugins/prescript_000.py index c00586ce1..8d2230bd7 100644 --- a/packstack/plugins/prescript_000.py +++ b/packstack/plugins/prescript_000.py @@ -139,6 +139,25 @@ def initConfig(controller): "NEED_CONFIRM": False, "CONDITION": False}, + {"CMD_OPTION": "os-manila-install", + "USAGE": ( + "Set to 'y' if you would like Packstack to install " + "OpenStack Shared File System (Manila)" + ), + "PROMPT": ( + "Should Packstack install OpenStack Shared File System " + "(Manila) service" + ), + "OPTION_LIST": ["y", "n"], + "VALIDATORS": [validators.validate_options], + "DEFAULT_VALUE": "y", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_MANILA_INSTALL", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + {"CMD_OPTION": "os-nova-install", "USAGE": ( "Set to 'y' if you would like Packstack to install " diff --git a/packstack/plugins/puppet_950.py b/packstack/plugins/puppet_950.py index 982172b3f..d654a968b 100644 --- a/packstack/plugins/puppet_950.py +++ b/packstack/plugins/puppet_950.py @@ -187,12 +187,12 @@ def install_deps(config, messages): def copy_puppet_modules(config, messages): os_modules = ' '.join(('apache', 'ceilometer', 'certmonger', 'cinder', 'concat', 'firewall', 'glance', 'heat', 'horizon', - 'inifile', 'ironic', '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', + 'inifile', 'ironic', 'keystone', 'manila', + '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 diff --git a/packstack/puppet/templates/keystone_manila.pp b/packstack/puppet/templates/keystone_manila.pp new file mode 100644 index 000000000..d49d4f9f6 --- /dev/null +++ b/packstack/puppet/templates/keystone_manila.pp @@ -0,0 +1,7 @@ + +class { 'manila::keystone::auth': + password => hiera('CONFIG_MANILA_KS_PW'), + public_address => hiera('CONFIG_CONTROLLER_HOST'), + admin_address => hiera('CONFIG_CONTROLLER_HOST'), + internal_address => hiera('CONFIG_CONTROLLER_HOST'), +} diff --git a/packstack/puppet/templates/manila.pp b/packstack/puppet/templates/manila.pp new file mode 100644 index 000000000..5433b2440 --- /dev/null +++ b/packstack/puppet/templates/manila.pp @@ -0,0 +1,29 @@ +manila_config { + 'DEFAULT/glance_host': value => hiera('CONFIG_CONTROLLER_HOST'); +} + +package { 'python-keystone': + notify => Class['manila::api'], +} + +class { 'manila::api': + keystone_password => hiera('CONFIG_MANILA_KS_PW'), + keystone_tenant => 'services', + keystone_user => 'manila', + keystone_auth_host => hiera('CONFIG_CONTROLLER_HOST'), +} + +class { 'manila::network::neutron': + neutron_admin_password => hiera('CONFIG_NEUTRON_KS_PW'), + neutron_admin_tenant_name => 'services', +} + +class { 'manila::scheduler': +} + +class { 'manila::share': +} + +class { 'manila::backends': + enabled_share_backends => hiera('CONFIG_MANILA_BACKEND'), +} diff --git a/packstack/puppet/templates/manila_generic.pp b/packstack/puppet/templates/manila_generic.pp new file mode 100644 index 000000000..90c0385c2 --- /dev/null +++ b/packstack/puppet/templates/manila_generic.pp @@ -0,0 +1,23 @@ + +package { 'nfs-utils': ensure => present } + +manila::backend::generic{ 'generic': + volume_name_template => hiera('CONFIG_MANILA_GENERIC_VOLUME_NAME_TEMPLATE'), + share_mount_path => hiera('CONFIG_MANILA_GENERIC_SHARE_MOUNT_PATH'), +} + +manila::service_instance{ 'generic': + service_image_location => hiera('CONFIG_MANILA_SERVICE_IMAGE_LOCATION'), + service_instance_user => hiera('CONFIG_MANILA_SERVICE_INSTANCE_USER'), + service_instance_password => hiera('CONFIG_MANILA_SERVICE_INSTANCE_PASSWORD'), +} + +class { 'manila::compute::nova': + nova_admin_password => hiera('CONFIG_NOVA_KS_PW'), + nova_admin_tenant_name => 'services', +} + +class { 'manila::volume::cinder': + cinder_admin_password => hiera('CONFIG_CINDER_KS_PW'), + cinder_admin_tenant_name => 'services', +} diff --git a/packstack/puppet/templates/manila_netapp.pp b/packstack/puppet/templates/manila_netapp.pp new file mode 100644 index 000000000..e9c591f04 --- /dev/null +++ b/packstack/puppet/templates/manila_netapp.pp @@ -0,0 +1,10 @@ + +manila::backend::netapp{ 'netapp': + netapp_nas_transport_type => hiera('CONFIG_MANILA_NETAPP_NAS_TRANSPORT_TYPE'), + netapp_nas_login => hiera('CONFIG_MANILA_NETAPP_NAS_LOGIN'), + netapp_nas_password => hiera('CONFIG_MANILA_NETAPP_NAS_PASSWORD'), + netapp_nas_server_hostname => hiera('CONFIG_MANILA_NETAPP_NAS_SERVER_HOSTNAME'), + netapp_aggregate_name_search_pattern => hiera('CONFIG_MANILA_NETAPP_AGGREGATE_NAME_SEARCH_PATTERN'), + netapp_root_volume_aggregate => hiera('CONFIG_MANILA_NETAPP_ROOT_VOLUME_AGGREGATE'), + netapp_root_volume_name => hiera('CONFIG_MANILA_NETAPP_ROOT_VOLUME_NAME'), +} diff --git a/packstack/puppet/templates/manila_qpid.pp b/packstack/puppet/templates/manila_qpid.pp new file mode 100644 index 000000000..fee5f3ed6 --- /dev/null +++ b/packstack/puppet/templates/manila_qpid.pp @@ -0,0 +1,15 @@ + +$db_pw = hiera('CONFIG_MANILA_DB_PW') +$mariadb_host = hiera('CONFIG_MARIADB_HOST') + +class {'manila': + rpc_backend => 'manila.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'), + sql_connection => "mysql://manila:${db_pw}@${mariadb_host}/manila", + verbose => true, + debug => hiera(CONFIG_DEBUG_MODE), +} diff --git a/packstack/puppet/templates/manila_rabbitmq.pp b/packstack/puppet/templates/manila_rabbitmq.pp new file mode 100644 index 000000000..92e4f2340 --- /dev/null +++ b/packstack/puppet/templates/manila_rabbitmq.pp @@ -0,0 +1,13 @@ + +$db_pw = hiera('CONFIG_MANILA_DB_PW') +$mariadb_host = hiera('CONFIG_MARIADB_HOST') + +class { 'manila': + 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'), + sql_connection => "mysql://manila:${db_pw}@${mariadb_host}/manila", + verbose => true, + debug => hiera('CONFIG_DEBUG_MODE'), +} diff --git a/packstack/puppet/templates/mariadb_manila_install.pp b/packstack/puppet/templates/mariadb_manila_install.pp new file mode 100644 index 000000000..bd6ca311d --- /dev/null +++ b/packstack/puppet/templates/mariadb_manila_install.pp @@ -0,0 +1,5 @@ +class { 'manila::db::mysql': + password => hiera('CONFIG_MANILA_DB_PW'), + allowed_hosts => '%%', + charset => 'utf8', +} diff --git a/packstack/puppet/templates/mariadb_manila_noinstall.pp b/packstack/puppet/templates/mariadb_manila_noinstall.pp new file mode 100644 index 000000000..250cdbc54 --- /dev/null +++ b/packstack/puppet/templates/mariadb_manila_noinstall.pp @@ -0,0 +1,29 @@ + +remote_database { 'manila': + ensure => 'present', + charset => 'utf8', + db_host => hiera('CONFIG_MARIADB_HOST'), + db_user => hiera('CONFIG_MARIADB_USER'), + db_password => hiera('CONFIG_MARIADB_PW'), + provider => 'mysql', +} + +$mariadb_manila_noinstall_db_pw = hiera('CONFIG_MANILA_DB_PW') + +remote_database_user { 'manila@%%': + password_hash => mysql_password($mariadb_manila_noinstall_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['manila'], +} + +remote_database_grant { 'manila@%%/manila': + 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['manila@%%'], +} diff --git a/packstack/puppet/templates/openstack_client.pp b/packstack/puppet/templates/openstack_client.pp index de02f5458..051ea7327 100644 --- a/packstack/puppet/templates/openstack_client.pp +++ b/packstack/puppet/templates/openstack_client.pp @@ -8,6 +8,10 @@ $clientlibs = ['python-novaclient', 'python-keystoneclient', package { $clientlibs: } +if hiera('CONFIG_MANILA_INSTALL') == 'y' { + package { 'python-manilaclient': } +} + $ost_cl_keystone_admin_pw = hiera('CONFIG_KEYSTONE_ADMIN_PW') $ost_cl_ctrl_host = hiera('CONFIG_CONTROLLER_HOST') $ost_cl_keystone_region = hiera('CONFIG_KEYSTONE_REGION')