Introducing ConfLangInstance
The yaml file allows for installing murano-agent and chef and puppet by cloud-init Change-Id: Ia16270d67eeff50d41d8f879e7b4ad0a1037d4b1 Targets-blueprint: conf-lang-instance
This commit is contained in:
parent
7a587b63da
commit
7a0a172880
meta/io.murano
murano/tests/functional/engine
57
meta/io.murano/Classes/resources/ConfLangInstance.yaml
Normal file
57
meta/io.murano/Classes/resources/ConfLangInstance.yaml
Normal file
@ -0,0 +1,57 @@
|
||||
Namespaces:
|
||||
=: io.murano.resources
|
||||
sys: io.murano.system
|
||||
std: io.murano
|
||||
|
||||
Name: ConfLangInstance
|
||||
|
||||
Extends:
|
||||
- LinuxMuranoInstance
|
||||
|
||||
Methods:
|
||||
prepareUserData:
|
||||
Body:
|
||||
- $userData: $.generateUserData()
|
||||
- Return:
|
||||
data: $._generateInstanceConfigResources($userData)
|
||||
format: RAW
|
||||
|
||||
_generateInstanceConfigResources:
|
||||
Arguments:
|
||||
- userData:
|
||||
Contract: $.string().notNull()
|
||||
Body:
|
||||
- $environment: $.find(std:Environment).require()
|
||||
- $cloudInitConf: $.generateCloudConfig()
|
||||
- $bootConfigResourceName: format('boot_config_{0}', $.name)
|
||||
- $bootScriptResourceName: format('boot_script_{0}', $.name)
|
||||
- $userDataResourceName: format('user_data-{0}', $.name)
|
||||
- $template:
|
||||
resources:
|
||||
$bootConfigResourceName:
|
||||
type: 'OS::Heat::CloudConfig'
|
||||
properties:
|
||||
cloud_config: $cloudInitConf
|
||||
$bootScriptResourceName:
|
||||
type: 'OS::Heat::SoftwareConfig'
|
||||
properties:
|
||||
group: ungrouped
|
||||
config: $userData
|
||||
$userDataResourceName:
|
||||
type: 'OS::Heat::MultipartMime'
|
||||
properties:
|
||||
parts:
|
||||
- config: {get_resource: $bootConfigResourceName}
|
||||
- config: {get_resource: $bootScriptResourceName}
|
||||
|
||||
- $environment.stack.updateTemplate($template)
|
||||
- Return: {get_resource: $userDataResourceName}
|
||||
|
||||
|
||||
generateCloudConfig:
|
||||
Body:
|
||||
- $resources: new(sys:Resources)
|
||||
- $cloudConfigData: $.cast(LinuxMuranoInstance).generateCloudConfig()
|
||||
- $confLang: $resources.yaml('conflang.conf')
|
||||
- $cloudInitConf: $cloudConfigData.mergeWith($confLang)
|
||||
- Return: $cloudInitConf
|
@ -1,15 +1,3 @@
|
||||
# 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:
|
||||
=: io.murano.resources
|
||||
sys: io.murano.system
|
||||
@ -23,35 +11,8 @@ Extends:
|
||||
Methods:
|
||||
prepareUserData:
|
||||
Body:
|
||||
- $environment: $.find(std:Environment).require()
|
||||
- $resources: new(sys:Resources)
|
||||
- $configFile: $resources.string('Agent-v2.template')
|
||||
- $initScript: $resources.string('linux-init.sh')
|
||||
- $muranoScript: $resources.string('murano-init.sh')
|
||||
- $muranoAgentConf: $resources.string('murano-agent.conf')
|
||||
- $muranoAgentService: $resources.string('murano-agent.service')
|
||||
- $muranoAgent: $resources.string('murano-agent')
|
||||
- $configReplacements:
|
||||
"%RABBITMQ_HOST%": config(rabbitmq, host)
|
||||
"%RABBITMQ_PORT%": config(rabbitmq, port)
|
||||
"%RABBITMQ_USER%": config(rabbitmq, login)
|
||||
"%RABBITMQ_PASSWORD%": config(rabbitmq, password)
|
||||
"%RABBITMQ_VHOST%": config(rabbitmq, virtual_host)
|
||||
"%RABBITMQ_SSL%": str(config(rabbitmq, ssl)).toLower()
|
||||
"%RABBITMQ_INPUT_QUEUE%": $.agent.queueName()
|
||||
"%RESULT_QUEUE%": $environment.agentListener.queueName()
|
||||
- $scriptReplacements:
|
||||
"%AGENT_CONFIG_BASE64%": base64encode($configFile.replace($configReplacements))
|
||||
"%INTERNAL_HOSTNAME%": $.name
|
||||
"%MURANO_SERVER_ADDRESS%": coalesce(config(file_server), config(rabbitmq, host))
|
||||
"%CA_ROOT_CERT_BASE64%": ""
|
||||
- $muranoReplacements:
|
||||
"%MURANO_AGENT_CONF%": base64encode($muranoAgentConf)
|
||||
"%MURANO_AGENT_SERVICE%": base64encode($muranoAgentService)
|
||||
"%MURANO_AGENT%": base64encode($muranoAgent)
|
||||
|
||||
- $userData: $muranoScript.replace($muranoReplacements) + $initScript.replace($scriptReplacements)
|
||||
- Return:
|
||||
- $userData: $.generateUserData()
|
||||
- Return:
|
||||
data: $._generateInstanceConfigResources($userData)
|
||||
format: RAW
|
||||
|
||||
@ -62,10 +23,10 @@ Methods:
|
||||
Body:
|
||||
- $environment: $.find(std:Environment).require()
|
||||
- $resources: new(sys:Resources)
|
||||
- $muranoInitConf: $resources.yaml('murano-init.conf')
|
||||
- $bootConfigResourceName: format('boot_config_{0}', $.name)
|
||||
- $muranoInitConf: $.generateCloudConfig()
|
||||
- $bootScriptResourceName: format('boot_script_{0}', $.name)
|
||||
- $userDataResourceName: format('user_data-{0}', $.name)
|
||||
- $bootConfigResourceName: format('boot_config-{0}', $.name)
|
||||
- $template:
|
||||
resources:
|
||||
$bootConfigResourceName:
|
||||
@ -86,3 +47,45 @@ Methods:
|
||||
|
||||
- $environment.stack.updateTemplate($template)
|
||||
- Return: {get_resource: $userDataResourceName}
|
||||
|
||||
|
||||
generateCloudConfig:
|
||||
Body:
|
||||
- $resources: new(sys:Resources)
|
||||
- $muranoInitConf: $resources.yaml('murano-init.conf')
|
||||
- Return: $muranoInitConf
|
||||
|
||||
generateUserData:
|
||||
Body:
|
||||
- $environment: $.find(std:Environment).require()
|
||||
- $resources: new(sys:Resources)
|
||||
- $configFile: $resources.string('Agent-v2.template')
|
||||
- $initScript: $resources.string('linux-init.sh')
|
||||
- $muranoScript: $resources.string('murano-init.sh')
|
||||
- $muranoAgentConf: $resources.string('murano-agent.conf')
|
||||
- $muranoAgentService: $resources.string('murano-agent.service')
|
||||
- $muranoAgent: $resources.string('murano-agent')
|
||||
- $configReplacements:
|
||||
"%RABBITMQ_HOST%": config(rabbitmq, host)
|
||||
"%RABBITMQ_PORT%": config(rabbitmq, port)
|
||||
"%RABBITMQ_USER%": config(rabbitmq, login)
|
||||
"%RABBITMQ_PASSWORD%": config(rabbitmq, password)
|
||||
"%RABBITMQ_VHOST%": config(rabbitmq, virtual_host)
|
||||
"%RABBITMQ_SSL%": str(config(rabbitmq, ssl)).toLower()
|
||||
"%RABBITMQ_INPUT_QUEUE%": $.agent.queueName()
|
||||
"%RESULT_QUEUE%": $environment.agentListener.queueName()
|
||||
- $scriptReplacements:
|
||||
"%AGENT_CONFIG_BASE64%": base64encode($configFile.replace($configReplacements))
|
||||
"%INTERNAL_HOSTNAME%": $.name
|
||||
"%MURANO_SERVER_ADDRESS%": coalesce(config(file_server), config(rabbitmq, host))
|
||||
"%CA_ROOT_CERT_BASE64%": ""
|
||||
- $muranoReplacements:
|
||||
"%MURANO_AGENT_CONF%": base64encode($muranoAgentConf)
|
||||
"%MURANO_AGENT_SERVICE%": base64encode($muranoAgentService)
|
||||
"%MURANO_AGENT%": base64encode($muranoAgent)
|
||||
|
||||
- $userData: $muranoScript.replace($muranoReplacements) + $initScript.replace($scriptReplacements)
|
||||
- Return: $userData
|
||||
|
||||
|
||||
|
||||
|
30
meta/io.murano/Resources/conflang.conf
Normal file
30
meta/io.murano/Resources/conflang.conf
Normal file
@ -0,0 +1,30 @@
|
||||
yum_repos:
|
||||
chef:
|
||||
baseurl: http://repositories.testbed.fi-ware.eu/repo/rpm/x86_64/
|
||||
enabled: true
|
||||
failovermethod: priority
|
||||
gpgcheck: false
|
||||
name: Chef repo
|
||||
|
||||
puppetlabs-products:
|
||||
name: Puppet Labs Products El 6 - $basearch
|
||||
baseurl: http://yum.puppetlabs.com/el/$releasever/products/$basearch
|
||||
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
|
||||
enabled: true
|
||||
gpgcheck: false
|
||||
|
||||
puppetlabs-deps:
|
||||
name: Puppet Labs Dependencies El 6 - $basearch
|
||||
baseurl: http://yum.puppetlabs.com/el/$releasever/dependencies/$basearch
|
||||
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
|
||||
enabled: true
|
||||
gpgcheck: false
|
||||
|
||||
|
||||
package_upgrade: true
|
||||
|
||||
packages:
|
||||
- chef
|
||||
- puppet
|
||||
|
||||
|
@ -41,6 +41,7 @@ Classes:
|
||||
io.murano.resources.Instance: resources/Instance.yaml
|
||||
io.murano.resources.LinuxInstance: resources/LinuxInstance.yaml
|
||||
io.murano.resources.LinuxMuranoInstance: resources/LinuxMuranoInstance.yaml
|
||||
io.murano.resources.ConfLangInstance: resources/ConfLangInstance.yaml
|
||||
io.murano.resources.HeatSWConfigInstance: resources/HeatSWConfigInstance.yaml
|
||||
io.murano.resources.HeatSWConfigLinuxInstance: resources/HeatSWConfigLinuxInstance.yaml
|
||||
io.murano.resources.LinuxUDInstance: resources/LinuxUDInstance.yaml
|
||||
|
@ -56,7 +56,7 @@ class LanguageSupportTest(core.MuranoTestsCore):
|
||||
"assignFloatingIp": True,
|
||||
'name': environment_name,
|
||||
"?": {
|
||||
"type": self.instance_type,
|
||||
"type": "io.murano.resources.ConfLangInstance",
|
||||
"id": str(uuid.uuid4())
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user