spiceweasel 2.6.0 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. checksums.yaml +6 -14
  2. data/README.md +33 -9
  3. data/bin/spiceweasel +3 -3
  4. data/lib/spiceweasel.rb +3 -2
  5. data/lib/spiceweasel/berksfile.rb +6 -10
  6. data/lib/spiceweasel/cli.rb +174 -129
  7. data/lib/spiceweasel/clusters.rb +31 -23
  8. data/lib/spiceweasel/command.rb +23 -5
  9. data/lib/spiceweasel/command_helper.rb +36 -2
  10. data/lib/spiceweasel/config.rb +4 -3
  11. data/lib/spiceweasel/cookbooks.rb +76 -57
  12. data/lib/spiceweasel/data_bags.rb +100 -64
  13. data/lib/spiceweasel/environments.rb +78 -56
  14. data/lib/spiceweasel/execute.rb +6 -7
  15. data/lib/spiceweasel/extract_local.rb +59 -46
  16. data/lib/spiceweasel/knife.rb +21 -20
  17. data/lib/spiceweasel/log.rb +5 -5
  18. data/lib/spiceweasel/nodes.rb +261 -193
  19. data/lib/spiceweasel/roles.rb +107 -76
  20. data/lib/spiceweasel/version.rb +5 -3
  21. data/test/chef-repo/Berksfile +4 -0
  22. data/test/chef-repo/Berksfile.lock +10 -0
  23. data/test/chef-repo/PASSWORD +1 -0
  24. data/test/chef-repo/cookbooks/abc/CHANGELOG.md +13 -0
  25. data/test/chef-repo/cookbooks/abc/README.md +68 -0
  26. data/test/chef-repo/cookbooks/abc/metadata.rb +7 -0
  27. data/test/chef-repo/cookbooks/abc/recipes/default.rb +8 -0
  28. data/test/chef-repo/cookbooks/def/CHANGELOG.md +13 -0
  29. data/test/chef-repo/cookbooks/def/README.md +68 -0
  30. data/test/chef-repo/cookbooks/def/metadata.rb +7 -0
  31. data/test/chef-repo/cookbooks/def/recipes/default.rb +8 -0
  32. data/test/chef-repo/cookbooks/fail1/README.md +68 -0
  33. data/test/chef-repo/cookbooks/fail1/metadata.rb +9 -0
  34. data/test/chef-repo/cookbooks/fail2/README.md +68 -0
  35. data/test/chef-repo/cookbooks/fail2/metadata.rb +9 -0
  36. data/test/chef-repo/cookbooks/fail3/README.md +68 -0
  37. data/test/chef-repo/cookbooks/fail3/metadata.rb +9 -0
  38. data/test/chef-repo/cookbooks/ghi/CHANGELOG.md +13 -0
  39. data/test/chef-repo/cookbooks/ghi/README.md +68 -0
  40. data/test/chef-repo/cookbooks/ghi/metadata.rb +7 -0
  41. data/test/chef-repo/cookbooks/ghi/recipes/default.rb +8 -0
  42. data/test/chef-repo/cookbooks/jkl/CHANGELOG.md +13 -0
  43. data/test/chef-repo/cookbooks/jkl/README.md +68 -0
  44. data/test/chef-repo/cookbooks/jkl/metadata.rb +10 -0
  45. data/test/chef-repo/cookbooks/jkl/recipes/default.rb +8 -0
  46. data/test/chef-repo/cookbooks/mno/CHANGELOG.md +13 -0
  47. data/test/chef-repo/cookbooks/mno/README.md +68 -0
  48. data/test/chef-repo/cookbooks/mno/metadata.rb +9 -0
  49. data/test/chef-repo/cookbooks/mno/recipes/default.rb +8 -0
  50. data/test/chef-repo/data_bags/junk/README +1 -0
  51. data/test/chef-repo/data_bags/junk/abc.json +4 -0
  52. data/test/chef-repo/data_bags/junk/ade.json +4 -0
  53. data/test/chef-repo/data_bags/junk/afg.json +4 -0
  54. data/test/chef-repo/data_bags/junk/bcd.json +4 -0
  55. data/test/chef-repo/data_bags/junk/sub1/cde1.json +4 -0
  56. data/test/chef-repo/data_bags/junk/sub1/cde2.json +4 -0
  57. data/test/chef-repo/data_bags/junk/sub2/def1.json +4 -0
  58. data/test/chef-repo/data_bags/junk/sub2/def2.json +4 -0
  59. data/test/chef-repo/data_bags/users/README +1 -0
  60. data/test/chef-repo/data_bags/users/badjson.json +8 -0
  61. data/test/chef-repo/data_bags/users/failname.json +8 -0
  62. data/test/chef-repo/data_bags/users/mray.json +8 -0
  63. data/test/chef-repo/data_bags/users/ubuntu.json +8 -0
  64. data/test/chef-repo/environments/development.rb +2 -0
  65. data/test/chef-repo/environments/fail2.rb +8 -0
  66. data/test/chef-repo/environments/fail3.rb +2 -0
  67. data/test/chef-repo/environments/production-blue.json +177 -0
  68. data/test/chef-repo/environments/production-green.json +177 -0
  69. data/test/chef-repo/environments/production-red.json +177 -0
  70. data/test/chef-repo/environments/qa.rb +2 -0
  71. data/test/chef-repo/environments/sub/efg1.rb +2 -0
  72. data/test/chef-repo/environments/sub/efg2.json +177 -0
  73. data/test/chef-repo/fail-cookbook1.yml +19 -0
  74. data/test/chef-repo/fail-cookbook2.yml +21 -0
  75. data/test/chef-repo/fail-cookbook3.yml +37 -0
  76. data/test/chef-repo/fail-cookbook4.yml +37 -0
  77. data/test/chef-repo/fail-cookbook5.yml +10 -0
  78. data/test/chef-repo/fail-cookbook6.yml +9 -0
  79. data/test/chef-repo/fail-db1.yml +12 -0
  80. data/test/chef-repo/fail-db2.yml +10 -0
  81. data/test/chef-repo/fail-db3.yml +10 -0
  82. data/test/chef-repo/fail-db4.yml +10 -0
  83. data/test/chef-repo/fail-env1.yml +27 -0
  84. data/test/chef-repo/fail-env2.yml +27 -0
  85. data/test/chef-repo/fail-env3.yml +28 -0
  86. data/test/chef-repo/fail-env4.yml +28 -0
  87. data/test/chef-repo/fail-roles1.yml +22 -0
  88. data/test/chef-repo/fail-roles2.yml +21 -0
  89. data/test/chef-repo/fail-roles3.yml +23 -0
  90. data/test/chef-repo/fail-roles4.yml +23 -0
  91. data/test/chef-repo/fail-roles5.yml +23 -0
  92. data/test/chef-repo/infrastructure.yml +43 -0
  93. data/test/chef-repo/nodes/boxy.lab.atx.json +1756 -0
  94. data/test/chef-repo/nodes/guenter.home.atx.json +2503 -0
  95. data/test/chef-repo/roles/README +1 -0
  96. data/test/chef-repo/roles/base.rb +18 -0
  97. data/test/chef-repo/roles/base2.rb +16 -0
  98. data/test/chef-repo/roles/base3.rb +17 -0
  99. data/test/chef-repo/roles/base4.rb +15 -0
  100. data/test/chef-repo/roles/fail1.rb +8 -0
  101. data/test/chef-repo/roles/fail2.rb +5 -0
  102. data/test/chef-repo/roles/fail3.rb +5 -0
  103. data/test/chef-repo/roles/sub/bw2.json +21 -0
  104. data/test/chef-repo/roles/sub/bwi1.json +20 -0
  105. data/test/chef-repo/roles/tc.rb +13 -0
  106. data/test/examples/cluster-file-example.yml +14 -0
  107. data/test/examples/example-cluster.yml +8 -0
  108. data/test/examples/example.json +127 -0
  109. data/test/examples/example.rb +128 -0
  110. data/test/examples/example.yml +67 -0
  111. data/test/examples/google-example.yml +33 -0
  112. data/test/examples/joyent-vsphere-example.yml +15 -0
  113. data/test/examples/knife.yml +7 -0
  114. data/test/examples/kvm-example.yml +22 -0
  115. data/test/examples/node-example.yml +23 -0
  116. data/test/examples/php-quick-start.yml +83 -0
  117. data/test/extract-repo/Berksfile +4 -0
  118. data/test/extract-repo/Berksfile.lock +10 -0
  119. data/test/extract-repo/cookbooks/abc/CHANGELOG.md +13 -0
  120. data/test/extract-repo/cookbooks/abc/README.md +68 -0
  121. data/test/extract-repo/cookbooks/abc/metadata.rb +7 -0
  122. data/test/extract-repo/cookbooks/abc/recipes/default.rb +8 -0
  123. data/test/extract-repo/cookbooks/def/CHANGELOG.md +13 -0
  124. data/test/extract-repo/cookbooks/def/README.md +68 -0
  125. data/test/extract-repo/cookbooks/def/metadata.rb +7 -0
  126. data/test/extract-repo/cookbooks/def/recipes/default.rb +8 -0
  127. data/test/extract-repo/cookbooks/ghi/CHANGELOG.md +13 -0
  128. data/test/extract-repo/cookbooks/ghi/README.md +68 -0
  129. data/test/extract-repo/cookbooks/ghi/metadata.rb +7 -0
  130. data/test/extract-repo/cookbooks/ghi/recipes/default.rb +8 -0
  131. data/test/extract-repo/cookbooks/jkl/CHANGELOG.md +13 -0
  132. data/test/extract-repo/cookbooks/jkl/README.md +68 -0
  133. data/test/extract-repo/cookbooks/jkl/metadata.rb +10 -0
  134. data/test/extract-repo/cookbooks/jkl/recipes/default.rb +8 -0
  135. data/test/extract-repo/cookbooks/mno/CHANGELOG.md +13 -0
  136. data/test/extract-repo/cookbooks/mno/README.md +68 -0
  137. data/test/extract-repo/cookbooks/mno/metadata.rb +9 -0
  138. data/test/extract-repo/cookbooks/mno/recipes/default.rb +8 -0
  139. data/test/extract-repo/data_bags/junk/README +1 -0
  140. data/test/extract-repo/data_bags/junk/abc.json +4 -0
  141. data/test/extract-repo/data_bags/junk/ade.json +4 -0
  142. data/test/extract-repo/data_bags/junk/afg.json +4 -0
  143. data/test/extract-repo/data_bags/junk/bcd.json +4 -0
  144. data/test/extract-repo/data_bags/junk/sub1/cde1.json +4 -0
  145. data/test/extract-repo/data_bags/junk/sub1/cde2.json +4 -0
  146. data/test/extract-repo/data_bags/junk/sub2/def1.json +4 -0
  147. data/test/extract-repo/data_bags/junk/sub2/def2.json +4 -0
  148. data/test/extract-repo/data_bags/users/README +1 -0
  149. data/test/extract-repo/data_bags/users/mray.json +8 -0
  150. data/test/extract-repo/data_bags/users/ubuntu.json +8 -0
  151. data/test/extract-repo/environments/development.rb +2 -0
  152. data/test/extract-repo/environments/production-blue.json +177 -0
  153. data/test/extract-repo/environments/production-green.json +177 -0
  154. data/test/extract-repo/environments/production-red.json +177 -0
  155. data/test/extract-repo/environments/qa.rb +2 -0
  156. data/test/extract-repo/environments/sub/efg1.rb +2 -0
  157. data/test/extract-repo/environments/sub/efg2.json +177 -0
  158. data/test/extract-repo/nodes/boxy.lab.atx.json +1756 -0
  159. data/test/extract-repo/nodes/guenter.home.atx.json +2503 -0
  160. data/test/extract-repo/roles/README +1 -0
  161. data/test/extract-repo/roles/base.rb +18 -0
  162. data/test/extract-repo/roles/base2.rb +16 -0
  163. data/test/extract-repo/roles/base3.rb +17 -0
  164. data/test/extract-repo/roles/base4.rb +16 -0
  165. data/test/extract-repo/roles/sub/bw2.json +21 -0
  166. data/test/extract-repo/roles/sub/bwi1.json +20 -0
  167. data/test/extract-repo/roles/tc.rb +13 -0
  168. data/test/extract-repo2/cookbooks/README.md +1 -0
  169. data/test/extract-repo2/data_bags/README.md +1 -0
  170. data/test/extract-repo2/environments/README.md +1 -0
  171. data/test/extract-repo2/nodes/README.md +1 -0
  172. data/test/extract-repo2/roles/README.md +1 -0
  173. metadata +357 -67
  174. data/spec/bin/chef_client_spec.rb +0 -72
  175. data/spec/bin/google_spec.rb +0 -105
  176. data/spec/bin/joyent-vsphere_spec.rb +0 -25
  177. data/spec/bin/knife_spec.rb +0 -18
  178. data/spec/bin/kvm_spec.rb +0 -29
  179. data/spec/bin/node_spec.rb +0 -108
  180. data/spec/bin/spiceweasel_spec.rb +0 -136
