99e10a8513
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
48 lines
1.6 KiB
YAML
48 lines
1.6 KiB
YAML
Namespaces:
|
|
=: io.murano.resources
|
|
std: io.murano
|
|
sys: io.murano.system
|
|
|
|
Name: WindowsInstance
|
|
|
|
Extends: Instance
|
|
|
|
Methods:
|
|
createDefaultInstanceSecurityGroupRules:
|
|
Arguments:
|
|
- groupName:
|
|
Contract: $.string().notNull()
|
|
Body:
|
|
- $environment: $.find(std:Environment).require()
|
|
- $rules:
|
|
- ToPort: 3389
|
|
IpProtocol: tcp
|
|
FromPort: 3389
|
|
External: true
|
|
- $environment.securityGroupManager.addGroupIngress(
|
|
rules => $rules, groupName => $groupName)
|
|
|
|
prepareUserData:
|
|
Body:
|
|
- $resources: new(sys:Resources)
|
|
- $environment: $.find(std:Environment).require()
|
|
- $configFile: $resources.string('Agent-v1.template')
|
|
- $initScript: $resources.string('windows-init.ps1')
|
|
- $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%": ""
|
|
- Return:
|
|
data: $initScript.replace($scriptReplacements)
|
|
format: HEAT_CFNTOOLS
|