Skip to content

Instantly share code, notes, and snippets.

@chrishultin
Created January 28, 2016 22:13
Show Gist options
  • Save chrishultin/59f9aa6856c50f17e7a3 to your computer and use it in GitHub Desktop.
Save chrishultin/59f9aa6856c50f17e7a3 to your computer and use it in GitHub Desktop.
description: 'Create an instance of Redis on the RackConnect enabled network (redis
v2.8.13)
'
heat_template_version: '2013-05-23'
outputs:
private_key:
description: SSH Private Key
value:
get_attr: [ssh_key, private_key]
redis_password:
description: Redis Password
value:
get_attr: [redis_password, value]
redis_port:
description: Redis Port
value: {get_param: redis_port}
redis_server_ip:
description: Server IP
value:
get_attr: [redis_server, accessIPv4]
parameter_groups:
- label: Server Settings
parameters: [flavor, image]
- label: Redis Settings
parameters: [redis_port]
- label: rax-dev-params
parameters: [redis_version, redis_hostname, kitchen, chef_version]
parameters:
chef_version: {default: 11.12.8, description: Version of chef client to use, label: Chef
Version, type: string}
flavor:
constraints:
- allowed_values: [1 GB General Purpose v1, 2 GB General Purpose v1, 4 GB
General Purpose v1, 8 GB General Purpose v1, 15 GB I/O v1, 30
GB I/O v1, 512MB Standard Instance, 1GB Standard Instance, 2GB
Standard Instance, 4GB Standard Instance, 8GB Standard Instance,
15GB Standard Instance, 30GB Standard Instance]
description: 'Must be a valid Rackspace Cloud Server flavor for the region
you have
selected to deploy into.
'
default: 1 GB General Purpose v1
description: 'Rackspace Cloud Server flavor to use. The size is based on the
amount of
RAM for the provisioned server.
'
label: Server Size
type: string
image:
constraints:
- allowed_values: [Ubuntu 12.04 LTS (Precise Pangolin) (PVHVM), Ubuntu 14.04
LTS (Trusty Tahr) (PV)]
description: Must be a supported operating system.
default: Ubuntu 14.04 LTS (Trusty Tahr) (PV)
description: 'Server image used for all servers that are created as a part
of this
deployment
'
label: Operating System
type: string
kitchen: {default: 'https://github.com/rackspace-orchestration-templates/redis-single',
description: URL for the kitchen to use, label: Kitchen, type: string}
rc_network_name:
constraints:
- {custom_constraint: rackconnect.network}
default: RC-CLOUD-FW-RACKCONNECT
description: Name or UUID of RackConnected network to attach this server to
label: RackConnect Network
type: string
redis_hostname: {default: redis, description: Hostname for Redis server, label: Server
Hostname, type: string}
redis_port:
constraints:
- description: Must be between 1024 and 65535.
range: {max: 65535, min: 1024}
default: 6379
description: Port for redis servers to listen on.
label: Port
type: number
redis_version: {default: 2.8.14, description: version of Redis to install, label: Redis
Version, type: string}
resources:
redis_password:
properties: {length: 16, sequence: lettersdigits}
type: OS::Heat::RandomString
redis_server:
depends_on: ssh_key
properties:
flavor: {get_param: flavor}
image: {get_param: image}
key_name: {get_resource: ssh_key}
metadata:
rax-heat: {get_param: 'OS::stack_id'}
name: {get_param: redis_hostname}
networks:
- {network: RC-CLOUD-FW-RACKCONNECT}
- {uuid: 11111111-1111-1111-1111-111111111111}
type: OS::Nova::Server
redis_server_public_ip:
type: Rackspace::RackConnect::PublicIP
depends_on:
- redis_server
properties:
server_id: { get_resource: redis_server }
redis_server_config:
depends_on:
- redis_server
- redis_server_public_ip
properties:
chef_version: {get_param: chef_version}
host:
get_attr: [redis_server, accessIPv4]
kitchen: {get_param: kitchen}
node:
redisio:
default_settings:
requirepass:
get_attr: [redis_password, value]
servers:
- name: {get_param: redis_hostname}
port: {get_param: redis_port}
version: {get_param: redis_version}
run_list: ['recipe[apt]', 'recipe[build-essential]', 'recipe[redisio::default]',
'recipe[redisio::enable]']
private_key:
get_attr: [ssh_key, private_key]
username: root
type: OS::Heat::ChefSolo
ssh_key:
properties:
name: {get_param: 'OS::stack_id'}
save_private_key: true
type: OS::Nova::KeyPair
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment