Sergey Kraynev 27220928e3 Remove unused namespaces
Change-Id: Ica3174730276c6918aceef85aac1f968bf77ed04
2016-06-15 14:53:51 +00:00

63 lines
1.7 KiB
YAML

# 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.
Namespaces:
=: org.openstack.ci_cd_pipeline_murano_app.puppet
Name: Hiera
Properties:
dataFilePath:
Contract: $.string()
Default: '/etc/puppet/hieradata/murano.yaml'
Usage: Const
configFilePath:
Contract: $.string()
Default: '/etc/puppet/hiera.yaml'
Usage: Const
configFile:
Contract: $.class(YamlFile)
dataFile:
Contract: $.class(YamlFile)
Methods:
.init:
Body:
- $this.configFile: new(YamlFile, path => $this.configFilePath)
- $this.dataFile: new(YamlFile, path => $this.dataFilePath)
# add new data file to hiera
# this file is the only file to store all of data the passed throw Hiera class
- $config: !yaql "dict( ':hierarchy' => 'murano')"
- $this.configFile.putData($config)
putData:
Arguments:
- data:
Contract: {}
Body:
- $this.dataFile.putData($data)
syncronize:
Arguments:
instance:
Contract: $.class(PuppetInstance).notNull()
Body:
- $tool: new(YamlTool)
- $tool.update(
$instance,
$this.configFile.path,
$this.configFile.data)
- $tool.update(
$instance,
$this.dataFile.path,
$this.dataFile.data)