aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/provider/package/norpm.rb2
-rw-r--r--manifests/profile/base/database/mysql/client.pp72
-rw-r--r--manifests/ui.pp6
-rw-r--r--releasenotes/notes/enable-languages-in-ui-88a8caa6db9b4dd7.yaml5
-rw-r--r--templates/ui/tripleo_ui_config.js.erb4
5 files changed, 87 insertions, 2 deletions
diff --git a/lib/puppet/provider/package/norpm.rb b/lib/puppet/provider/package/norpm.rb
index 0764265..080b138 100644
--- a/lib/puppet/provider/package/norpm.rb
+++ b/lib/puppet/provider/package/norpm.rb
@@ -17,6 +17,8 @@ require 'puppet/provider/package'
Puppet::Type.type(:package).provide :norpm, :source => :rpm, :parent => :rpm do
desc "RPM packaging provider that does not install anything."
+ has_feature :virtual_packages
+
def latest
@resource.fail "'latest' is unsupported by this provider."
end
diff --git a/manifests/profile/base/database/mysql/client.pp b/manifests/profile/base/database/mysql/client.pp
new file mode 100644
index 0000000..f23b97d
--- /dev/null
+++ b/manifests/profile/base/database/mysql/client.pp
@@ -0,0 +1,72 @@
+# Copyright 2016 Red Hat, Inc.
+#
+# 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.
+#
+# == Class: tripleo::profile::base::haproxy
+#
+# Loadbalancer profile for tripleo
+#
+# === Parameters
+#
+# [*mysql_read_default_file*]
+# (Optional) Name of the file that will be passed to pymysql connection strings
+# Defaults to hiera('tripleo::profile::base:database::mysql::read_default_file', '/etc/my.cnf.d/tripleo.cnf')
+#
+# [*mysql_read_default_group*]
+# (Optional) Name of the ini section to be passed to pymysql connection strings
+# Defaults to hiera('tripleo::profile::base:database::mysql::read_default_group', 'tripleo')
+#
+# [*mysql_client_bind_address*]
+# (Optional) Client IP address of the host that will be written in the mysql_read_default_file
+# Defaults to hiera('tripleo::profile::base:database::mysql::client_bind_address', undef)
+#
+# [*step*]
+# (Optional) The current step in deployment. See tripleo-heat-templates
+# for more details.
+# Defaults to hiera('step')
+#
+class tripleo::profile::base::database::mysql::client (
+ $mysql_read_default_file = hiera('tripleo::profile::base:database::mysql::read_default_file', '/etc/my.cnf.d/tripleo.cnf'),
+ $mysql_read_default_group = hiera('tripleo::profile::base:database::mysql::read_default_group', 'tripleo'),
+ $mysql_client_bind_address = hiera('tripleo::profile::base:database::mysql::client_bind_address', undef),
+ $step = hiera('step'),
+) {
+ if $step >= 1 {
+ # If the folder /etc/my.cnf.d does not exist (e.g. if mariadb is not
+ # present in the base image but installed as a package afterwards),
+ # create it. We do not want to touch the permissions in case it already
+ # exists due to the mariadb server package being pre-installed
+ # Note: We use exec instead of file in the case that the mysql class is
+ # included on this node as well (we'd get duplicate declaration in such a
+ # situation when using file)
+ if $mysql_client_bind_address {
+ $changes = [
+ "set ${mysql_read_default_group}/bind-address '${mysql_client_bind_address}'"
+ ]
+ } else {
+ $changes = [
+ "rm ${mysql_read_default_group}/bind-address"
+ ]
+ }
+ exec { 'directory-create-etc-my.cnf.d':
+ command => 'mkdir -p /etc/my.cnf.d',
+ path => ['/usr/bin', '/usr/sbin', '/bin', '/sbin'],
+ } ->
+ # Create /etc/my.cnf.d/tripleo.cnf with the [tripleo]bind-address=<IP of the node in the mysql network>
+ augeas { 'mysql-bind-address':
+ incl => $mysql_read_default_file,
+ lens => 'Puppet.lns',
+ changes => $changes,
+ }
+ }
+}
diff --git a/manifests/ui.pp b/manifests/ui.pp
index 7b87397..d51ef2e 100644
--- a/manifests/ui.pp
+++ b/manifests/ui.pp
@@ -31,6 +31,11 @@
# The port on which the UI is listening.
# Defaults to 3000
#
+# [*enabled_languages*]
+# Which languages to show in the UI.
+# An array.
+# Defaults to ['en-GB', 'en', 'de', 'ja', 'ko-KR', 'zh-CN', 'es']
+#
# [*endpoint_proxy_keystone*]
# The keystone proxy endpoint url
# Defaults to undef
@@ -89,6 +94,7 @@ class tripleo::ui (
$bind_host = hiera('controller_host'),
$ui_port = 3000,
$zaqar_default_queue = 'tripleo',
+ $enabled_languages = ['en-GB', 'en', 'de', 'ja', 'ko-KR', 'zh-CN', 'es'],
$endpoint_proxy_zaqar = undef,
$endpoint_proxy_keystone = undef,
$endpoint_proxy_heat = undef,
diff --git a/releasenotes/notes/enable-languages-in-ui-88a8caa6db9b4dd7.yaml b/releasenotes/notes/enable-languages-in-ui-88a8caa6db9b4dd7.yaml
new file mode 100644
index 0000000..2f7939d
--- /dev/null
+++ b/releasenotes/notes/enable-languages-in-ui-88a8caa6db9b4dd7.yaml
@@ -0,0 +1,5 @@
+---
+features:
+ - The undercloud UI is available in multiple languages, which can now
+ be configured via the manifest. All available languages are enabled
+ by default.
diff --git a/templates/ui/tripleo_ui_config.js.erb b/templates/ui/tripleo_ui_config.js.erb
index d49fe8e..c984cc3 100644
--- a/templates/ui/tripleo_ui_config.js.erb
+++ b/templates/ui/tripleo_ui_config.js.erb
@@ -12,13 +12,13 @@ window.tripleOUiConfig = {
'zaqar-websocket': '<%= @endpoint_config_zaqar %>',
// Default websocket queue name
- 'zaqar_default_queue': '<%= @zaqar_default_queue %>'
+ 'zaqar_default_queue': '<%= @zaqar_default_queue %>',
// Languages
// If you choose more than one language, a language switcher will appear in
// the navigation bar.
// Only 'en' (English) is enabled by default.
- // 'languages': ['en-GB', 'en', 'ja', 'ko-KR', 'zh-CN', 'es'],
+ 'languages': ['<%= @enabled_languages.join("', '") %>'],
// Logging
// 'loggers': ['console']