spiceweasel 0.6.1 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +33 -5
- data/README.md +196 -134
- data/bin/spiceweasel +50 -11
- data/example.json +26 -4
- data/example.yml +15 -3
- data/lib/spiceweasel/version.rb +1 -1
- metadata +3 -4
data/CHANGELOG.md
CHANGED
@@ -35,15 +35,43 @@ This is the current, previous and future development milestones and contains the
|
|
35
35
|
===
|
36
36
|
* add support for cookbook options
|
37
37
|
|
38
|
+
0.7 *CURRENT*
|
39
|
+
=============
|
40
|
+
* add support for environments
|
41
|
+
* rescue from parser errors
|
42
|
+
* update cookbook download syntax
|
43
|
+
* multiple nodes with same runlists syntax
|
44
|
+
* add support for encrypted data bags
|
45
|
+
* wildcard support for data bag items
|
46
|
+
|
38
47
|
BACKLOG
|
39
48
|
=======
|
40
|
-
|
49
|
+
Next
|
50
|
+
----
|
51
|
+
* make spiceweasel a library rather than an executable
|
52
|
+
* switch to using lib/ directory
|
53
|
+
* convert to a knife plugin
|
54
|
+
* knife batch create from file infrastructure.yml
|
55
|
+
* knife batch delete from file infrastructure.json
|
56
|
+
* knife batch rebuild from file infrastructure.yml
|
57
|
+
Future
|
58
|
+
------
|
41
59
|
* --chef-client The option `--chef-client` will make a `knife ssh` call to each box and run `chef-client` on each.
|
42
60
|
* --chef-client validation that nodes are added
|
43
|
-
* add support for environments
|
44
|
-
* make the JSON calls directly with Chef APIs
|
45
61
|
* -e/--execute execute the commands
|
46
|
-
* catching return codes and retrying (with retry count?)
|
62
|
+
* catching return codes and retrying (with retry count?)
|
63
|
+
* make the JSON calls directly with Chef APIs
|
64
|
+
* execution-phase validation
|
65
|
+
* check metadata.rb of cookbooks for their dependencies
|
66
|
+
* validate within role files rather than the names of files (assumption that they are the same)
|
67
|
+
* validate cookbooks referenced in roles
|
68
|
+
* validate not trying to use environments with 0.9.x
|
69
|
+
* validate within environment files rather than the names of files (assumption that they are the same)
|
70
|
+
* validate cookbooks referenced in environments
|
71
|
+
* validate recipes from cookbooks in run_lists
|
72
|
+
* wildcards for environments and roles
|
47
73
|
* on provider delete take count of vendor-specific, delete if match (ec2 server delete and node delete)
|
48
|
-
* knife
|
74
|
+
* knife winrm bootstrap FQDN [RUN LIST...] (options)
|
49
75
|
* use GNU parallel with knife?
|
76
|
+
* extract existing infrastructure
|
77
|
+
* knife batch extract
|
data/README.md
CHANGED
@@ -8,11 +8,11 @@ Requirements
|
|
8
8
|
============
|
9
9
|
Spiceweasel currently depends on `knife` to run commands for it. Infrastructure files must either end in .json or .yml to be processed.
|
10
10
|
|
11
|
-
Written with Chef 0.9.12 and 0.
|
11
|
+
Written with Chef 0.9.12 and 0.10.0 and supports cookbooks, environments, roles, data bags and nodes.
|
12
12
|
|
13
13
|
Testing
|
14
14
|
-------
|
15
|
-
Tested with Ubuntu 10.04 and 10.10 and Chef 0.9.
|
15
|
+
Tested with Ubuntu 10.04 and 10.10 and Chef 0.9.16 and 0.10.0.rc.1.
|
16
16
|
|
17
17
|
File Syntax
|
18
18
|
===========
|
@@ -22,180 +22,242 @@ JSON
|
|
22
22
|
----
|
23
23
|
From the `example.json`:
|
24
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
|
-
|
25
|
+
``` json
|
26
|
+
{
|
27
|
+
"cookbooks":
|
28
|
+
[
|
29
|
+
{"apache2":[]},
|
30
|
+
{"apt":
|
31
|
+
[
|
32
|
+
"1.1.0"
|
33
|
+
]
|
34
|
+
},
|
35
|
+
{"mysql":[]}
|
36
|
+
],
|
37
|
+
"environments":
|
38
|
+
[
|
39
|
+
{"development":[]},
|
40
|
+
{"qa":[]},
|
41
|
+
{"production":[]}
|
42
|
+
],
|
43
|
+
"roles":
|
44
|
+
[
|
45
|
+
{"base":[]},
|
46
|
+
{"monitoring":[]},
|
47
|
+
{"webserver":[]}
|
48
|
+
],
|
49
|
+
"data bags":
|
50
|
+
[
|
51
|
+
{"users":
|
52
|
+
[
|
53
|
+
"alice",
|
54
|
+
"bob",
|
55
|
+
"chuck"
|
56
|
+
]
|
57
|
+
},
|
58
|
+
{"data":[]}
|
59
|
+
],
|
60
|
+
"nodes":
|
61
|
+
[
|
62
|
+
{"serverA":
|
63
|
+
[
|
64
|
+
"role[base]",
|
65
|
+
"-i ~/.ssh/mray.pem -x user --sudo -d ubuntu10.04-gems"
|
66
|
+
]
|
67
|
+
},
|
68
|
+
{"ec2 5":
|
69
|
+
[
|
70
|
+
"role[webserver] recipe[mysql::client]",
|
71
|
+
"-S mray -I ~/.ssh/mray.pem -x ubuntu -G default -i ami-a403f7cd -f m1.small"
|
72
|
+
]
|
73
|
+
},
|
74
|
+
{"rackspace 3":
|
75
|
+
[
|
76
|
+
"recipe[mysql] role[monitoring]",
|
77
|
+
"--image 49 --flavor 2"
|
78
|
+
]
|
79
|
+
}
|
80
|
+
]
|
81
|
+
}
|
82
|
+
```
|
76
83
|
|
77
84
|
YAML
|
78
85
|
----
|
79
86
|
From the `example.yml`:
|
80
87
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
88
|
+
``` yaml
|
89
|
+
cookbooks:
|
90
|
+
- apache2:
|
91
|
+
- apt:
|
92
|
+
- 1.1.0
|
93
|
+
- mysql:
|
94
|
+
|
95
|
+
environments:
|
96
|
+
- development:
|
97
|
+
- qa:
|
98
|
+
- production:
|
99
|
+
|
100
|
+
roles:
|
101
|
+
- base:
|
102
|
+
- monitoring:
|
103
|
+
- webserver:
|
104
|
+
|
105
|
+
data bags:
|
106
|
+
- users:
|
107
|
+
- alice
|
108
|
+
- bob
|
109
|
+
- chuck
|
110
|
+
- data:
|
111
|
+
|
112
|
+
nodes:
|
113
|
+
- serverA:
|
114
|
+
- role[base]
|
115
|
+
- -i ~/.ssh/mray.pem -x user --sudo -d ubuntu10.04-gems
|
116
|
+
- ec2 5:
|
117
|
+
- role[webserver] recipe[mysql::client]
|
118
|
+
- -S mray -I ~/.ssh/mray.pem -x ubuntu -G default -i ami-a403f7cd -f m1.small
|
119
|
+
- rackspace 3:
|
120
|
+
- recipe[mysql] role[monitoring]
|
121
|
+
- --image 49 --flavor 2
|
122
|
+
```
|
110
123
|
|
111
124
|
Cookbooks
|
112
125
|
---------
|
113
|
-
The `cookbooks` section of the JSON or YAML file currently supports `knife cookbook upload FOO` where `FOO` is the name of the cookbook in the `cookbooks` directory. If a version is passed, it is validated against an existing cookbook `metadata.rb` and if none is found, the missing cookbook is downloaded. You may pass any additional arguments
|
126
|
+
The `cookbooks` section of the JSON or YAML file currently supports `knife cookbook upload FOO` where `FOO` is the name of the cookbook in the `cookbooks` directory. If a version is passed, it is validated against an existing cookbook `metadata.rb` and if none is found, the missing cookbook is downloaded (without touching version control) and the command to untar it is provided. You may pass any additional arguments if necessary. The YAML snippet
|
114
127
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
128
|
+
``` yaml
|
129
|
+
cookbooks:
|
130
|
+
- apache2:
|
131
|
+
- apt:
|
132
|
+
- 1.1.0
|
133
|
+
- mysql:
|
134
|
+
```
|
121
135
|
|
122
136
|
produces the knife commands
|
123
137
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
138
|
+
```
|
139
|
+
knife cookbook upload apache2
|
140
|
+
knife cookbook site download apt 1.1.0 --file cookbooks/apt.tgz
|
141
|
+
tar -C cookbooks/ -xf cookbooks/apt.tgz
|
142
|
+
knife cookbook upload apt
|
143
|
+
knife cookbook upload mysql
|
144
|
+
```
|
145
|
+
|
146
|
+
Environments
|
147
|
+
------------
|
148
|
+
The `environments` section of the JSON or YAML file currently supports `knife environment from file FOO` where `FOO` is the name of the environment file ending in `.rb` in the `environments` directory. The YAML snippet
|
149
|
+
|
150
|
+
``` yaml
|
151
|
+
environments:
|
152
|
+
- development:
|
153
|
+
- qa:
|
154
|
+
- production:
|
155
|
+
```
|
156
|
+
|
157
|
+
produces the knife commands
|
158
|
+
|
159
|
+
```
|
160
|
+
knife environment from file development.rb
|
161
|
+
knife environment from file qa.rb
|
162
|
+
knife environment from file production.rb
|
163
|
+
```
|
128
164
|
|
129
165
|
Roles
|
130
166
|
-----
|
131
167
|
The `roles` section of the JSON or YAML file currently supports `knife role from file FOO` where `FOO` is the name of the role file ending in `.rb` in the `roles` directory. The YAML snippet
|
132
168
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
169
|
+
``` yaml
|
170
|
+
roles:
|
171
|
+
- base:
|
172
|
+
- monitoring:
|
173
|
+
- webserver:
|
174
|
+
```
|
137
175
|
|
138
176
|
produces the knife commands
|
139
177
|
|
140
|
-
|
141
|
-
|
142
|
-
|
178
|
+
```
|
179
|
+
knife role from file base.rb
|
180
|
+
knife role from file monitoring.rb
|
181
|
+
knife role from file webserver.rb
|
182
|
+
```
|
143
183
|
|
144
184
|
Data Bags
|
145
185
|
---------
|
146
|
-
The `data bags` section of the JSON or YAML file currently creates the data bags listed with `knife data bag create FOO` where `FOO` is the name of the data bag. Individual items may be added to the data bag as part of a JSON or YAML sequence, the assumption is made that they `.json` files and in the `data_bags` directory.
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
186
|
+
The `data bags` section of the JSON or YAML file currently creates the data bags listed with `knife data bag create FOO` where `FOO` is the name of the data bag. Individual items may be added to the data bag as part of a JSON or YAML sequence, the assumption is made that they `.json` files and in the `data_bags/FOO` directory. You may also pass a wildcard as an entry to load all matching data bags (ie. `*`). Encrypted data bags are supported by listing `secret filename` as the first item (where `filename` is the secret key to be used). Assuming the presence of `dataA.json` and `dataB.json` in the `data_bags/data` directory, the YAML snippet
|
187
|
+
|
188
|
+
``` yaml
|
189
|
+
data bags:
|
190
|
+
- users:
|
191
|
+
- alice
|
192
|
+
- bob
|
193
|
+
- chuck
|
194
|
+
- data:
|
195
|
+
- *
|
196
|
+
- passwords:
|
197
|
+
- secret secret_key
|
198
|
+
- mysql
|
199
|
+
- rabbitmq
|
200
|
+
```
|
154
201
|
|
155
202
|
produces the knife commands
|
156
203
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
204
|
+
```
|
205
|
+
knife data bag create users
|
206
|
+
knife data bag from file users data_bags/users/alice.json
|
207
|
+
knife data bag from file users data_bags/users/bob.json
|
208
|
+
knife data bag from file users data_bags/users/chuck.json
|
209
|
+
knife data bag create data
|
210
|
+
knife data bag from file users data_bags/data/dataA.json
|
211
|
+
knife data bag from file users data_bags/data/dataB.json
|
212
|
+
knife data bag create passwords
|
213
|
+
knife data bag from file passwords data_bags/passwords/mysql.json --secret-file secret_key
|
214
|
+
knife data bag from file passwords data_bags/passwords/rabbitmq.json --secret-file secret_key
|
215
|
+
```
|
162
216
|
|
163
217
|
Nodes
|
164
218
|
-----
|
165
219
|
The `nodes` section of the JSON or YAML file bootstraps a node for each entry where the entry is a hostname or provider and count. Each node requires 2 items after it in a sequence. The first item is the run_list and the second the CLI options used. Validation is performed on the run_list components to ensure that only recipes and roles listed in the file are used. A shortcut syntax for bulk-creating nodes with various providers where the line starts with the provider and ends with the number of nodes to be provisioned. The YAML snippet
|
166
220
|
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
221
|
+
``` yaml
|
222
|
+
nodes:
|
223
|
+
- serverA:
|
224
|
+
- role[base]
|
225
|
+
- -i ~/.ssh/mray.pem -x user --sudo -d ubuntu10.04-gems
|
226
|
+
- ec2 5:
|
227
|
+
- role[webserver] recipe[mysql::client]
|
228
|
+
- -S mray -I ~/.ssh/mray.pem -x ubuntu -G default -i ami-a403f7cd -f m1.small
|
229
|
+
- rackspace 3:
|
230
|
+
- recipe[mysql] role[monitoring]
|
231
|
+
- --image 49 --flavor 2
|
232
|
+
```
|
177
233
|
|
178
234
|
produces the knife commands
|
179
235
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
236
|
+
```
|
237
|
+
knife bootstrap serverA 'role[base]' -i ~/.ssh/mray.pem -x user --sudo -d ubuntu10.04-gems
|
238
|
+
knife ec2 server create 'role[webserver]' 'recipe[mysql::client]' -S mray -I ~/.ssh/mray.pem -x ubuntu -G default -i ami-a403f7cd -f m1.small
|
239
|
+
knife ec2 server create 'role[webserver]' 'recipe[mysql::client]' -S mray -I ~/.ssh/mray.pem -x ubuntu -G default -i ami-a403f7cd -f m1.small
|
240
|
+
knife ec2 server create 'role[webserver]' 'recipe[mysql::client]' -S mray -I ~/.ssh/mray.pem -x ubuntu -G default -i ami-a403f7cd -f m1.small
|
241
|
+
knife ec2 server create 'role[webserver]' 'recipe[mysql::client]' -S mray -I ~/.ssh/mray.pem -x ubuntu -G default -i ami-a403f7cd -f m1.small
|
242
|
+
knife ec2 server create 'role[webserver]' 'recipe[mysql::client]' -S mray -I ~/.ssh/mray.pem -x ubuntu -G default -i ami-a403f7cd -f m1.small
|
243
|
+
knife rackspace server create 'recipe[mysql]' 'role[monitoring]' --image 49 --flavor 2
|
244
|
+
knife rackspace server create 'recipe[mysql]' 'role[monitoring]' --image 49 --flavor 2
|
245
|
+
knife rackspace server create 'recipe[mysql]' 'role[monitoring]' --image 49 --flavor 2
|
246
|
+
```
|
189
247
|
|
190
248
|
Usage
|
191
249
|
=====
|
192
250
|
To run a spiceweasel file, run the following from you Chef repository directory:
|
193
251
|
|
194
|
-
|
252
|
+
```
|
253
|
+
spiceweasel path/to/infrastructure.json
|
254
|
+
```
|
195
255
|
|
196
256
|
or
|
197
257
|
|
198
|
-
|
258
|
+
```
|
259
|
+
spiceweasel path/to/infrastructure.yml
|
260
|
+
```
|
199
261
|
|
200
262
|
This will generate the knife commands to build the described infrastructure. Infrastructure files must end in either `.json` or `.yml`.
|
201
263
|
|
data/bin/spiceweasel
CHANGED
@@ -6,7 +6,7 @@ require 'spiceweasel/version'
|
|
6
6
|
require 'yaml'
|
7
7
|
|
8
8
|
#ensure that the run_list contents are present in either the cookbooks or roles
|
9
|
-
def validate_run_list(run_list, cookbooks, roles)
|
9
|
+
def validate_run_list(run_list, cookbooks, environments, roles)
|
10
10
|
run_list.each do |item|
|
11
11
|
if item.start_with?("recipe")
|
12
12
|
#recipe[foo] or recipe[foo::bar]
|
@@ -15,6 +15,13 @@ def validate_run_list(run_list, cookbooks, roles)
|
|
15
15
|
raise "'#{item}' is an invalid run_list recipe not managed by spiceweasel"
|
16
16
|
exit(-1)
|
17
17
|
end
|
18
|
+
elsif item.start_with?("environment")
|
19
|
+
#environment[blah]
|
20
|
+
environment = item.slice(12..-2)
|
21
|
+
unless environments.member?(environment)
|
22
|
+
raise "'#{item}' is an invalid run_list environment not managed by spiceweasel"
|
23
|
+
exit(-1)
|
24
|
+
end
|
18
25
|
elsif item.start_with?("role")
|
19
26
|
#role[blah]
|
20
27
|
role = item.slice(5..-2)
|
@@ -67,7 +74,6 @@ class SpiceweaselCLI
|
|
67
74
|
:boolean => true,
|
68
75
|
:proc => lambda {|v| puts "Spiceweasel: #{Spiceweasel::VERSION}" },
|
69
76
|
:exit => 0
|
70
|
-
|
71
77
|
end
|
72
78
|
|
73
79
|
#process command line options
|
@@ -91,6 +97,10 @@ begin
|
|
91
97
|
raise "Unknown file type, please use a file ending with either '.json' or '.yml'."
|
92
98
|
exit(-1)
|
93
99
|
end
|
100
|
+
rescue JSON::ParserError => e
|
101
|
+
STDERR.puts e.message
|
102
|
+
STDERR.puts "Parsing error in the infrastructure file provided."
|
103
|
+
exit(-1)
|
94
104
|
rescue Exception
|
95
105
|
STDERR.puts "No infrastructure .json or .yml file provided."
|
96
106
|
puts cli.opt_parser.to_s
|
@@ -119,7 +129,8 @@ cookbooks.each do |cookbook|
|
|
119
129
|
exit(-1)
|
120
130
|
end
|
121
131
|
elsif !File.directory?("cookbooks/#{cb}")
|
122
|
-
create += "knife cookbook site
|
132
|
+
create += "knife cookbook site download #{cb} #{version} --file cookbooks/#{cb}.tgz #{args}\n"
|
133
|
+
create += "tar -C cookbooks/ -xf cookbooks/#{cb}.tgz\n"
|
123
134
|
end
|
124
135
|
else
|
125
136
|
STDERR.puts "cookbooks directory not found, validation and downloading skipped"
|
@@ -129,6 +140,16 @@ cookbooks.each do |cookbook|
|
|
129
140
|
cookbook_list.push(cb)
|
130
141
|
end
|
131
142
|
|
143
|
+
#environments
|
144
|
+
environments = input['environments'] || []
|
145
|
+
environment_list = []
|
146
|
+
environments.each do |environment|
|
147
|
+
delete += "knife environment delete #{environment.keys[0]} -y\n"
|
148
|
+
create += "knife environment from file #{environment.keys[0]}.rb\n"
|
149
|
+
#flatten list of environments for validation later
|
150
|
+
environment_list.push(environment.keys[0])
|
151
|
+
end
|
152
|
+
|
132
153
|
#roles
|
133
154
|
roles = input['roles'] || []
|
134
155
|
role_list = []
|
@@ -145,8 +166,23 @@ bags.each do |bag|
|
|
145
166
|
delete += "knife data bag delete #{bag.keys[0]} -y\n"
|
146
167
|
create += "knife data bag create #{bag.keys[0]}\n"
|
147
168
|
items = bag[bag.keys[0]] || []
|
148
|
-
|
149
|
-
|
169
|
+
secret = nil
|
170
|
+
while item = items.shift
|
171
|
+
if item.start_with?("secret")
|
172
|
+
secret = item.split()[1]
|
173
|
+
next
|
174
|
+
end
|
175
|
+
if item =~ /\*/ #wildcard support
|
176
|
+
files = Dir.glob("data_bags/#{bag.keys[0]}/#{item}.json")
|
177
|
+
items += files.collect {|x| x[x.rindex('/')+1..-6]}
|
178
|
+
puts items
|
179
|
+
next
|
180
|
+
end
|
181
|
+
if secret
|
182
|
+
create += "knife data bag from file #{bag.keys[0]} data_bags/#{bag.keys[0]}/#{item}.json --secret-file #{secret}\n"
|
183
|
+
else
|
184
|
+
create += "knife data bag from file #{bag.keys[0]} data_bags/#{bag.keys[0]}/#{item}.json\n"
|
185
|
+
end
|
150
186
|
end
|
151
187
|
end
|
152
188
|
|
@@ -156,8 +192,8 @@ delete += "knife node bulk_delete .* -y\n"
|
|
156
192
|
nodes.each do |node|
|
157
193
|
# delete += "knife node delete #{node[node.keys[0]}\n"
|
158
194
|
run_list = node[node.keys[0]][0].split()
|
159
|
-
validate_run_list(run_list, cookbook_list, role_list)
|
160
|
-
if node.keys[0].start_with?("bluebox","ec2","rackspace","slicehost","terremark")
|
195
|
+
validate_run_list(run_list, cookbook_list, environment_list, role_list)
|
196
|
+
if node.keys[0].start_with?("bluebox","ec2","openstack","rackspace","slicehost","terremark")
|
161
197
|
provider = node.keys[0].split()
|
162
198
|
count = 1
|
163
199
|
if (provider.length == 2)
|
@@ -171,11 +207,14 @@ nodes.each do |node|
|
|
171
207
|
create +="#{node[node.keys[0]][1]}\n"
|
172
208
|
end
|
173
209
|
else
|
174
|
-
|
175
|
-
|
176
|
-
create += "
|
210
|
+
#multinode support
|
211
|
+
node.keys[0].split.each do |server|
|
212
|
+
create += "knife bootstrap #{server} "
|
213
|
+
run_list.each do |x|
|
214
|
+
create += "\'#{x}\' "
|
215
|
+
end
|
216
|
+
create +="#{node[node.keys[0]][1]}\n"
|
177
217
|
end
|
178
|
-
create +="#{node[node.keys[0]][1]}\n"
|
179
218
|
end
|
180
219
|
end
|
181
220
|
|
data/example.json
CHANGED
@@ -4,12 +4,17 @@
|
|
4
4
|
{"apache2":[]},
|
5
5
|
{"apt":
|
6
6
|
[
|
7
|
-
"1.1.
|
8
|
-
"-B testing"
|
7
|
+
"1.1.1"
|
9
8
|
]
|
10
9
|
},
|
11
10
|
{"mysql":[]}
|
12
11
|
],
|
12
|
+
"environments":
|
13
|
+
[
|
14
|
+
{"development":[]},
|
15
|
+
{"qa":[]},
|
16
|
+
{"production":[]}
|
17
|
+
],
|
13
18
|
"roles":
|
14
19
|
[
|
15
20
|
{"base":[]},
|
@@ -25,7 +30,18 @@
|
|
25
30
|
"chuck"
|
26
31
|
]
|
27
32
|
},
|
28
|
-
{"data":
|
33
|
+
{"data":
|
34
|
+
[
|
35
|
+
"*"
|
36
|
+
]
|
37
|
+
},
|
38
|
+
{"passwords":
|
39
|
+
[
|
40
|
+
"secret secret_key",
|
41
|
+
"mysql",
|
42
|
+
"rabbitmq"
|
43
|
+
]
|
44
|
+
}
|
29
45
|
],
|
30
46
|
"nodes":
|
31
47
|
[
|
@@ -35,7 +51,13 @@
|
|
35
51
|
"-i ~/.ssh/mray.pem -x user --sudo -d ubuntu10.04-gems"
|
36
52
|
]
|
37
53
|
},
|
38
|
-
{"
|
54
|
+
{"serverB serverC":
|
55
|
+
[
|
56
|
+
"role[base]",
|
57
|
+
"-i ~/.ssh/mray.pem -x user --sudo -d ubuntu10.04-gems"
|
58
|
+
]
|
59
|
+
},
|
60
|
+
{"ec2 3":
|
39
61
|
[
|
40
62
|
"role[webserver] recipe[mysql::client]",
|
41
63
|
"-S mray -I ~/.ssh/mray.pem -x ubuntu -G default -i ami-a403f7cd -f m1.small"
|
data/example.yml
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
cookbooks:
|
2
2
|
- apache2:
|
3
3
|
- apt:
|
4
|
-
- 1.1.
|
5
|
-
- -B testing
|
4
|
+
- 1.1.1
|
6
5
|
- mysql:
|
7
6
|
|
7
|
+
environments:
|
8
|
+
- development:
|
9
|
+
- qa:
|
10
|
+
- production:
|
11
|
+
|
8
12
|
roles:
|
9
13
|
- base:
|
10
14
|
- monitoring:
|
@@ -16,12 +20,20 @@ data bags:
|
|
16
20
|
- bob
|
17
21
|
- chuck
|
18
22
|
- data:
|
23
|
+
- *
|
24
|
+
- passwords:
|
25
|
+
- secret secret_key
|
26
|
+
- mysql
|
27
|
+
- rabbitmq
|
19
28
|
|
20
29
|
nodes:
|
21
30
|
- serverA:
|
22
31
|
- role[base]
|
23
32
|
- -i ~/.ssh/mray.pem -x user --sudo -d ubuntu10.04-gems
|
24
|
-
-
|
33
|
+
- serverB serverC:
|
34
|
+
- role[base]
|
35
|
+
- -i ~/.ssh/mray.pem -x user --sudo -d ubuntu10.04-gems
|
36
|
+
- ec2 3:
|
25
37
|
- role[webserver] recipe[mysql::client]
|
26
38
|
- -S mray -I ~/.ssh/mray.pem -x ubuntu -G default -i ami-a403f7cd -f m1.small
|
27
39
|
- rackspace 3:
|
data/lib/spiceweasel/version.rb
CHANGED
metadata
CHANGED
@@ -5,9 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
|
10
|
-
version: 0.6.1
|
8
|
+
- 7
|
9
|
+
version: "0.7"
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Matt Ray
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2011-
|
17
|
+
date: 2011-05-04 00:00:00 -05:00
|
19
18
|
default_executable:
|
20
19
|
dependencies: []
|
21
20
|
|