-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathredis.template
89 lines (84 loc) · 2.27 KB
/
redis.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
heat_template_version: 2013-05-23
description: |
Simple template to deploy Redis on a cloud server
parameters:
server_name:
type: string
description: Name of the server hosting Redis
default:
str_replace:
template: stack_name_redis_server
params:
stack_name: { get_param: "OS::stack_name" }
key_name:
type: string
description: the name of an existing nova key pair to use for server access
image:
type: string
description: Server image id to use
default: Ubuntu 13.10 (Saucy Salamander)
constraints:
# only tested on Ubuntu images so far
- allowed_values:
- Ubuntu 13.04 (Raring Ringtail)
- Ubuntu 13.10 (Saucy Salamander)
description: must be a valid Ubuntu image id
flavor:
description: Server flavor id to use
type: string
default: 1GB Standard Instance
constraints:
- allowed_values:
- 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.
resources:
redis:
type: OS::Nova::Server
properties:
name: { get_param: server_name }
key_name: { get_param: key_name }
image: { get_param: image }
flavor: { get_param: flavor }
user_data_format: RAW
config_drive: "true"
user_data: |
#!/bin/bash -xv
apt-get update
apt-get install -y build-essential
wget http://download.redis.io/releases/redis-2.6.16.tar.gz
tar xzf redis-2.6.16.tar.gz
cd redis-2.6.16
make
make install
cd utils
yes '' | ./install_server.sh
cd ../../
rm -rf redis-2.6.16
rm redis-2.6.16.tar.gz
outputs:
ssh:
value:
str_replace:
template: ssh root@%host%
params:
"%host%":
get_attr:
- redis
- accessIPv4
description: ssh to the redis host
verify:
value:
str_replace:
template: redis-cli -h %host% ping
params:
"%host%":
get_attr:
- redis
- accessIPv4
description: verify the redis server via redis-cli