Skip to content

Instantly share code, notes, and snippets.

@jyidiego
Created October 4, 2014 04:33
Show Gist options
  • Save jyidiego/698446bd89dbd60b3e33 to your computer and use it in GitHub Desktop.
Save jyidiego/698446bd89dbd60b3e33 to your computer and use it in GitHub Desktop.
heat_template_version: 2013-05-23
description: |
Simple template to deploy Redis on a cloud server
parameters:
key-name:
type: string
description: Name of a nova ssh keypair to use for server access
image:
# currently requires an image id; refactor in-progress
# to accept image names as well as ids
type: string
description: Server image id to use
default: 928e709d-35f0-47eb-b296-d18e1b0a76b7
constraints:
# only tested on Ubuntu images so far
- allowed_values:
- 928e709d-35f0-47eb-b296-d18e1b0a76b7
description: must be a valid Ubuntu image id
flavor:
# currently requires an id; refactor in-progress
# to allow flavor names as well as ids
description: Server flavor id to use
type: string
default: performance1-1
constraints:
- allowed_values: ["performance1-1", "2", "3", "4", "5", "6", "7", "8"]
description: must be a valid Rackspace Cloud Server flavor.
resources:
redis:
type: "Rackspace::Cloud::Server"
properties:
key_name: { get_param: key-name }
image: { get_param: image }
flavor: { get_param: flavor }
user_data: |
apt-get install -y build-essential
wget http://download.redis.io/releases/redis-2.8.4.tar.gz
tar xzf redis-2.8.4.tar.gz
cd redis-2.8.4
make
make install
cd utils
yes '' | ./install_server.sh
cd ../../
rm -rf redis-2.8.4
rm redis-2.8.4.tar.gz
outputs:
ssh:
value:
str_replace:
template: ssh root@$host
params:
host:
get_attr:
- redis
- PublicIp
description: ssh to the redis host
verify:
value:
str_replace:
template: redis-cli -h $host ping
params:
host:
get_attr:
- redis
- PublicIp
description: verify the redis server via redis-cli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment