Skip to content

Instantly share code, notes, and snippets.

/-

Created October 6, 2016 11:28
Show Gist options
  • Save anonymous/87ea121ac243a8580fa3ef4f8366f976 to your computer and use it in GitHub Desktop.
Save anonymous/87ea121ac243a8580fa3ef4f8366f976 to your computer and use it in GitHub Desktop.
heat_template_version: 2016-04-08
description: Generic Node
parameter_groups:
parameters:
name:
type: string
constraints:
- allowed_pattern: "[a-z][a-z0-9-]{2,}"
key:
type: string
constraints:
- custom_constraint: nova.keypair
image:
type: string
constraints:
- custom_constraint: glance.image
flavor:
type: string
constraints:
- custom_constraint: nova.flavor
networks:
type: comma_delimited_list
security_groups:
type: comma_delimited_list
config:
type: string
default: None
resources:
config1:
type: OS::Heat::CloudConfig
properties:
cloud_config:
users:
- default
final_message: "The system is finally up, after $UPTIME seconds"
package_upgrade: true
config2:
type: OS::Heat::SoftwareConfig
properties:
group: ungrouped
config: |
#!/bin/sh
echo "Generic Node Script"
server_init:
type: OS::Heat::MultipartMime
properties:
parts:
- config: { get_resource: config1 }
- config: { get_resource: config2 }
- config: { get_param: config }
type: multipart
node:
type: OS::Nova::Server
properties:
name: { get_param: name }
image: { get_param: image }
flavor: { get_param: flavor }
key_name: { get_param: key }
networks:
repeat:
for_each:
<%net_name%>: { get_param: networks }
template:
network: <%net_name%>
security_groups: { get_param: security_groups }
user_data_format: SOFTWARE_CONFIG
user_data: {get_resource: server_init}
outputs:
node:
value: { get_resource: node }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment