Add 'userdata_format' to Server heat template
In order to pass raw userdata or heat software config resources to an instance it's necessary to tell Heat what to expect. This patch adds user_data_format defaulting to HEAT_CFNTOOLS (Heat's default) and a function allowing it to be overriden (to RAW or SOFTWARE_CONFIG). Derived classes should override user_data_format as part of prepareUserData which is now expected to return a dictionary whose keys are [data, format]. A class HeatSWConfigInstance extends Instance to add this; a HeatSWConfigLinuxInstance is provided as a convenience (heat SW + SSH access). Change-Id: I59f66d42742bf179e7fa1de3cd5de07dbf9fb42b
This commit is contained in:
parent
65783894f1
commit
99e10a8513
16
meta/io.murano/Classes/resources/HeatSWConfigInstance.yaml
Normal file
16
meta/io.murano/Classes/resources/HeatSWConfigInstance.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
Namespaces:
|
||||
=: io.murano.resources
|
||||
sys: io.murano.system
|
||||
std: io.murano
|
||||
|
||||
Name: HeatSWConfigInstance
|
||||
|
||||
Extends:
|
||||
- Instance
|
||||
|
||||
Methods:
|
||||
prepareUserData:
|
||||
Body:
|
||||
- Return:
|
||||
data:
|
||||
format: SOFTWARE_CONFIG
|
@ -0,0 +1,11 @@
|
||||
Namespaces:
|
||||
=: io.murano.resources
|
||||
sys: io.murano.system
|
||||
std: io.murano
|
||||
|
||||
Name: HeatSWConfigLinuxInstance
|
||||
|
||||
Extends:
|
||||
- LinuxInstance
|
||||
- HeatSWConfigInstance
|
||||
|
@ -82,7 +82,9 @@ Methods:
|
||||
$.joinNet($.environment.defaultNetworks.flat, $securityGroupName)
|
||||
- $.networks.customNetworks.select($this.joinNet($, $securityGroupName))
|
||||
|
||||
- $userData: $.prepareUserData()
|
||||
- $preparedUserData: $.prepareUserData()
|
||||
- $userData: $preparedUserData.data
|
||||
- $userDataFormat: $preparedUserData.format
|
||||
|
||||
- $template:
|
||||
resources:
|
||||
@ -92,6 +94,7 @@ Methods:
|
||||
flavor: $.flavor
|
||||
image: $.image
|
||||
user_data: $userData
|
||||
user_data_format: $userDataFormat
|
||||
key_name: $.keyname
|
||||
outputs:
|
||||
format('{0}-assigned-ip', $.name):
|
||||
@ -231,3 +234,8 @@ Methods:
|
||||
Contract: $.string().notNull()
|
||||
|
||||
prepareUserData:
|
||||
Body:
|
||||
Return:
|
||||
data: null
|
||||
# Valid values are HEAT_CFNTOOLS, RAW and SOFTWARE_CONFIG
|
||||
format: HEAT_CFNTOOLS
|
||||
|
@ -29,5 +29,7 @@ Methods:
|
||||
"%INTERNAL_HOSTNAME%": $.name
|
||||
"%MURANO_SERVER_ADDRESS%": coalesce(config(file_server), config(rabbitmq, host))
|
||||
"%CA_ROOT_CERT_BASE64%": ""
|
||||
- Return: $initScript.replace($scriptReplacements)
|
||||
- Return:
|
||||
data: $initScript.replace($scriptReplacements)
|
||||
format: HEAT_CFNTOOLS
|
||||
|
||||
|
@ -16,7 +16,9 @@ Properties:
|
||||
Methods:
|
||||
prepareUserData:
|
||||
Body:
|
||||
- Return: $.customUserData
|
||||
- Return:
|
||||
data: $.customUserData
|
||||
format: HEAT_CFNTOOLS
|
||||
|
||||
setCustomUserData:
|
||||
Arguments:
|
||||
|
@ -42,4 +42,6 @@ Methods:
|
||||
"%INTERNAL_HOSTNAME%": $.name
|
||||
"%MURANO_SERVER_ADDRESS%": coalesce(config(file_server), config(rabbitmq, host))
|
||||
"%CA_ROOT_CERT_BASE64%": ""
|
||||
- Return: $initScript.replace($scriptReplacements)
|
||||
- Return:
|
||||
data: $initScript.replace($scriptReplacements)
|
||||
format: HEAT_CFNTOOLS
|
||||
|
@ -27,6 +27,8 @@ 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.HeatSWConfigInstance: resources/HeatSWConfigInstance.yaml
|
||||
io.murano.resources.HeatSWConfigLinuxInstance: resources/HeatSWConfigLinuxInstance.yaml
|
||||
io.murano.resources.LinuxUDInstance: resources/LinuxUDInstance.yaml
|
||||
io.murano.resources.WindowsInstance: resources/WindowsInstance.yaml
|
||||
io.murano.resources.NeutronNetwork: resources/NeutronNetwork.yaml
|
||||
|
Loading…
Reference in New Issue
Block a user