2b9daf5f0c
Defaults to null (which in turn will cause heat to use its default) but allows control over software deployment signalling, in particular to use 'NO_SIGNAL' if required not to wait for success or failure. Change-Id: I7b8bb553724173261d9475e2d574fc0e413d2b3e
125 lines
3.9 KiB
YAML
125 lines
3.9 KiB
YAML
Namespaces:
|
|
=: io.murano.resources
|
|
sys: io.murano.system
|
|
std: io.murano
|
|
|
|
Name: HeatSWConfigInstance
|
|
|
|
Extends:
|
|
- Instance
|
|
|
|
Methods:
|
|
initialize:
|
|
Body:
|
|
- $.softwareConfigs: []
|
|
|
|
# configName will be prepended with the instance name
|
|
# configSection should be a map representing the 'config'
|
|
# fragment in a StructuredConfig
|
|
# inputValues should be a map with any required inputs
|
|
# signalTransport: null (==CFN_SIGNAL), HEAT_SIGNAL, NO_TRANSPORT
|
|
#
|
|
# A StructuredConfig and StructuredDeployment will be added
|
|
# to the Instance
|
|
addStructuredConfig:
|
|
Arguments:
|
|
- configName:
|
|
Contract: $.string().notNull()
|
|
- configSection:
|
|
Contract: {}
|
|
- inputValues:
|
|
Contract: {}
|
|
Default: {}
|
|
- signalTransport:
|
|
Contract: $.string()
|
|
Default: null
|
|
Body:
|
|
- $group: Heat::Ungrouped
|
|
- $.addSoftwareConfig($configName, $configSection,
|
|
inputValues=>$inputValues,
|
|
configGroup=>$group, isStructured=>True,
|
|
signalTransport=>$signalTransport)
|
|
|
|
# Adds a SoftwareConfig and SoftwareDeployment.
|
|
# configName will be prepended with the instance name
|
|
# configSection should be of a suitable form (structured config takes maps,
|
|
# ordinary software config can take a string or a map),
|
|
# configGroup can be Heat::Ungrouped, script, puppet etc
|
|
# inputValues should be a map with any inputs required by the Config
|
|
# signalTransport: null (==CFN_SIGNAL), HEAT_SIGNAL, NO_TRANSPORT
|
|
addSoftwareConfig:
|
|
Arguments:
|
|
- configName:
|
|
Contract: $.string().notNull()
|
|
- configSection:
|
|
# Should be string unless for a structured config
|
|
Contract: $.notNull()
|
|
- inputValues:
|
|
Contract: {}
|
|
Default: {}
|
|
- configGroup:
|
|
Contract: $.string()
|
|
Default: Heat::Ungrouped
|
|
- isStructured:
|
|
Contract: $.bool()
|
|
Default: False
|
|
- signalTransport:
|
|
Contract: $.string()
|
|
Default: null
|
|
|
|
Body:
|
|
- $full_config_name: $.name + '-' + $configName
|
|
- $deployment_name: $full_config_name + '-deployment'
|
|
- $deployment_stderr: $deployment_name + '-stderr'
|
|
- $deployment_stdout: $deployment_name + '-stdout'
|
|
- $injectConfig: $configSection
|
|
- $configType: OS::Heat::SoftwareConfig
|
|
- $deploymentType: OS::Heat::SoftwareDeployment
|
|
- If: $isStructured
|
|
Then:
|
|
- $configType: OS::Heat::StructuredConfig
|
|
- $deploymentType: OS::Heat::StructuredDeployment
|
|
- $injectConfig['completion-signal']: {get_input: deploy_signal_id}
|
|
- $fragment:
|
|
resources:
|
|
$full_config_name:
|
|
type: $configType
|
|
properties:
|
|
group: $configGroup
|
|
config:
|
|
$injectConfig
|
|
$deployment_name:
|
|
type: $deploymentType
|
|
properties:
|
|
config: { get_resource: $full_config_name }
|
|
server: { get_resource: $.name }
|
|
signal_transport: $signalTransport
|
|
input_values:
|
|
$inputValues
|
|
outputs:
|
|
$deployment_stdout:
|
|
value: {get_attr: [$deployment_name, deploy_stdout]}
|
|
$deployment_stderr:
|
|
value: {get_attr: [$deployment_name, deploy_stderr]}
|
|
|
|
- $.softwareConfigs: $.softwareConfigs + list($fragment)
|
|
|
|
# Adds to the stack any heat SW config elements
|
|
prepareStackTemplate:
|
|
Arguments:
|
|
instanceTemplate:
|
|
Contract: {}
|
|
Body:
|
|
- $environment: $.find(std:Environment)
|
|
- For: fragment
|
|
In: $.softwareConfigs
|
|
Do:
|
|
- $instanceTemplate: $instanceTemplate.mergeWith($fragment)
|
|
- Return: $instanceTemplate
|
|
|
|
prepareUserData:
|
|
Body:
|
|
- Return:
|
|
data:
|
|
format: SOFTWARE_CONFIG
|