WIP: Clean cookbook for general use
- Update for Newton and beyond - Do not add Mirantis repos, use UCA packages - Use global rabbitmq settings - Make dashboard installation optional on a server - Split attributes for murano.conf into separate file - Do not set attributes to their default value - Update resource provider for Keystone V3 - Add integration task for CI TODO: - Fix endpoint definitions and usage - Fix dashboard installation - Update tests Depends-On: I0cdfcaad75cc2743002143a25e389b95c72c9877 Change-Id: Icc5894870fe469369548a692c1141cc33204bcf6
This commit is contained in:
parent
f3a601771c
commit
230ced24b1
25
Rakefile
25
Rakefile
@ -29,3 +29,28 @@ task :clean do
|
||||
'Berksfile.lock'
|
||||
]
|
||||
end
|
||||
|
||||
desc "All-in-One Neutron build"
|
||||
task :integration => :common_integration do
|
||||
# Noop
|
||||
end
|
||||
|
||||
desc "Common task used by all cookbooks for integration test"
|
||||
task :common_integration do
|
||||
# Use the berksfile support to make use of the existing patch clones.
|
||||
# Make a sym link from workspace/gate-cookbook-openstack-common-chef-rake-integration
|
||||
# to workspace/cookbook-openstack-common
|
||||
patch_dir = Dir.pwd
|
||||
patch_dir_berks = ENV['ZUUL_PROJECT'].split('/')[1]
|
||||
sh %(ls -la ..)
|
||||
sh %(ls -la ../..)
|
||||
sh %(sudo ln -s #{patch_dir} ../#{patch_dir_berks})
|
||||
|
||||
unless Dir.exist?('../openstack-chef-repo')
|
||||
sh %(git clone --depth 1 git://github.com/openstack/openstack-chef-repo.git ../openstack-chef-repo)
|
||||
end
|
||||
|
||||
Dir.chdir('../openstack-chef-repo') do
|
||||
sh %(chef exec rake integration)
|
||||
end
|
||||
end
|
||||
|
@ -55,12 +55,6 @@ end
|
||||
default['openstack']['endpoints'][type]['application-catalog']['port'] = '8082'
|
||||
end
|
||||
|
||||
default['openstack']['murano']['apt_murano_repo'] = 'http://mirror.fuel-infra.org/mos-repos/ubuntu/9.0/'
|
||||
default['openstack']['murano']['apt_murano_key'] = 'http://mirror.fuel-infra.org/mos-repos/ubuntu/9.0/archive-mos9.0.key'
|
||||
default['openstack']['murano']['apt_murano_distribution'] = 'mos9.0'
|
||||
default['openstack']['murano']['apt_murano_components'] = ['main']
|
||||
|
||||
default['openstack']['murano']['dbmanage_command'] = 'murano-db-manage --config-file /etc/murano/murano.conf upgrade'
|
||||
default['openstack']['murano']['default_external_network'] = 'ext-net'
|
||||
default['openstack']['murano']['tenant'] = 'services'
|
||||
default['openstack']['murano']['auth_url'] = 'http://127.0.0.1:5000'
|
||||
@ -78,8 +72,6 @@ default['openstack']['murano']['log_facility'] = nil
|
||||
default['openstack']['murano']['log_dir'] = '/var/log/murano'
|
||||
default['openstack']['murano']['data_dir'] = '/var/cache/murano'
|
||||
default['openstack']['murano']['notification_driver'] = 'messagingv2'
|
||||
default['openstack']['murano']['rabbit_ha_queues'] = nil
|
||||
default['openstack']['murano']['rabbit_own_vhost'] = 'murano'
|
||||
default['openstack']['murano']['service_host'] = '127.0.0.1'
|
||||
default['openstack']['murano']['service_port'] = '8082'
|
||||
default['openstack']['murano']['service_role'] = 'admin'
|
||||
@ -105,21 +97,11 @@ default['openstack']['murano']['default_log_levels'] = [
|
||||
'websocket=WARN'
|
||||
]
|
||||
default['openstack']['murano']['use_ssl'] = false
|
||||
default['openstack']['murano']['use_neutron'] = true
|
||||
default['openstack']['murano']['use_trusts'] = true
|
||||
default['openstack']['murano']['packages_service'] = 'murano'
|
||||
default['openstack']['murano']['sync_db'] = true
|
||||
# v3
|
||||
default['openstakc']['murano']['conf']['keystone_authtoken']['auth_type'] = 'v3password'
|
||||
default['openstack']['murano']['conf']['keystone_authtoken']['project_name'] = 'service'
|
||||
default['openstack']['murano']['conf']['keystone_authtoken']['project_domain_name'] = 'Default'
|
||||
default['openstack']['murano']['conf']['keystone_authtoken']['user_domain_name'] = 'Default'
|
||||
# end of v3
|
||||
default['openstack']['murano']['admin_user'] = 'murano'
|
||||
default['openstack']['murano']['admin_tenant_name'] = 'service'
|
||||
default['openstack']['murano']['auth_uri'] = 'http://127.0.0.1:5000'
|
||||
default['openstack']['murano']['identity_uri'] = 'http://127.0.0.1:35357/'
|
||||
default['openstack']['murano']['signing_dir'] = '/tmp/keystone-signing-muranoapi'
|
||||
default['openstack']['murano']['cfapi_enabled'] = false
|
||||
default['openstack']['murano']['dashboard_collect_static_script'] = '/usr/share/openstack-dashboard/manage.py'
|
||||
default['openstack']['murano']['dashboard_metadata_dir'] = '/var/cache/murano-dashboard'
|
||||
@ -140,9 +122,6 @@ default['openstack']['murano']['openrc_repo_url'] = 'http://storage.apps.opensta
|
||||
default['openstack']['murano']['cert_file'] = nil
|
||||
default['openstack']['murano']['key_file'] = nil
|
||||
default['openstack']['murano']['ca_file'] = nil
|
||||
default['openstack']['murano']['external_network'] = nil
|
||||
default['openstack']['murano']['default_router'] = 'murano-default-router'
|
||||
default['openstack']['murano']['default_nameservers'] = '8.8.8.8'
|
||||
default['openstack']['murano']['database_connection'] = nil
|
||||
default['openstack']['murano']['database_idle_timeout'] = nil
|
||||
default['openstack']['murano']['database_min_pool_size'] = nil
|
||||
@ -157,80 +136,8 @@ if default['openstack']['murano']['use_ssl']
|
||||
raise 'cert_file, key_file and ca_file parameters must be set when use_ssl is set to true'
|
||||
end
|
||||
end
|
||||
if default['openstack']['murano']['use_neutron']
|
||||
unless default['openstack']['murano']['default_router']
|
||||
raise 'The default_router parameter is required when use_neutron is set to true'
|
||||
end
|
||||
end
|
||||
default['openstack']['murano']['glare'] = if default['openstack']['murano']['packages_service'] == 'glance'
|
||||
default['openstack']['murano']['glare'] = if node['openstack']['murano']['packages_service'] == 'glance'
|
||||
false
|
||||
else
|
||||
true
|
||||
end
|
||||
# Config
|
||||
default['openstack']['murano']['conf'].tap do |conf|
|
||||
conf['networking']['create_router'] = default['openstack']['murano']['use_neutron']
|
||||
conf['networking']['default_dns'] = default['openstack']['murano']['default_nameservers']
|
||||
if default['openstack']['murano']['use_neutron']
|
||||
conf['networking']['router_name'] = default['openstack']['murano']['default_router']
|
||||
conf['networking']['external_network'] = default['openstack']['murano']['external_network']
|
||||
end
|
||||
if default['openstack']['murano']['use_ssl']
|
||||
%w(cert_file ca_file key_file).each do |ssl_file|
|
||||
conf['ssl'][ssl_file] = default['openstack']['murano'][ssl_file]
|
||||
end
|
||||
end
|
||||
conf['murano']['url'] = if default['openstack']['murano']['use_ssl']
|
||||
"https://#{default['openstack']['murano']['service_host']}:#{default['openstack']['murano']['service_port']}"
|
||||
else
|
||||
"http://#{default['openstack']['murano']['service_host']}:#{default['openstack']['murano']['service_port']}"
|
||||
end
|
||||
conf['engine']['use_trusts'] = default['openstack']['murano']['use_trusts']
|
||||
conf['rabbitmq']['login'] = default['openstack']['mq']['compute']['rabbit']['userid']
|
||||
conf['keystone_authtoken']['auth_uri'] = default['openstack']['murano']['auth_uri']
|
||||
conf['keystone_authtoken']['admin_user'] = default['openstack']['murano']['admin_user']
|
||||
conf['keystone_authtoken']['admin_tenant_name'] = default['openstack']['murano']['admin_tenant_name']
|
||||
conf['keystone_authtoken']['signing_dir'] = default['openstack']['murano']['signing_dir']
|
||||
conf['keystone_authtoken']['identity_uri'] = default['openstack']['murano']['identity_uri']
|
||||
conf['packages_opts']['packages_service'] = default['openstack']['murano']['packages_service']
|
||||
conf['DEFAULT']['notification_driver'] = default['openstack']['murano']['notification_driver']
|
||||
conf['DEFAULT']['rabbit_userid'] = default['openstack']['mq']['compute']['rabbit']['userid']
|
||||
conf['DEFAULT']['debug'] = default['openstack']['murano']['debug']
|
||||
conf['DEFAULT']['verbose'] = default['openstack']['murano']['verbose']
|
||||
conf['DEFAULT']['use_stderr'] = default['openstack']['murano']['use_stderr']
|
||||
conf['DEFAULT']['use_syslog'] = default['openstack']['murano']['use_syslog']
|
||||
conf['DEFAULT']['log_dir'] = default['openstack']['murano']['log_dir']
|
||||
if default['openstack']['murano']['use_syslog']
|
||||
conf['DEFAULT']['syslog_log_facility'] = default['openstack']['murano']['log_facility']
|
||||
end
|
||||
conf['DEFAULT']['default_log_levels'] = default['openstack']['murano']['default_log_levels'].join(',')
|
||||
conf['DEFAULT']['bind_host'] = default['openstack']['murano']['service_host']
|
||||
conf['DEFAULT']['bind_port'] = default['openstack']['murano']['service_port']
|
||||
if default['openstack']['murano']['cfapi_enabled']
|
||||
conf['cfapi']['tenant'] = default['openstack']['murano']['tenant']
|
||||
conf['cfapi']['auth_uri'] = default['openstack']['murano']['auth_url']
|
||||
conf['cfapi']['bind_host'] = default['openstack']['murano']['cfapi_bind_host']
|
||||
conf['cfapi']['bind_port'] = default['openstack']['murano']['cfapi_bind_port']
|
||||
end
|
||||
if default['openstack']['murano']['engine_workers']
|
||||
conf['engine']['workers'] = default['openstack']['murano']['engine_workers']
|
||||
end
|
||||
if default['openstack']['murano']['database_idle_timeout']
|
||||
conf['database']['idle_timeout'] = default['openstack']['murano']['database_idle_timeout']
|
||||
end
|
||||
if default['openstack']['murano']['database_min_pool_size']
|
||||
conf['database']['min_pool_size'] = default['openstack']['murano']['database_min_pool_size']
|
||||
end
|
||||
if default['openstack']['murano']['database_max_retries']
|
||||
conf['database']['max_retries'] = default['openstack']['murano']['database_max_retries']
|
||||
end
|
||||
if default['openstack']['murano']['database_retry_interval']
|
||||
conf['database']['retry_interval'] = default['openstack']['murano']['database_retry_interval']
|
||||
end
|
||||
if default['openstack']['murano']['database_max_pool_size']
|
||||
conf['database']['max_pool_size'] = default['openstack']['murano']['database_max_pool_size']
|
||||
end
|
||||
if default['openstack']['murano']['database_max_overflow']
|
||||
conf['database']['max_overflow'] = default['openstack']['murano']['database_max_overflow']
|
||||
end
|
||||
end
|
||||
|
82
attributes/murano.rb
Normal file
82
attributes/murano.rb
Normal file
@ -0,0 +1,82 @@
|
||||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-application-catalog
|
||||
# Attributes:: murano
|
||||
#
|
||||
# Copyright 2016, Mirantis Inc.
|
||||
# Copyright 2017, x-ion GmbH
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
default['openstack']['murano']['conf'].tap do |conf|
|
||||
if default['openstack']['murano']['use_ssl']
|
||||
%w(cert_file ca_file key_file).each do |ssl_file|
|
||||
conf['ssl'][ssl_file] = default['openstack']['murano'][ssl_file]
|
||||
end
|
||||
conf['DEFAULT']['secure_proxy_ssl_header'] = 'X-Forwarded-Proto'
|
||||
end
|
||||
conf['murano']['url'] = if default['openstack']['murano']['use_ssl']
|
||||
"https://#{default['openstack']['murano']['service_host']}:#{default['openstack']['murano']['service_port']}"
|
||||
else
|
||||
"http://#{default['openstack']['murano']['service_host']}:#{default['openstack']['murano']['service_port']}"
|
||||
end
|
||||
# v3
|
||||
conf['keystone_authtoken']['username'] = default['openstack']['murano']['admin_user']
|
||||
conf['keystone_authtoken']['auth_type'] = 'v3password'
|
||||
conf['keystone_authtoken']['project_name'] = default['openstack']['murano']['admin_tenant_name']
|
||||
conf['keystone_authtoken']['project_domain_name'] = 'Default'
|
||||
conf['keystone_authtoken']['user_domain_name'] = 'Default'
|
||||
# end of v3
|
||||
conf['packages_opts']['packages_service'] = default['openstack']['murano']['packages_service']
|
||||
conf['DEFAULT']['notification_driver'] = default['openstack']['murano']['notification_driver']
|
||||
conf['DEFAULT']['debug'] = default['openstack']['murano']['debug']
|
||||
conf['DEFAULT']['verbose'] = default['openstack']['murano']['verbose']
|
||||
conf['DEFAULT']['use_stderr'] = default['openstack']['murano']['use_stderr']
|
||||
conf['DEFAULT']['use_syslog'] = default['openstack']['murano']['use_syslog']
|
||||
conf['DEFAULT']['log_dir'] = default['openstack']['murano']['log_dir']
|
||||
if default['openstack']['murano']['use_syslog']
|
||||
conf['DEFAULT']['syslog_log_facility'] = default['openstack']['murano']['log_facility']
|
||||
end
|
||||
conf['DEFAULT']['default_log_levels'] = default['openstack']['murano']['default_log_levels'].join(',')
|
||||
conf['DEFAULT']['bind_host'] = default['openstack']['murano']['service_host']
|
||||
conf['DEFAULT']['bind_port'] = default['openstack']['murano']['service_port']
|
||||
if default['openstack']['murano']['cfapi_enabled']
|
||||
conf['cfapi']['tenant'] = default['openstack']['murano']['tenant']
|
||||
conf['cfapi']['auth_uri'] = default['openstack']['murano']['auth_url']
|
||||
conf['cfapi']['bind_host'] = default['openstack']['murano']['cfapi_bind_host']
|
||||
conf['cfapi']['bind_port'] = default['openstack']['murano']['cfapi_bind_port']
|
||||
end
|
||||
if default['openstack']['murano']['engine_workers']
|
||||
conf['engine']['workers'] = default['openstack']['murano']['engine_workers']
|
||||
end
|
||||
if default['openstack']['murano']['database_idle_timeout']
|
||||
conf['database']['idle_timeout'] = default['openstack']['murano']['database_idle_timeout']
|
||||
end
|
||||
if default['openstack']['murano']['database_min_pool_size']
|
||||
conf['database']['min_pool_size'] = default['openstack']['murano']['database_min_pool_size']
|
||||
end
|
||||
if default['openstack']['murano']['database_max_retries']
|
||||
conf['database']['max_retries'] = default['openstack']['murano']['database_max_retries']
|
||||
end
|
||||
if default['openstack']['murano']['database_retry_interval']
|
||||
conf['database']['retry_interval'] = default['openstack']['murano']['database_retry_interval']
|
||||
end
|
||||
if default['openstack']['murano']['database_max_pool_size']
|
||||
conf['database']['max_pool_size'] = default['openstack']['murano']['database_max_pool_size']
|
||||
end
|
||||
if default['openstack']['murano']['database_max_overflow']
|
||||
conf['database']['max_overflow'] = default['openstack']['murano']['database_max_overflow']
|
||||
end
|
||||
conf['networking']['external_network'] = 'public'
|
||||
end
|
@ -6,7 +6,7 @@ source_url 'https://github.com/openstack/cookbook-openstack-application-catalog'
|
||||
license 'Apache 2.0'
|
||||
description 'Installs/Configures openstack-application-catalog'
|
||||
long_description 'Installs/Configures openstack-application-catalog'
|
||||
version '0.1.0'
|
||||
version '0.2.0'
|
||||
|
||||
supports 'ubuntu'
|
||||
|
||||
|
@ -25,7 +25,9 @@ use_inline_resources
|
||||
action :create do
|
||||
@user = new_resource.identity_user
|
||||
@pass = new_resource.identity_pass
|
||||
@tenant = new_resource.identity_tenant
|
||||
@project = new_resource.identity_project
|
||||
@user_domain = new_resource.identity_user_domain
|
||||
@project_domain = new_resource.identity_project_domain
|
||||
@ks_uri = new_resource.identity_uri
|
||||
|
||||
name = new_resource.name
|
||||
@ -47,7 +49,10 @@ end
|
||||
private
|
||||
|
||||
def _add_application(name, package_path, category, is_public)
|
||||
murano_cmd = "murano --insecure --os-username #{@user} --os-password #{@pass} --os-tenant-name #{@tenant} --murano-url #{@api} --os-auth-url #{@ks_uri}"
|
||||
murano_cmd = "murano --insecure --os-username #{@user} --os-password #{@pass}"
|
||||
murano_cmd += " --os-user-domain-name #{@user_domain}"
|
||||
murano_cmd += " --os-project-domain-name #{@project_domain}"
|
||||
murano_cmd += " --os-project-name #{@project} --murano-url #{@api} --os-auth-url #{@ks_uri}"
|
||||
murano_opts = ''
|
||||
murano_opts += '--is-public' if is_public
|
||||
murano_opts += "-C #{category}" if category
|
||||
|
@ -21,36 +21,6 @@ class ::Chef::Recipe
|
||||
include ::Openstack
|
||||
end
|
||||
|
||||
apt_repository 'murano_repo' do
|
||||
uri node['openstack']['murano']['apt_murano_repo']
|
||||
distribution node['openstack']['murano']['apt_murano_distribution']
|
||||
components node['openstack']['murano']['apt_murano_components']
|
||||
key node['openstack']['murano']['apt_murano_key']
|
||||
action :add
|
||||
end
|
||||
|
||||
# temporary until CR-25599 is published
|
||||
apt_repository 'murano_temp_repo' do
|
||||
uri 'http://perestroika-repo-tst.infra.mirantis.net/mos-repos/ubuntu/9.0/'
|
||||
distribution 'mos9.0-proposed'
|
||||
components node['openstack']['murano']['apt_murano_components']
|
||||
key node['openstack']['murano']['apt_murano_key']
|
||||
action :add
|
||||
end
|
||||
|
||||
apt_preference 'pin_murano_repo_other_temp' do
|
||||
glob '*'
|
||||
pin 'origin perestroika-repo-tst.infra.mirantis.net'
|
||||
pin_priority '-1'
|
||||
end
|
||||
|
||||
apt_preference 'pin_murano_repo_temp' do
|
||||
glob 'python-murano-dashboard'
|
||||
pin 'origin perestroika-repo-tst.infra.mirantis.net'
|
||||
pin_priority '1200'
|
||||
end
|
||||
# end of temporary fix
|
||||
|
||||
packages = %w(api_package_name cfapi_package_name common_package_name
|
||||
engine_package_name pythonclient_package_name)
|
||||
|
||||
@ -58,18 +28,6 @@ if node['openstack']['murano']['database_connection'] =~ /^mysql\+pymysql/
|
||||
packages << 'pymysql_package_name'
|
||||
end
|
||||
|
||||
apt_preference 'pin_murano_repo' do
|
||||
glob 'murano-glance-artifacts-plugin python-django-formtools python-django-babel murano-api murano-cfapi murano-common murano-engine python-murano python-muranoclient init-system-helpers'
|
||||
pin 'origin mirror.fuel-infra.org'
|
||||
pin_priority '1200'
|
||||
end
|
||||
|
||||
apt_preference 'pin_murano_repo_other' do
|
||||
glob '*'
|
||||
pin 'origin mirror.fuel-infra.org'
|
||||
pin_priority '-1'
|
||||
end
|
||||
|
||||
packages.each do |pkg|
|
||||
package node['openstack']['murano'][pkg] do
|
||||
action :install
|
||||
@ -80,37 +38,26 @@ end
|
||||
|
||||
db_password = get_password 'db', 'murano'
|
||||
db_user = node['openstack']['murano']['db_user']
|
||||
db_name = node['openstack']['murano']['db_name']
|
||||
db_connection = db_uri('application-catalog', db_user, db_password)
|
||||
|
||||
user = node['openstack']['mq']['network']['rabbit']['userid']
|
||||
node.default['openstack']['murano']['conf_secrets']
|
||||
.[]('DEFAULT')['rabbit_password'] =
|
||||
get_password 'user', user
|
||||
.[]('DEFAULT')['transport_url'] = rabbit_transport_url 'application-catalog'
|
||||
node.default['openstack']['murano']['conf_secrets']
|
||||
.[]('rabbitmq')['password'] =
|
||||
get_password 'user', user
|
||||
node.default['openstack']['murano']['conf_secrets']
|
||||
.[]('keystone_authtoken')['admin_password'] =
|
||||
get_password 'user', 'admin'
|
||||
.[]('keystone_authtoken')['password'] =
|
||||
get_password 'service', 'openstack-application-catalog'
|
||||
|
||||
node.default['openstack']['murano']['conf']
|
||||
.[]('database')['connection'] = db_connection
|
||||
|
||||
ie = public_endpoint 'identity'
|
||||
ae = admin_endpoint 'identity'
|
||||
ine = internal_endpoint 'identity'
|
||||
auth_uri = ::URI.decode ae.to_s
|
||||
auth_url = ::URI.decode ine.to_s
|
||||
node.default['openstack']['murano']['conf']['keystone_authtoken']['auth_url'] = auth_url
|
||||
|
||||
murano_conf_options = merge_config_options 'murano'
|
||||
|
||||
directory '/etc/murano' do
|
||||
mode 00755
|
||||
action :create
|
||||
end
|
||||
|
||||
directory '/var/log/murano' do
|
||||
mode 00755
|
||||
owner 'murano'
|
||||
group 'murano'
|
||||
action :create
|
||||
end
|
||||
|
||||
template '/etc/murano/murano.conf' do
|
||||
source 'openstack-service.conf.erb'
|
||||
cookbook 'openstack-common'
|
||||
@ -122,14 +69,6 @@ template '/etc/murano/murano.conf' do
|
||||
)
|
||||
end
|
||||
|
||||
file '/etc/murano/murano-paste.ini' do
|
||||
mode 00644
|
||||
end
|
||||
|
||||
file '/etc/murano/policy.json' do
|
||||
mode 00644
|
||||
end
|
||||
|
||||
service 'murano-api' do
|
||||
supports restart: true, reload: true
|
||||
action :enable
|
||||
@ -145,130 +84,18 @@ service 'murano-engine' do
|
||||
action :enable
|
||||
end
|
||||
|
||||
bind_db = node['openstack']['bind_service']['db']
|
||||
if bind_db['interface']
|
||||
listen_address = address_for bind_db['interface']
|
||||
else
|
||||
listen_address = bind_db['host']
|
||||
end
|
||||
|
||||
super_password = get_password 'db', node['openstack']['db']['root_user_key']
|
||||
|
||||
if node['openstack']['db']['service_type'] == 'mysql'
|
||||
|
||||
# Create a sql server database
|
||||
mysql_database db_name do
|
||||
connection(
|
||||
host: listen_address,
|
||||
port: bind_db.port.to_s,
|
||||
username: 'root',
|
||||
password: super_password,
|
||||
options: { 'CHARSET' => 'utf8', 'COLLATE' => 'utf8_general_ci' }
|
||||
)
|
||||
action :create
|
||||
end
|
||||
|
||||
# Create user
|
||||
mysql_database_user db_user do
|
||||
connection(
|
||||
host: listen_address,
|
||||
username: 'root',
|
||||
password: super_password
|
||||
)
|
||||
password db_password
|
||||
database_name db_name
|
||||
privileges [:all]
|
||||
action :grant
|
||||
host '%'
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if node['openstack']['db']['service_type'] == 'postgresql'
|
||||
# postgresql database backend has not been tested.
|
||||
# patches are welcome
|
||||
|
||||
postgresql_connection_info = {
|
||||
host: listen_address,
|
||||
port: node['postgresql']['config']['port'],
|
||||
username: 'postgres',
|
||||
password: node['postgresql']['password']['postgres']
|
||||
}
|
||||
|
||||
# Create user
|
||||
postgresql_database_user db_user do
|
||||
connection postgresql_connection_info
|
||||
password super_password
|
||||
action :create
|
||||
end
|
||||
|
||||
# Create a postgress server database
|
||||
postgresql_database db_name do
|
||||
connection(
|
||||
host: listen_addres,
|
||||
port: bind_db.port.to_s,
|
||||
username: 'root',
|
||||
password: super_password
|
||||
)
|
||||
action :create
|
||||
end
|
||||
|
||||
postgresql_database_user db_user do
|
||||
connection postgresql_connection_info
|
||||
database_name db_name
|
||||
privileges [:all]
|
||||
action :grant
|
||||
end
|
||||
end
|
||||
|
||||
include_recipe 'openstack-application-catalog::dashboard'
|
||||
|
||||
execute 'murano-dbmanage' do
|
||||
command node['openstack']['murano']['dbmanage_command']
|
||||
execute 'murano-dbmanage upgrade' do
|
||||
command 'murano-db-manage --config-file /etc/murano/murano.conf upgrade'
|
||||
user 'murano'
|
||||
notifies :restart, 'service[murano-api]', :immediately
|
||||
notifies :restart, 'service[murano-cfapi]', :immediately
|
||||
notifies :restart, 'service[murano-engine]', :immediately
|
||||
end
|
||||
|
||||
rabbitmq_user 'remove rabbit guest user' do
|
||||
user 'guest'
|
||||
action :delete
|
||||
not_if { user == 'guest' }
|
||||
end
|
||||
|
||||
rabbitmq_user 'add murano rabbit user' do
|
||||
user node['openstack']['mq']['compute']['rabbit']['userid']
|
||||
password node['openstack']['murano']['conf_secrets']['rabbitmq']['password']
|
||||
action :add
|
||||
end
|
||||
|
||||
rabbitmq_user 'change murano rabbit user password' do
|
||||
user node['openstack']['mq']['compute']['rabbit']['userid']
|
||||
password node['openstack']['murano']['conf_secrets']['rabbitmq']['password']
|
||||
action :change_password
|
||||
end
|
||||
|
||||
rabbitmq_vhost 'add murano rabbit vhost' do
|
||||
vhost node['openstack']['murano']['rabbit_own_vhost']
|
||||
action :add
|
||||
end
|
||||
|
||||
rabbitmq_user 'set murano user permissions' do
|
||||
user node['openstack']['mq']['compute']['rabbit']['userid']
|
||||
vhost node['openstack']['murano']['rabbit_own_vhost']
|
||||
permissions '.* .* .*'
|
||||
action :set_permissions
|
||||
end
|
||||
|
||||
ie = public_endpoint 'identity'
|
||||
ae = admin_endpoint 'identity'
|
||||
ine = internal_endpoint 'identity'
|
||||
auth_uri = ::URI.decode ae.to_s
|
||||
|
||||
murano_port = node['openstack']['murano']['service_port']
|
||||
|
||||
public_murano_api_endpoint = "#{ie.scheme}://#{ie.host}:#{murano_port}/"
|
||||
# TODO(jrosenboom): Use murano specific endpoint definitions directly
|
||||
public_murano_api_endpoint = public_endpoint 'application-catalog'
|
||||
admin_murano_api_endpoint = "#{ae.scheme}://#{ae.host}:#{murano_port}/"
|
||||
internal_murano_api_endpoint = "#{ine.scheme}://#{ine.host}:#{murano_port}/"
|
||||
|
||||
@ -292,10 +119,10 @@ connection_params = {
|
||||
openstack_username: admin_user,
|
||||
openstack_api_key: admin_pass,
|
||||
openstack_project_name: admin_project,
|
||||
openstack_domain_name: admin_domain
|
||||
openstack_domain_name: admin_domain
|
||||
}
|
||||
|
||||
# Register Service Tenant
|
||||
# Register Service Project
|
||||
openstack_project service_project_name do
|
||||
connection_params connection_params
|
||||
end
|
||||
@ -340,7 +167,7 @@ openstack_user service_user do
|
||||
connection_params connection_params
|
||||
end
|
||||
|
||||
## Grant Service role to Service User for Service Tenant ##
|
||||
## Grant Service role to Service User in Service Project
|
||||
openstack_user service_user do
|
||||
role_name service_role
|
||||
project_name service_project_name
|
||||
@ -394,10 +221,18 @@ if node['openstack']['murano']['cfapi_enabled']
|
||||
end
|
||||
end
|
||||
|
||||
# Symlink base package
|
||||
link '/var/cache/murano/meta/io.murano.zip' do
|
||||
to '/usr/share/murano-common/io.murano.zip'
|
||||
end
|
||||
|
||||
# TODO(frickler): Crosscheck domain name usage
|
||||
openstack_application_catalog_application 'io.murano' do
|
||||
identity_user node['openstack']['murano']['admin_user']
|
||||
identity_pass service_pass
|
||||
identity_tenant service_project_name
|
||||
identity_user_domain service_domain_name
|
||||
identity_project service_project_name
|
||||
identity_project_domain service_domain_name
|
||||
identity_uri auth_uri
|
||||
is_public true
|
||||
action :create
|
||||
|
@ -30,7 +30,9 @@ end
|
||||
attribute :name, kind_of: String
|
||||
attribute :category, kind_of: String
|
||||
attribute :identity_user, kind_of: String
|
||||
attribute :identity_user_domain, kind_of: String
|
||||
attribute :identity_pass, kind_of: String
|
||||
attribute :identity_tenant, kind_of: String
|
||||
attribute :identity_project, kind_of: String
|
||||
attribute :identity_project_domain, kind_of: String
|
||||
attribute :identity_uri, kind_of: String
|
||||
attribute :is_public, kind_of: [TrueClass, FalseClass], default: false
|
||||
|
@ -10,14 +10,6 @@ describe 'openstack-application-catalog::server' do
|
||||
|
||||
include_context 'application-catalog-stubs'
|
||||
|
||||
it 'configures murano repository' do
|
||||
expect(chef_run).to add_apt_repository('murano_repo').with(
|
||||
key: 'http://mirror.fuel-infra.org/mos-repos/ubuntu/9.0/archive-mos9.0.key',
|
||||
uri: 'http://mirror.fuel-infra.org/mos-repos/ubuntu/9.0/',
|
||||
distribution: 'mos9.0',
|
||||
components: ['main'])
|
||||
end
|
||||
|
||||
it 'installs the murano-api package' do
|
||||
expect(chef_run).to install_package 'murano-api'
|
||||
end
|
||||
@ -38,14 +30,6 @@ describe 'openstack-application-catalog::server' do
|
||||
expect(chef_run).to install_package 'python-muranoclient'
|
||||
end
|
||||
|
||||
it 'installs the murano-glance-artifacts-plugin package' do
|
||||
expect(chef_run).to install_package 'murano-glance-artifacts-plugin'
|
||||
end
|
||||
|
||||
it 'installs the python-murano-dashboard package' do
|
||||
expect(chef_run).to install_package 'python-murano-dashboard'
|
||||
end
|
||||
|
||||
it 'enables the murano-api service' do
|
||||
expect(chef_run).to enable_service('murano-api')
|
||||
end
|
||||
|
@ -1,21 +0,0 @@
|
||||
# encoding: UTF-8
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-application-catalog::server' do
|
||||
describe 'ubuntu' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
let(:chef_run) { runner.converge(described_recipe) }
|
||||
|
||||
include_context 'application-catalog-stubs'
|
||||
|
||||
it 'create mysql database' do
|
||||
expect(chef_run).to create_mysql_database('murano')
|
||||
end
|
||||
|
||||
it 'create mysql user' do
|
||||
expect(chef_run).to grant_mysql_database_user('murano')
|
||||
end
|
||||
end
|
||||
end
|
@ -1,50 +0,0 @@
|
||||
# encoding: UTF-8
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-application-catalog::server' do
|
||||
describe 'ubuntu' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
let(:chef_run) { runner.converge(described_recipe) }
|
||||
|
||||
include_context 'application-catalog-stubs'
|
||||
|
||||
context 'custom mq attributes' do
|
||||
before do
|
||||
node.set['openstack']['mq']['compute']['rabbit']['userid'] = 'not-a-guest'
|
||||
node.set['openstack']['murano']['rabbit_own_vhost'] = '/foo'
|
||||
end
|
||||
|
||||
it 'does not delete guest user' do
|
||||
expect(chef_run).not_to delete_rabbitmq_user(
|
||||
'remove rabbit guest user'
|
||||
).with(user: 'guest')
|
||||
end
|
||||
|
||||
it 'adds murano rabbit user' do
|
||||
expect(chef_run).to add_rabbitmq_user(
|
||||
'add murano rabbit user'
|
||||
).with(user: 'not-a-guest', password: 'mq-pass')
|
||||
end
|
||||
|
||||
it 'changes murano rabbit user password' do
|
||||
expect(chef_run).to change_password_rabbitmq_user(
|
||||
'change murano rabbit user password'
|
||||
).with(user: 'not-a-guest', password: 'mq-pass')
|
||||
end
|
||||
|
||||
it 'adds murano rabbit vhost' do
|
||||
expect(chef_run).to add_rabbitmq_vhost(
|
||||
'add murano rabbit vhost'
|
||||
).with(vhost: '/foo')
|
||||
end
|
||||
|
||||
it 'sets murano user permissions' do
|
||||
expect(chef_run).to set_permissions_rabbitmq_user(
|
||||
'set murano user permissions'
|
||||
).with(user: 'not-a-guest', vhost: '/foo', permissions: '.* .* .*')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user