Fix Sahara puppet manifests for Fuel 6.0 (Juno)

* change name for sahara service;
* migrate from custom auth_token middleware config options to
the common config options;
* remove sahara-dashboard installing, because now sahara-dashboard
is integrated into Horizon Openstack Dashboard;
* add icehouse backward compatibility for dashboard
and keystone settings

Closes-bug: #1364934
Change-Id: I29d931c1ee0f9a22bcdddc38b59680285ab68f36
blueprint fuel-deploy-juno
This commit is contained in:
Denis Egorenko 2014-09-09 16:08:13 +04:00 committed by Matthew Mosesohn
parent df3377534a
commit 9633daed11
6 changed files with 83 additions and 58 deletions

View File

@ -528,9 +528,9 @@ class osnailyfacter::cluster_ha {
sahara_keystone_user => 'sahara',
sahara_keystone_password => $sahara_hash['user_password'],
sahara_keystone_tenant => 'services',
sahara_auth_uri => "http://${::fuel_settings['management_vip']}:5000/v2.0/",
sahara_identity_uri => "http://${::fuel_settings['management_vip']}:35357/",
use_neutron => $::use_quantum,
use_floating_ips => $::fuel_settings['auto_assign_floating_ip'],
syslog_log_facility_sahara => $syslog_log_facility_sahara,
debug => $::debug,

View File

@ -312,9 +312,9 @@ class osnailyfacter::cluster_simple {
sahara_keystone_user => 'sahara',
sahara_keystone_password => $sahara_hash['user_password'],
sahara_keystone_tenant => 'services',
sahara_auth_uri => "http://${controller_node_address}:5000/v2.0/",
sahara_identity_uri => "http://${controller_node_address}:35357/",
use_neutron => $::use_quantum,
use_floating_ips => $::fuel_settings['auto_assign_floating_ip'],
syslog_log_facility_sahara => $syslog_log_facility_sahara,
debug => $debug,

View File

@ -2,18 +2,15 @@
class sahara::api (
$enabled = true,
$keystone_host = '127.0.0.1',
$keystone_port = '35357',
$keystone_protocol = 'http',
$sahara_auth_uri = 'http://127.0.0.1:5000/v2.0/',
$sahara_identity_uri = 'http://127.0.0.1:35357/',
$keystone_user = 'sahara',
$keystone_tenant = 'services',
$keystone_password = 'sahara',
$bind_port = '8386',
$node_domain = 'novalocal',
$plugins = 'vanilla,hdp',
$sql_connection = 'mysql://sahara:sahara@localhost/sahara',
$use_neutron = false,
$use_floating_ips = true,
$debug = false,
$verbose = false,
$use_syslog = false,
@ -41,12 +38,6 @@ class sahara::api (
$use_neutron_value = false
}
if $use_floating_ips {
$use_floating_ips_value = true
} else {
$use_floating_ips_value = false
}
exec { 'sahara-db-manage':
command => "/usr/bin/sahara-db-manage --config-file /etc/sahara/sahara.conf upgrade head"
}
@ -60,21 +51,45 @@ class sahara::api (
}
sahara_config {
'DEFAULT/os_admin_tenant_name' : value => $keystone_tenant;
'DEFAULT/os_admin_username' : value => $keystone_user;
'DEFAULT/os_admin_password' : value => $keystone_password;
'DEFAULT/os_auth_host' : value => $keystone_host;
'DEFAULT/os_auth_port' : value => $keystone_port;
'DEFAULT/use_floating_ips' : value => $use_floating_ips_value;
'DEFAULT/use_neutron' : value => $use_neutron_value;
'DEFAULT/node_domain' : value => $node_domain;
'DEFAULT/plugins' : value => $plugins;
'database/connection' : value => $sql_connection;
'database/max_retries' : value => '-1';
'DEFAULT/verbose' : value => $verbose;
'DEFAULT/debug' : value => $debug;
}
#NOTE(mattymo): Backward compatibility for Icehouse
case $::fuel_settings['openstack_version'] {
/2014.1.*-6/: {
$use_floating_ips = $::fuel_settings['auto_assign_floating_ip']
$plugins = "vanilla,hdp"
#parse keystone_host for backward compatibility
$keystone_host = inline_template("<%= @sahara_auth_uri.split('://')[1].split('/')[0].split(':')[0] %>")
$keystone_port = inline_template("<%= @sahara_auth_uri.split(':')[2].split('/')[0] %>")
sahara_config {
'DEFAULT/os_admin_tenant_name' : value => $keystone_tenant;
'DEFAULT/os_admin_username' : value => $keystone_user;
'DEFAULT/os_admin_password' : value => $keystone_password;
'DEFAULT/os_auth_host' : value => $keystone_host;
'DEFAULT/os_auth_port' : value => $keystone_port;
'DEFAULT/use_floating_ips' : value => $use_floating_ips;
'DEFAULT/plugins' : value => $plugins;
}
}
/2014.2.*-6/: {
sahara_config {
'keystone_authtoken/admin_tenant_name' : value => $keystone_tenant;
'keystone_authtoken/admin_user' : value => $keystone_user;
'keystone_authtoken/admin_password' : value => $keystone_password;
'keystone_authtoken/auth_uri' : value => $sahara_auth_uri;
'keystone_authtoken/identity_uri' : value => $sahara_identity_uri;
}
}
default: {
fail("Unsupported OpenStack version: ${::fuel_settings['openstack_version']}")
}
}
# Log configuration
if $log_dir {
sahara_config {

View File

@ -1,5 +1,6 @@
# Installs & configure the sahara API service
# NOTE(mattmyo): This manifest is deprecated. It is available for Icehouse
# compatibility.
class sahara::dashboard (
$enabled = true,
$settings_py = $sahara::params::settings_path,
@ -44,13 +45,13 @@ class sahara::dashboard (
file_line{ 'sahara' :
path => $settings_py,
line => "HORIZON_CONFIG['dashboards']+=('sahara',)", # don't use .append(), target may be a tuple
line => "HORIZON_CONFIG['dashboards']+=('sahara',)", # don't use.append(), target may be a tuple
require => File[$settings_py],
}
file_line{ 'sahara_dashboard' :
path => $settings_py,
line => "INSTALLED_APPS+=('saharadashboard',)", # don't use .append(), target may be a tuple
line => "INSTALLED_APPS+=('saharadashboard',)", # don't use .append(),target may be a tuple
require => File[$settings_py],
}

View File

@ -2,17 +2,14 @@ class sahara (
$sahara_enabled = true,
$sahara_api_port = '8386',
$sahara_api_host = '127.0.0.1',
$sahara_api_version = 'v1.1',
$sahara_auth_uri = 'http://127.0.0.1:5000/v2.0/',
$sahara_identity_uri = 'http://127.0.0.1:35357/',
$sahara_keystone_host = '127.0.0.1',
$sahara_keystone_port = '35357',
$sahara_keystone_protocol = 'http',
$sahara_keystone_user = 'sahara',
$sahara_keystone_tenant = 'services',
$sahara_keystone_password = 'sahara',
$sahara_node_domain = 'novalocal',
$sahara_plugins = 'vanilla,hdp',
$sahara_db_password = 'sahara',
$sahara_db_name = 'sahara',
@ -20,9 +17,8 @@ class sahara (
$sahara_db_host = 'localhost',
$sahara_db_allowed_hosts = ['localhost','%'],
$sahara_firewall_rule = '201 sahara-api',
$sahara_firewall_rule = '201 sahara-all',
$use_neutron = false,
$use_floating_ips = false,
$use_syslog = false,
$debug = false,
@ -42,15 +38,13 @@ class sahara (
class { 'sahara::api':
enabled => $sahara_enabled,
keystone_host => $sahara_keystone_host,
keystone_port => $sahara_keystone_port,
keystone_protocol => $sahara_keystone_protocol,
sahara_auth_uri => $sahara_auth_uri,
sahara_identity_uri => $sahara_identity_uri,
keystone_user => $sahara_keystone_user,
keystone_tenant => $sahara_keystone_tenant,
keystone_password => $sahara_keystone_password,
bind_port => $sahara_api_port,
node_domain => $sahara_node_domain,
plugins => $sahara_plugins,
sql_connection => $sahara_sql_connection,
use_neutron => $use_neutron,
debug => $debug,
@ -78,12 +72,18 @@ class sahara (
require => Class['openstack::firewall']
}
class { 'sahara::dashboard' :
enabled => $sahara_enabled,
use_neutron => $use_neutron,
use_floating_ips => $use_floating_ips,
#NOTE(mattymo): Backward compatibility for Icehouse
case $::fuel_settings['openstack_version'] {
/2014.1.*-6/: {
class {'sahara::dashboard':
enabled => $sahara_enabled,
use_neutron => $use_neutron,
use_floating_ips => $::fuel_settings['auto_assign_floating_ip'],
}
Class['sahara::api'] -> Class['sahara::dashboard']
}
default: { }
}
Class['mysql::server'] -> Class['sahara::db::mysql'] -> Firewall[$sahara_firewall_rule] -> Class['sahara::keystone::auth'] -> Class['sahara::api'] -> Class['sahara::dashboard']
Class['mysql::server'] -> Class['sahara::db::mysql'] -> Firewall[$sahara_firewall_rule] -> Class['sahara::keystone::auth'] -> Class['sahara::api']
}

View File

@ -1,24 +1,33 @@
class sahara::params {
# package names
$sahara_package_name = 'sahara'
# dashboard package
$sahara_dashboard_package_name = 'sahara-dashboard'
# service names
$sahara_service_name = 'sahara-api'
$settings_path = '/usr/share/openstack-dashboard/openstack_dashboard/settings.py'
$default_url_string = "SAHARA_URL = 'http://localhost:8386/v1.0'"
case $::osfamily {
'RedHat': {
$local_settings_path = '/etc/openstack-dashboard/local_settings'
#NOTE(mattymo): Backward compatibility for Icehouse
case $::fuel_settings['openstack_version'] {
/2014.2-6./: {
$sahara_service_name = 'sahara-all'
}
'Debian': {
$local_settings_path = '/etc/openstack-dashboard/local_settings.py'
/2014.1.*/: {
$sahara_service_name = 'sahara-api'
$sahara_dashboard_package_name = 'sahara-dashboard'
$settings_path = '/usr/share/openstack-dashboard/openstack_dashboard/settings.py'
$default_url_string = "SAHARA_URL = 'http://localhost:8386/v1.0'"
case $::osfamily {
'RedHat': {
$local_settings_path = '/etc/openstack-dashboard/local_settings'
}
'Debian': {
$local_settings_path = '/etc/openstack-dashboard/local_settings.py'
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} only support osfamily RedHat and
Debian")
}
}
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} only support osfamily RedHat and Debian")
}
fail("Unsupported OpenStack version: ${::fuel_settings['openstack_version']}")
}
}
}