@@ -0,0 +1 @@
1
+ README FOR SURE!
@@ -0,0 +1,18 @@
1
+ name "base"
2
+ description "Default run_list for testing"
3
+ run_list(
4
+ "recipe[abc]",
5
+ "recipe[def]",
6
+ "recipe[jkl]",
7
+ "recipe[mno]"
8
+ )
9
+
10
+ default_attributes(
11
+ "authorization" => {
12
+ "sudo" => {
13
+ "groups" => ["admin", "wheel", "sysadmin"],
14
+ "users" => ["mray"],
15
+ "passwordless" => true
16
+ }
17
+ }
18
+ )
@@ -0,0 +1,16 @@
1
+ name "base2"
2
+ description "Default run_list 2 for testing"
3
+ run_list(
4
+ "recipe[abc]",
5
+ "recipe[def::other]"
6
+ )
7
+
8
+ default_attributes(
9
+ "authorization" => {
10
+ "sudo" => {
11
+ "groups" => ["admin", "wheel", "sysadmin"],
12
+ "users" => ["mray"],
13
+ "passwordless" => true
14
+ }
15
+ }
16
+ )
@@ -0,0 +1,17 @@
1
+ name "base3"
2
+ description "Default run_list 3 for testing"
3
+ run_list(
4
+ "recipe[def]",
5
+ "recipe[jkl]",
6
+ "recipe[mno]"
7
+ )
8
+
9
+ default_attributes(
10
+ "authorization" => {
11
+ "sudo" => {
12
+ "groups" => ["admin", "wheel", "sysadmin"],
13
+ "users" => ["mray"],
14
+ "passwordless" => true
15
+ }
16
+ }
17
+ )
@@ -0,0 +1,15 @@
1
+ name "base4"
2
+ description "Default run_list 4 for testing"
3
+ run_list(
4
+ "recipe[mno]"
5
+ )
6
+
7
+ default_attributes(
8
+ "authorization" => {
9
+ "sudo" => {
10
+ "groups" => ["admin", "wheel", "sysadmin"],
11
+ "users" => ["mray"],
12
+ "passwordless" => true
13
+ }
14
+ }
15
+ )
@@ -0,0 +1,8 @@
1
+ name "base"
2
+ description "Default run_list for testing"
3
+ run_list(
4
+ "recipe[abc]",
5
+ "recipe[def]",
6
+ "recipe[jkl]"
7
+ "recipe[mno]"
8
+ )
@@ -0,0 +1,5 @@
1
+ name "fail2"
2
+ description "Default run_list for testing"
3
+ run_list(
4
+ "recipe[XXX]"
5
+ )
@@ -0,0 +1,5 @@
1
+ name "fail2"
2
+ description "mismatched name"
3
+ run_list(
4
+ "recipe[XXX]"
5
+ )
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "bw2",
3
+ "default_attributes": {
4
+ "dns": {
5
+ "public_forward_zone": "bw2.attcompute.com"
6
+ }
7
+ },
8
+ "json_class": "Chef::Role",
9
+ "env_run_lists": {
10
+ },
11
+ "run_list": [
12
+ "role[base2]"
13
+ ],
14
+ "description": "A role for BW2 nodes.",
15
+ "chef_type": "role",
16
+ "override_attributes": {
17
+ "interfaces": {
18
+ "dns-nameservers": [ "135.207.177.11", "135.207.164.11"]
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "bwi1",
3
+ "default_attributes": {
4
+ "dns": {
5
+ "public_forward_zone": "bwi1.attcompute.com"
6
+ }
7
+ },
8
+ "json_class": "Chef::Role",
9
+ "env_run_lists": {
10
+ },
11
+ "run_list": [
12
+ ],
13
+ "description": "A role for BWI1 nodes.",
14
+ "chef_type": "role",
15
+ "override_attributes": {
16
+ "interfaces": {
17
+ "dns-nameservers": [ "135.207.177.11", "135.207.164.11"]
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,13 @@
1
+ name "tc"
2
+ description "test app"
3
+ run_list(
4
+ "role[base]",
5
+ "recipe[def]",
6
+ "recipe[jkl]"
7
+ )
8
+
9
+ default_attributes(
10
+ "tomcat" => {
11
+ "java_options" => "-Xmx256M -Djava.awt.headless=true"
12
+ }
13
+ )
@@ -0,0 +1,14 @@
1
+ clusters:
2
+ - qa:
3
+ - serverB serverC:
4
+ run_list: role[base] role[webserver]
5
+ options: -i ~/.ssh/mray.pem -x user --sudo
6
+ - windows_winrm winboxA:
7
+ run_list: role[base],role[iisserver]
8
+ options: -x Administrator -P 'super_secret_password'
9
+ - windows_ssh winboxB winboxC:
10
+ run_list: role[base],role[iisserver]
11
+ options: -x Administrator -P 'super_secret_password'
12
+ - kvm 10:
13
+ run_list: role[webserver] recipe[mysql::client]
14
+ options: --template-file ~/.chef/bootstrap/ubuntu11.10-gems.erb --vm-disk /path-to/ubuntu1110_x64.qcow2 --vm-name knife-kvm-test-ubuntu --ssh-user ubuntu --ssh-password ubuntu --pool default --kvm-host my-test-host --kvm-user root --kvm-password secret
@@ -0,0 +1,8 @@
1
+ clusters:
2
+ - mycluster:
3
+ - ec2 1:
4
+ run_list: role[mysql]
5
+ options: -S mray -i ~/.ssh/mray.pem -x ubuntu -I ami-8af0f326 -f m1.medium
6
+ - ec2 3:
7
+ run_list: role[webserver] recipe[mysql::client]
8
+ options: -S mray -i ~/.ssh/mray.pem -x ubuntu -I ami-7000f019 -f m1.small
@@ -0,0 +1,127 @@
1
+ {
2
+ "cookbooks":
3
+ [
4
+ {"apache2":{}},
5
+ {"apt":{"version":"1.2.0","options":"--freeze"}},
6
+ {"mysql":{}},
7
+ {"ntp":{}}
8
+ ],
9
+ "environments":
10
+ [
11
+ {"development":{}},
12
+ {"qa":{}},
13
+ {"production":{}}
14
+ ],
15
+ "roles":
16
+ [
17
+ {"base":{}},
18
+ {"iisserver":{}},
19
+ {"monitoring":{}},
20
+ {"webserver":{}}
21
+ ],
22
+ "data bags":
23
+ [
24
+ {"users":
25
+ {"items":
26
+ [
27
+ "alice",
28
+ "bob",
29
+ "chuck"
30
+ ]
31
+ }
32
+ },
33
+ {"data":
34
+ {"items":
35
+ [
36
+ "*"
37
+ ]
38
+ }
39
+ },
40
+ {"passwords":
41
+ {"secret": "secret_key",
42
+ "items":
43
+ [
44
+ "mysql",
45
+ "rabbitmq"
46
+ ]
47
+ }
48
+ }
49
+ ],
50
+ "options": "--template my_custom_template",
51
+ "nodes":
52
+ [
53
+ {"serverA":
54
+ {
55
+ "run_list": "role[base]",
56
+ "options": "--identity-file ~/.ssh/mray.pem --ssh-user user --sudo --no-host-key-verify --ssh-port 22"
57
+ }
58
+ },
59
+ {"serverB serverC":
60
+ {
61
+ "run_list": "role[base]",
62
+ "options": "-E development -i ~/.ssh/mray.pem -x user --sudo"
63
+ }
64
+ },
65
+ {"rackspace 11":
66
+ {
67
+ "run_list": "recipe[mysql],role[monitoring]",
68
+ "options": "--image 49 -E qa --flavor 2 -N db{{n}}"
69
+ }
70
+ },
71
+ {"windows_winrm winboxA":
72
+ {
73
+ "run_list": "role[base],role[iisserver]",
74
+ "options": "-x Administrator -P 'super_secret_password'"
75
+ }
76
+ },
77
+ {"windows_ssh winboxB winboxC":
78
+ {
79
+ "run_list": "role[base],role[iisserver]",
80
+ "options": "-x Administrator -P 'super_secret_password'"
81
+ }
82
+ }
83
+ ],
84
+ "clusters":
85
+ [
86
+ {"amazon":
87
+ [
88
+ {"ec2 1":
89
+ {
90
+ "run_list": "role[mysql]",
91
+ "options": "-S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-8af0f326 -f m1.medium"
92
+ }
93
+ },
94
+ {"ec2 3":
95
+ {
96
+ "run_list": "role[webserver] recipe[mysql::client]",
97
+ "options": "-S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-7000f019 -f m1.small"
98
+ }
99
+ }
100
+ ]
101
+ }
102
+ ],
103
+ "knife":
104
+ [
105
+ {"ssh":
106
+ [
107
+ "'role:monitoring' 'sudo chef-client' -x user"
108
+ ]
109
+ },
110
+ {"rackspace server delete":
111
+ [
112
+ "-y --node-name db3 --purge"
113
+ ]
114
+ },
115
+ {"vsphere":
116
+ [
117
+ "vm clone --bootstrap --template 'abc' my-new-webserver1",
118
+ "vm clone --bootstrap --template 'def' my-new-webserver2"
119
+ ]
120
+ },
121
+ {"vsphere vm clone":
122
+ [
123
+ "--bootstrap --template 'ghi' my-new-webserver3"
124
+ ]
125
+ }
126
+ ]
127
+ }
@@ -0,0 +1,128 @@
1
+ # encoding: UTF-8
2
+ {
3
+ 'cookbooks' =>
4
+ [
5
+ { 'apache2' => {} },
6
+ { 'apt' => { 'version' => '1.2.0', 'options' => '--freeze' } },
7
+ { 'mysql' => {} },
8
+ { 'ntp' => {} }
9
+ ],
10
+ 'environments' =>
11
+ [
12
+ { 'development' => {} },
13
+ { 'qa' => {} },
14
+ { 'production' => {} }
15
+ ],
16
+ 'roles' =>
17
+ [
18
+ { 'base' => {} },
19
+ { 'iisserver' => {} },
20
+ { 'monitoring' => {} },
21
+ { 'webserver' => {} }
22
+ ],
23
+ 'data bags' =>
24
+ [
25
+ { 'users' =>
26
+ { 'items' =>
27
+ [
28
+ 'alice',
29
+ 'bob',
30
+ 'chuck'
31
+ ]
32
+ }
33
+ },
34
+ { 'data' =>
35
+ { 'items' =>
36
+ [
37
+ '*'
38
+ ]
39
+ }
40
+ },
41
+ { 'passwords' =>
42
+ { 'secret' => 'secret_key',
43
+ 'items' =>
44
+ [
45
+ 'mysql',
46
+ 'rabbitmq'
47
+ ]
48
+ }
49
+ }
50
+ ],
51
+ 'options' => '--template my_custom_template',
52
+ 'nodes' =>
53
+ [
54
+ { 'serverA' =>
55
+ {
56
+ 'run_list' => 'role[base]',
57
+ 'options' => '--identity-file ~/.ssh/mray.pem --ssh-user user --sudo --no-host-key-verify --ssh-port 22'
58
+ }
59
+ },
60
+ { 'serverB serverC' =>
61
+ {
62
+ 'run_list' => 'role[base]',
63
+ 'options' => '-E development -i ~/.ssh/mray.pem -x user --sudo'
64
+ }
65
+ },
66
+ { 'rackspace 11' =>
67
+ {
68
+ 'run_list' => 'recipe[mysql],role[monitoring]',
69
+ 'options' => '--image 49 -E qa --flavor 2 -N db{{n}}'
70
+ }
71
+ },
72
+ { 'windows_winrm winboxA' =>
73
+ {
74
+ 'run_list' => 'role[base],role[iisserver]',
75
+ 'options' => "-x Administrator -P 'super_secret_password'"
76
+ }
77
+ },
78
+ { 'windows_ssh winboxB winboxC' =>
79
+ {
80
+ 'run_list' => 'role[base],role[iisserver]',
81
+ 'options' => "-x Administrator -P 'super_secret_password'"
82
+ }
83
+ }
84
+ ],
85
+ 'clusters' =>
86
+ [
87
+ { 'amazon' =>
88
+ [
89
+ { 'ec2 1' =>
90
+ {
91
+ 'run_list' => 'role[mysql]',
92
+ 'options' => '-S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-8af0f326 -f m1.medium'
93
+ }
94
+ },
95
+ { 'ec2 3' =>
96
+ {
97
+ 'run_list' => 'role[webserver],recipe[mysql::client]',
98
+ 'options' => '-S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-7000f019 -f m1.small'
99
+ }
100
+ }
101
+ ]
102
+ }
103
+ ],
104
+ 'knife' =>
105
+ [
106
+ { 'ssh' =>
107
+ [
108
+ "'role:monitoring' 'sudo chef-client' -x user"
109
+ ]
110
+ },
111
+ { 'rackspace server delete' =>
112
+ [
113
+ '-y --node-name db3 --purge'
114
+ ]
115
+ },
116
+ { 'vsphere' =>
117
+ [
118
+ "vm clone --bootstrap --template 'abc' my-new-webserver1",
119
+ "vm clone --bootstrap --template 'def' my-new-webserver2"
120
+ ]
121
+ },
122
+ { 'vsphere vm clone' =>
123
+ [
124
+ "--bootstrap --template 'ghi' my-new-webserver3"
125
+ ]
126
+ }
127
+ ]
128
+ }
@@ -0,0 +1,67 @@
1
+ cookbooks:
2
+ - apache2:
3
+ - apt:
4
+ version: 1.2.0
5
+ options: --freeze
6
+ - mysql:
7
+ - ntp:
8
+ environments:
9
+ - development:
10
+ - qa:
11
+ - production:
12
+ roles:
13
+ - base:
14
+ - iisserver:
15
+ - monitoring:
16
+ - webserver:
17
+ data bags:
18
+ - users:
19
+ items:
20
+ - alice
21
+ - bob
22
+ - chuck
23
+ - data:
24
+ items:
25
+ - "*"
26
+ - passwords:
27
+ secret: secret_key
28
+ items:
29
+ - mysql
30
+ - rabbitmq
31
+ options: --template my_custom_template
32
+ nodes:
33
+ - serverA:
34
+ run_list: role[base]
35
+ options: --identity-file ~/.ssh/mray.pem --ssh-user user --sudo --no-host-key-verify --ssh-port 22
36
+ - serverB serverC:
37
+ run_list: role[base]
38
+ options: -E development -i ~/.ssh/mray.pem -x user --sudo
39
+ - rackspace 11:
40
+ run_list: recipe[mysql],role[monitoring]
41
+ options: --image 49 -E qa --flavor 2 -N db{{n}}
42
+ - windows_winrm winboxA:
43
+ run_list: role[base],role[iisserver]
44
+ options: -x Administrator -P 'super_secret_password'
45
+ - windows_ssh winboxB winboxC:
46
+ run_list: role[base],role[iisserver]
47
+ options: -x Administrator -P 'super_secret_password'
48
+ clusters:
49
+ - amazon:
50
+ - ec2 1:
51
+ run_list: role[mysql]
52
+ options: -S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-8af0f326 -f m1.medium
53
+ - ec2 3:
54
+ run_list: >-
55
+ role[webserver]
56
+ recipe[mysql::client]
57
+ options: -S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-7000f019 -f m1.small
58
+ knife:
59
+ - ssh:
60
+ - "'role:monitoring' 'sudo chef-client' -x user"
61
+ - rackspace server delete:
62
+ - -y --node-name db3 --purge
63
+ - vsphere:
64
+ - vm clone --bootstrap --template 'abc' my-new-webserver1
65
+ - vm clone --bootstrap --template 'def' my-new-webserver2
66
+ - vsphere vm clone:
67
+ - --bootstrap --template 'ghi' my-new-webserver3