From f562a53487dcc7a0d011a3a261055dfbd2c14851 Mon Sep 17 00:00:00 2001 From: Volodymyr Stoiko Date: Tue, 2 Aug 2016 13:06:33 +0300 Subject: [PATCH] Add hiera yaml override file --- .gitignore | 4 ++ .../puppet/manifests/rally_hiera_override.pp | 43 +++++++++++++++++++ deployment_tasks.yaml | 18 ++++++++ 3 files changed, 65 insertions(+) create mode 100644 .gitignore create mode 100644 deployment_scripts/puppet/manifests/rally_hiera_override.pp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..692c203 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.tox +.build +*.pyc +*.rpm diff --git a/deployment_scripts/puppet/manifests/rally_hiera_override.pp b/deployment_scripts/puppet/manifests/rally_hiera_override.pp new file mode 100644 index 0000000..eff3e8f --- /dev/null +++ b/deployment_scripts/puppet/manifests/rally_hiera_override.pp @@ -0,0 +1,43 @@ +# Copyright 2016 Mirantis, 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. + +notice('fuel-plugin-rally: rally_hiera_override.pp') + +# maybe fo future use +$network_scheme = hiera_hash('network_scheme') +$network_metadata = hiera_hash('network_metadata') +prepare_network_config($network_scheme) + +$rally = hiera_hash('fuel-plugin-rally', undef) +$management_ip = get_network_role_property('management', 'ipaddr') + +$hiera_dir = '/etc/hiera/override' +$plugin_name = 'rally' +$plugin_yaml = "${plugin_name}.yaml" + + +$calculated_content = inline_template(' +--- +rally::rally_configuration: <%= @rally["rally_configuration"] %> +rally::listen_address: <%= @management_ip %> +') + +################### +file {'/etc/hiera/override': + ensure => directory, +} -> +file { "${hiera_dir}/${plugin_yaml}": + ensure => file, + content => "${calculated_content}\n", +} diff --git a/deployment_tasks.yaml b/deployment_tasks.yaml index 7b44a11..ef26a60 100644 --- a/deployment_tasks.yaml +++ b/deployment_tasks.yaml @@ -14,6 +14,7 @@ - logging - netconfig - hosts + - rally-hiera - puppet-demo requires: [deploy_start] required_for: [deploy_end] @@ -22,6 +23,23 @@ type: one_by_one +# Tasks definitions for the deployment +###################################### + +# This task needs to be reexecuted to adapt the configuration parameters which +# depend on the number of nodes in the cluster +- id: rally-hiera + type: puppet + version: 2.0.0 + requires: [netconfig] + required_for: [deploy_end] + parameters: + puppet_manifest: "puppet/manifests/rally_hiera_override.pp" + puppet_modules: puppet/modules:/etc/puppet/modules + timeout: 120 + reexecute_on: + - deploy_changes + - id: puppet-demo type: puppet version: 2.0.0