spiceweasel 2.6.0 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/README.md +33 -9
- data/bin/spiceweasel +3 -3
- data/lib/spiceweasel.rb +3 -2
- data/lib/spiceweasel/berksfile.rb +6 -10
- data/lib/spiceweasel/cli.rb +174 -129
- data/lib/spiceweasel/clusters.rb +31 -23
- data/lib/spiceweasel/command.rb +23 -5
- data/lib/spiceweasel/command_helper.rb +36 -2
- data/lib/spiceweasel/config.rb +4 -3
- data/lib/spiceweasel/cookbooks.rb +76 -57
- data/lib/spiceweasel/data_bags.rb +100 -64
- data/lib/spiceweasel/environments.rb +78 -56
- data/lib/spiceweasel/execute.rb +6 -7
- data/lib/spiceweasel/extract_local.rb +59 -46
- data/lib/spiceweasel/knife.rb +21 -20
- data/lib/spiceweasel/log.rb +5 -5
- data/lib/spiceweasel/nodes.rb +261 -193
- data/lib/spiceweasel/roles.rb +107 -76
- data/lib/spiceweasel/version.rb +5 -3
- data/test/chef-repo/Berksfile +4 -0
- data/test/chef-repo/Berksfile.lock +10 -0
- data/test/chef-repo/PASSWORD +1 -0
- data/test/chef-repo/cookbooks/abc/CHANGELOG.md +13 -0
- data/test/chef-repo/cookbooks/abc/README.md +68 -0
- data/test/chef-repo/cookbooks/abc/metadata.rb +7 -0
- data/test/chef-repo/cookbooks/abc/recipes/default.rb +8 -0
- data/test/chef-repo/cookbooks/def/CHANGELOG.md +13 -0
- data/test/chef-repo/cookbooks/def/README.md +68 -0
- data/test/chef-repo/cookbooks/def/metadata.rb +7 -0
- data/test/chef-repo/cookbooks/def/recipes/default.rb +8 -0
- data/test/chef-repo/cookbooks/fail1/README.md +68 -0
- data/test/chef-repo/cookbooks/fail1/metadata.rb +9 -0
- data/test/chef-repo/cookbooks/fail2/README.md +68 -0
- data/test/chef-repo/cookbooks/fail2/metadata.rb +9 -0
- data/test/chef-repo/cookbooks/fail3/README.md +68 -0
- data/test/chef-repo/cookbooks/fail3/metadata.rb +9 -0
- data/test/chef-repo/cookbooks/ghi/CHANGELOG.md +13 -0
- data/test/chef-repo/cookbooks/ghi/README.md +68 -0
- data/test/chef-repo/cookbooks/ghi/metadata.rb +7 -0
- data/test/chef-repo/cookbooks/ghi/recipes/default.rb +8 -0
- data/test/chef-repo/cookbooks/jkl/CHANGELOG.md +13 -0
- data/test/chef-repo/cookbooks/jkl/README.md +68 -0
- data/test/chef-repo/cookbooks/jkl/metadata.rb +10 -0
- data/test/chef-repo/cookbooks/jkl/recipes/default.rb +8 -0
- data/test/chef-repo/cookbooks/mno/CHANGELOG.md +13 -0
- data/test/chef-repo/cookbooks/mno/README.md +68 -0
- data/test/chef-repo/cookbooks/mno/metadata.rb +9 -0
- data/test/chef-repo/cookbooks/mno/recipes/default.rb +8 -0
- data/test/chef-repo/data_bags/junk/README +1 -0
- data/test/chef-repo/data_bags/junk/abc.json +4 -0
- data/test/chef-repo/data_bags/junk/ade.json +4 -0
- data/test/chef-repo/data_bags/junk/afg.json +4 -0
- data/test/chef-repo/data_bags/junk/bcd.json +4 -0
- data/test/chef-repo/data_bags/junk/sub1/cde1.json +4 -0
- data/test/chef-repo/data_bags/junk/sub1/cde2.json +4 -0
- data/test/chef-repo/data_bags/junk/sub2/def1.json +4 -0
- data/test/chef-repo/data_bags/junk/sub2/def2.json +4 -0
- data/test/chef-repo/data_bags/users/README +1 -0
- data/test/chef-repo/data_bags/users/badjson.json +8 -0
- data/test/chef-repo/data_bags/users/failname.json +8 -0
- data/test/chef-repo/data_bags/users/mray.json +8 -0
- data/test/chef-repo/data_bags/users/ubuntu.json +8 -0
- data/test/chef-repo/environments/development.rb +2 -0
- data/test/chef-repo/environments/fail2.rb +8 -0
- data/test/chef-repo/environments/fail3.rb +2 -0
- data/test/chef-repo/environments/production-blue.json +177 -0
- data/test/chef-repo/environments/production-green.json +177 -0
- data/test/chef-repo/environments/production-red.json +177 -0
- data/test/chef-repo/environments/qa.rb +2 -0
- data/test/chef-repo/environments/sub/efg1.rb +2 -0
- data/test/chef-repo/environments/sub/efg2.json +177 -0
- data/test/chef-repo/fail-cookbook1.yml +19 -0
- data/test/chef-repo/fail-cookbook2.yml +21 -0
- data/test/chef-repo/fail-cookbook3.yml +37 -0
- data/test/chef-repo/fail-cookbook4.yml +37 -0
- data/test/chef-repo/fail-cookbook5.yml +10 -0
- data/test/chef-repo/fail-cookbook6.yml +9 -0
- data/test/chef-repo/fail-db1.yml +12 -0
- data/test/chef-repo/fail-db2.yml +10 -0
- data/test/chef-repo/fail-db3.yml +10 -0
- data/test/chef-repo/fail-db4.yml +10 -0
- data/test/chef-repo/fail-env1.yml +27 -0
- data/test/chef-repo/fail-env2.yml +27 -0
- data/test/chef-repo/fail-env3.yml +28 -0
- data/test/chef-repo/fail-env4.yml +28 -0
- data/test/chef-repo/fail-roles1.yml +22 -0
- data/test/chef-repo/fail-roles2.yml +21 -0
- data/test/chef-repo/fail-roles3.yml +23 -0
- data/test/chef-repo/fail-roles4.yml +23 -0
- data/test/chef-repo/fail-roles5.yml +23 -0
- data/test/chef-repo/infrastructure.yml +43 -0
- data/test/chef-repo/nodes/boxy.lab.atx.json +1756 -0
- data/test/chef-repo/nodes/guenter.home.atx.json +2503 -0
- data/test/chef-repo/roles/README +1 -0
- data/test/chef-repo/roles/base.rb +18 -0
- data/test/chef-repo/roles/base2.rb +16 -0
- data/test/chef-repo/roles/base3.rb +17 -0
- data/test/chef-repo/roles/base4.rb +15 -0
- data/test/chef-repo/roles/fail1.rb +8 -0
- data/test/chef-repo/roles/fail2.rb +5 -0
- data/test/chef-repo/roles/fail3.rb +5 -0
- data/test/chef-repo/roles/sub/bw2.json +21 -0
- data/test/chef-repo/roles/sub/bwi1.json +20 -0
- data/test/chef-repo/roles/tc.rb +13 -0
- data/test/examples/cluster-file-example.yml +14 -0
- data/test/examples/example-cluster.yml +8 -0
- data/test/examples/example.json +127 -0
- data/test/examples/example.rb +128 -0
- data/test/examples/example.yml +67 -0
- data/test/examples/google-example.yml +33 -0
- data/test/examples/joyent-vsphere-example.yml +15 -0
- data/test/examples/knife.yml +7 -0
- data/test/examples/kvm-example.yml +22 -0
- data/test/examples/node-example.yml +23 -0
- data/test/examples/php-quick-start.yml +83 -0
- data/test/extract-repo/Berksfile +4 -0
- data/test/extract-repo/Berksfile.lock +10 -0
- data/test/extract-repo/cookbooks/abc/CHANGELOG.md +13 -0
- data/test/extract-repo/cookbooks/abc/README.md +68 -0
- data/test/extract-repo/cookbooks/abc/metadata.rb +7 -0
- data/test/extract-repo/cookbooks/abc/recipes/default.rb +8 -0
- data/test/extract-repo/cookbooks/def/CHANGELOG.md +13 -0
- data/test/extract-repo/cookbooks/def/README.md +68 -0
- data/test/extract-repo/cookbooks/def/metadata.rb +7 -0
- data/test/extract-repo/cookbooks/def/recipes/default.rb +8 -0
- data/test/extract-repo/cookbooks/ghi/CHANGELOG.md +13 -0
- data/test/extract-repo/cookbooks/ghi/README.md +68 -0
- data/test/extract-repo/cookbooks/ghi/metadata.rb +7 -0
- data/test/extract-repo/cookbooks/ghi/recipes/default.rb +8 -0
- data/test/extract-repo/cookbooks/jkl/CHANGELOG.md +13 -0
- data/test/extract-repo/cookbooks/jkl/README.md +68 -0
- data/test/extract-repo/cookbooks/jkl/metadata.rb +10 -0
- data/test/extract-repo/cookbooks/jkl/recipes/default.rb +8 -0
- data/test/extract-repo/cookbooks/mno/CHANGELOG.md +13 -0
- data/test/extract-repo/cookbooks/mno/README.md +68 -0
- data/test/extract-repo/cookbooks/mno/metadata.rb +9 -0
- data/test/extract-repo/cookbooks/mno/recipes/default.rb +8 -0
- data/test/extract-repo/data_bags/junk/README +1 -0
- data/test/extract-repo/data_bags/junk/abc.json +4 -0
- data/test/extract-repo/data_bags/junk/ade.json +4 -0
- data/test/extract-repo/data_bags/junk/afg.json +4 -0
- data/test/extract-repo/data_bags/junk/bcd.json +4 -0
- data/test/extract-repo/data_bags/junk/sub1/cde1.json +4 -0
- data/test/extract-repo/data_bags/junk/sub1/cde2.json +4 -0
- data/test/extract-repo/data_bags/junk/sub2/def1.json +4 -0
- data/test/extract-repo/data_bags/junk/sub2/def2.json +4 -0
- data/test/extract-repo/data_bags/users/README +1 -0
- data/test/extract-repo/data_bags/users/mray.json +8 -0
- data/test/extract-repo/data_bags/users/ubuntu.json +8 -0
- data/test/extract-repo/environments/development.rb +2 -0
- data/test/extract-repo/environments/production-blue.json +177 -0
- data/test/extract-repo/environments/production-green.json +177 -0
- data/test/extract-repo/environments/production-red.json +177 -0
- data/test/extract-repo/environments/qa.rb +2 -0
- data/test/extract-repo/environments/sub/efg1.rb +2 -0
- data/test/extract-repo/environments/sub/efg2.json +177 -0
- data/test/extract-repo/nodes/boxy.lab.atx.json +1756 -0
- data/test/extract-repo/nodes/guenter.home.atx.json +2503 -0
- data/test/extract-repo/roles/README +1 -0
- data/test/extract-repo/roles/base.rb +18 -0
- data/test/extract-repo/roles/base2.rb +16 -0
- data/test/extract-repo/roles/base3.rb +17 -0
- data/test/extract-repo/roles/base4.rb +16 -0
- data/test/extract-repo/roles/sub/bw2.json +21 -0
- data/test/extract-repo/roles/sub/bwi1.json +20 -0
- data/test/extract-repo/roles/tc.rb +13 -0
- data/test/extract-repo2/cookbooks/README.md +1 -0
- data/test/extract-repo2/data_bags/README.md +1 -0
- data/test/extract-repo2/environments/README.md +1 -0
- data/test/extract-repo2/nodes/README.md +1 -0
- data/test/extract-repo2/roles/README.md +1 -0
- metadata +357 -67
- data/spec/bin/chef_client_spec.rb +0 -72
- data/spec/bin/google_spec.rb +0 -105
- data/spec/bin/joyent-vsphere_spec.rb +0 -25
- data/spec/bin/knife_spec.rb +0 -18
- data/spec/bin/kvm_spec.rb +0 -29
- data/spec/bin/node_spec.rb +0 -108
- data/spec/bin/spiceweasel_spec.rb +0 -136
@@ -1,72 +0,0 @@
|
|
1
|
-
describe 'testing 2.5 --chef-client' do
|
2
|
-
before(:each) do
|
3
|
-
@expected_output = <<-OUTPUT
|
4
|
-
knife ssh 'name:serverA and role:base' 'sudo chef-client' -i ~/.ssh/mray.pem -x user --no-host-key-verify -p 22
|
5
|
-
knife ssh 'name:serverB and chef_environment:development and role:base' 'sudo chef-client' -i ~/.ssh/mray.pem -x user
|
6
|
-
knife ssh 'name:serverC and chef_environment:development and role:base' 'sudo chef-client' -i ~/.ssh/mray.pem -x user
|
7
|
-
knife ssh 'name:db* and chef_environment:qa and recipe:mysql and role:monitoring' 'chef-client'
|
8
|
-
knife winrm 'name:winboxA and role:base and role:iisserver' 'chef-client' -x Administrator -P 'super_secret_password'
|
9
|
-
knife ssh 'name:winboxB and role:base and role:iisserver' 'chef-client' -x Administrator -P 'super_secret_password'
|
10
|
-
knife ssh 'name:winboxC and role:base and role:iisserver' 'chef-client' -x Administrator -P 'super_secret_password'
|
11
|
-
knife ssh 'chef_environment:amazon and role:mysql' 'sudo chef-client' -i ~/.ssh/mray.pem -x ubuntu -G default
|
12
|
-
knife ssh 'chef_environment:amazon and role:webserver and recipe:mysql\\:\\:client' 'sudo chef-client' -i ~/.ssh/mray.pem -x ubuntu -G default
|
13
|
-
OUTPUT
|
14
|
-
|
15
|
-
@spiceweasel_binary = File.join(File.dirname(__FILE__), *%w[.. .. bin spiceweasel])
|
16
|
-
end
|
17
|
-
|
18
|
-
it "test chef-client in 2.5, yml" do
|
19
|
-
`#{@spiceweasel_binary} --novalidation --chef-client examples/example.yml`.should == @expected_output
|
20
|
-
end
|
21
|
-
|
22
|
-
it "test chef-client in 2.5, json" do
|
23
|
-
`#{@spiceweasel_binary} --chef-client examples/example.json --novalidation`.should == @expected_output
|
24
|
-
end
|
25
|
-
|
26
|
-
it "test chef-client in 2.5, rb" do
|
27
|
-
`#{@spiceweasel_binary} examples/example.rb --novalidation --chef-client`.should == @expected_output
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe 'testing 2.5 --chef-client with --cluster-file' do
|
32
|
-
before(:each) do
|
33
|
-
@expected_output = <<-OUTPUT
|
34
|
-
knife ssh 'name:serverB and chef_environment:qa and role:base and role:webserver' 'sudo chef-client' -i ~/.ssh/mray.pem -x user
|
35
|
-
knife ssh 'name:serverC and chef_environment:qa and role:base and role:webserver' 'sudo chef-client' -i ~/.ssh/mray.pem -x user
|
36
|
-
knife winrm 'name:winboxA and chef_environment:qa and role:base and role:iisserver' 'chef-client' -x Administrator -P 'super_secret_password'
|
37
|
-
knife ssh 'name:winboxB and chef_environment:qa and role:base and role:iisserver' 'chef-client' -x Administrator -P 'super_secret_password'
|
38
|
-
knife ssh 'name:winboxC and chef_environment:qa and role:base and role:iisserver' 'chef-client' -x Administrator -P 'super_secret_password'
|
39
|
-
knife ssh 'chef_environment:qa and role:webserver and recipe:mysql\\:\\:client' 'sudo chef-client' -x ubuntu -P ubuntu
|
40
|
-
OUTPUT
|
41
|
-
|
42
|
-
@spiceweasel_binary = File.join(File.dirname(__FILE__), *%w[.. .. bin spiceweasel])
|
43
|
-
end
|
44
|
-
|
45
|
-
it "test chef-client with --cluster-file in 2.5, yml" do
|
46
|
-
`#{@spiceweasel_binary} --novalidation --chef-client --cluster-file examples/cluster-file-example.yml examples/example.yml`.should == @expected_output
|
47
|
-
end
|
48
|
-
|
49
|
-
it "test chef-client with --cluster-file in 2.5, json" do
|
50
|
-
`#{@spiceweasel_binary} --cluster-file examples/cluster-file-example.yml --novalidation examples/example.json --chef-client`.should == @expected_output
|
51
|
-
end
|
52
|
-
|
53
|
-
it "test chef-client with --cluster-file in 2.5, rb" do
|
54
|
-
`#{@spiceweasel_binary} --novalidation --chef-client examples/example.rb --cluster-file examples/cluster-file-example.yml`.should == @expected_output
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
describe 'testing 2.5 --chef-client with -a' do
|
59
|
-
before(:each) do
|
60
|
-
@expected_output = <<-OUTPUT
|
61
|
-
knife ssh 'chef_environment:mycluster and role:mysql' 'sudo chef-client' -i ~/.ssh/mray.pem -x ubuntu -a ec2.public_hostname
|
62
|
-
knife ssh 'chef_environment:mycluster and role:webserver and recipe:mysql\\:\\:client' 'sudo chef-client' -i ~/.ssh/mray.pem -x ubuntu -a ec2.public_hostname
|
63
|
-
OUTPUT
|
64
|
-
|
65
|
-
@spiceweasel_binary = File.join(File.dirname(__FILE__), *%w[.. .. bin spiceweasel])
|
66
|
-
end
|
67
|
-
|
68
|
-
it "test chef-client with -a ec2.public_hostname in 2.5" do
|
69
|
-
`#{@spiceweasel_binary} --novalidation --chef-client -a ec2.public_hostname examples/example-cluster.yml`.should == @expected_output
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
data/spec/bin/google_spec.rb
DELETED
@@ -1,105 +0,0 @@
|
|
1
|
-
describe 'testing 2.6 google' do
|
2
|
-
before(:each) do
|
3
|
-
@expected_output = <<-OUTPUT
|
4
|
-
knife cookbook delete apache2 -a -y
|
5
|
-
knife environment delete qa -y
|
6
|
-
knife role delete base -y
|
7
|
-
knife role delete webserver -y
|
8
|
-
knife google server delete gmas1 -y
|
9
|
-
knife node delete gmas1 -y
|
10
|
-
knife client delete gmas1 -y
|
11
|
-
knife google server delete gdef1 -y
|
12
|
-
knife node delete gdef1 -y
|
13
|
-
knife client delete gdef1 -y
|
14
|
-
knife google server delete gdef2 -y
|
15
|
-
knife node delete gdef2 -y
|
16
|
-
knife client delete gdef2 -y
|
17
|
-
knife google server delete aaa -y
|
18
|
-
knife node delete aaa -y
|
19
|
-
knife client delete aaa -y
|
20
|
-
knife google server delete bbb -y
|
21
|
-
knife node delete bbb -y
|
22
|
-
knife client delete bbb -y
|
23
|
-
knife google server delete ccc -y
|
24
|
-
knife node delete ccc -y
|
25
|
-
knife client delete ccc -y
|
26
|
-
knife google server delete foo -y
|
27
|
-
knife google server delete bar -y
|
28
|
-
knife google server delete g-qa1 -y
|
29
|
-
knife google server delete g-qa2 -y
|
30
|
-
for N in $(knife node list -E qa); do knife client delete $N -y; knife node delete $N -y; done
|
31
|
-
knife cookbook upload apache2
|
32
|
-
knife environment from file qa.rb
|
33
|
-
knife role from file base.rb webserver.rb
|
34
|
-
knife google server create gmas1 -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -N gmas1 -r 'role[base]'
|
35
|
-
knife google server create gdef1 -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -N gdef1 -r 'role[base]'
|
36
|
-
knife google server create gdef2 -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -N gdef2 -r 'role[base]'
|
37
|
-
knife google server create aaa -E qa -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -r 'role[mysql]'
|
38
|
-
knife google server create bbb -E qa -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -r 'role[mysql]'
|
39
|
-
knife google server create ccc -E qa -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -r 'role[mysql]'
|
40
|
-
knife google server create foo -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -E qa -r 'role[mysql]'
|
41
|
-
knife google server create bar -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -E qa -r 'role[mysql]'
|
42
|
-
knife google server create g-qa1 -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -N g-qa1 -E qa -r 'role[mysql]'
|
43
|
-
knife google server create g-qa2 -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -N g-qa2 -E qa -r 'role[mysql]'
|
44
|
-
OUTPUT
|
45
|
-
|
46
|
-
@spiceweasel_binary = File.join(File.dirname(__FILE__), *%w[.. .. bin spiceweasel])
|
47
|
-
end
|
48
|
-
|
49
|
-
it "test knife-google functionality from 2.6" do
|
50
|
-
`#{@spiceweasel_binary} -r --novalidation examples/google-example.yml`.should == @expected_output
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
describe 'testing 2.6 google --parallel' do
|
56
|
-
before(:each) do
|
57
|
-
@expected_output = <<-OUTPUT
|
58
|
-
knife cookbook delete apache2 -a -y
|
59
|
-
knife environment delete qa -y
|
60
|
-
knife role delete base -y
|
61
|
-
knife role delete webserver -y
|
62
|
-
knife google server delete gmas1 -y
|
63
|
-
knife node delete gmas1 -y
|
64
|
-
knife client delete gmas1 -y
|
65
|
-
knife google server delete gdef1 -y
|
66
|
-
knife node delete gdef1 -y
|
67
|
-
knife client delete gdef1 -y
|
68
|
-
knife google server delete gdef2 -y
|
69
|
-
knife node delete gdef2 -y
|
70
|
-
knife client delete gdef2 -y
|
71
|
-
knife google server delete aaa -y
|
72
|
-
knife node delete aaa -y
|
73
|
-
knife client delete aaa -y
|
74
|
-
knife google server delete bbb -y
|
75
|
-
knife node delete bbb -y
|
76
|
-
knife client delete bbb -y
|
77
|
-
knife google server delete ccc -y
|
78
|
-
knife node delete ccc -y
|
79
|
-
knife client delete ccc -y
|
80
|
-
knife google server delete foo -y
|
81
|
-
knife google server delete bar -y
|
82
|
-
knife google server delete g-qa1 -y
|
83
|
-
knife google server delete g-qa2 -y
|
84
|
-
for N in $(knife node list -E qa); do knife client delete $N -y; knife node delete $N -y; done
|
85
|
-
knife cookbook upload apache2
|
86
|
-
knife environment from file qa.rb
|
87
|
-
knife role from file base.rb webserver.rb
|
88
|
-
seq 1 | parallel -u -j 0 -v "knife google server create gmas{} -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -N gmas{} -r 'role[base]'"
|
89
|
-
seq 2 | parallel -u -j 0 -v "knife google server create gdef{} -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -N gdef{} -r 'role[base]'"
|
90
|
-
knife google server create aaa -E qa -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -r 'role[mysql]'
|
91
|
-
knife google server create bbb -E qa -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -r 'role[mysql]'
|
92
|
-
knife google server create ccc -E qa -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -r 'role[mysql]'
|
93
|
-
knife google server create foo -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -E qa -r 'role[mysql]'
|
94
|
-
knife google server create bar -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -E qa -r 'role[mysql]'
|
95
|
-
seq 2 | parallel -u -j 0 -v "knife google server create g-qa{} -m n1-standard-1 -I debian-7-wheezy-v20130723 -Z us-central2-a -i ~/.ssh/id_rsa -x jdoe -N g-qa{} -E qa -r 'role[mysql]'"
|
96
|
-
OUTPUT
|
97
|
-
|
98
|
-
@spiceweasel_binary = File.join(File.dirname(__FILE__), *%w[.. .. bin spiceweasel])
|
99
|
-
end
|
100
|
-
|
101
|
-
it "test knife-google functionality from 2.6" do
|
102
|
-
`#{@spiceweasel_binary} --parallel -r --novalidation examples/google-example.yml`.should == @expected_output
|
103
|
-
end
|
104
|
-
|
105
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# Test new 2.3 functionality
|
2
|
-
describe 'testing 2.3 functionality' do
|
3
|
-
before(:each) do
|
4
|
-
@expected_output = <<-OUTPUT
|
5
|
-
knife cookbook delete apache2 -a -y
|
6
|
-
knife environment delete qa -y
|
7
|
-
knife role delete base -y
|
8
|
-
knife node list | xargs knife joyent server delete -y
|
9
|
-
knife node list | xargs knife vsphere vm delete -y
|
10
|
-
knife node bulk delete .* -y
|
11
|
-
knife cookbook upload apache2
|
12
|
-
knife environment from file qa.rb
|
13
|
-
knife role from file base.rb
|
14
|
-
seq 2 | parallel -u -j 0 -v "knife joyent server create -i ~/.ssh/joyent.pem -E qa -r 'role[base]'"
|
15
|
-
seq 2 | parallel -u -j 0 -v "knife vsphere vm clone -P secret_password -x Administrator --template some_template -r 'role[base]'"
|
16
|
-
OUTPUT
|
17
|
-
|
18
|
-
@spiceweasel_binary = File.join(File.dirname(__FILE__), *%w[.. .. bin spiceweasel])
|
19
|
-
end
|
20
|
-
|
21
|
-
it "test joyent, vsphere and --bulkdelete functionality from 2.3" do
|
22
|
-
`#{@spiceweasel_binary} --parallel --bulkdelete -r --novalidation examples/joyent-vsphere-example.yml`.should == @expected_output
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
data/spec/bin/knife_spec.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# Test new 2.4 functionality
|
2
|
-
describe 'testing knife commands' do
|
3
|
-
before(:each) do
|
4
|
-
@expected_output = <<-OUTPUT
|
5
|
-
knife node list
|
6
|
-
knife client list
|
7
|
-
knife ssh "role:database" "chef-client" -x root
|
8
|
-
knife ssh "role:webserver" "sudo chef-client" -x ubuntu
|
9
|
-
OUTPUT
|
10
|
-
|
11
|
-
@spiceweasel_binary = File.join(File.dirname(__FILE__), *%w[.. .. bin spiceweasel])
|
12
|
-
end
|
13
|
-
|
14
|
-
it "test knife commands from 2.4" do
|
15
|
-
`#{@spiceweasel_binary} examples/knife.yml`.should == @expected_output
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
data/spec/bin/kvm_spec.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
describe 'testing 2.5 kvm' do
|
2
|
-
before(:each) do
|
3
|
-
@expected_output = <<-OUTPUT
|
4
|
-
knife cookbook delete apache2 -a -y
|
5
|
-
knife environment delete qa -y
|
6
|
-
knife role delete base -y
|
7
|
-
knife node delete winboxA -y
|
8
|
-
knife client delete winboxA -y
|
9
|
-
knife node delete winboxB -y
|
10
|
-
knife client delete winboxB -y
|
11
|
-
for N in $(knife node list -E qa); do knife client delete $N -y; knife node delete $N -y; done
|
12
|
-
knife cookbook upload apache2
|
13
|
-
knife environment from file qa.rb
|
14
|
-
knife role from file base.rb
|
15
|
-
seq 2 | parallel -u -j 0 -v "knife kvm vm create -E qa --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 -r 'role[base]'"
|
16
|
-
knife bootstrap windows winrm winboxA -x Administrator -P 'super_secret_password' -r 'role[base],role[iisserver]'
|
17
|
-
knife bootstrap windows winrm winboxB -x Administrator -P 'super_secret_password' -r 'role[base],role[iisserver]'
|
18
|
-
seq 1 | parallel -u -j 0 -v "knife kvm vm create -E production --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 -E qa -r 'role[mysql]'"
|
19
|
-
seq 3 | parallel -u -j 0 -v "knife kvm vm create --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 -E qa -r 'role[webserver],recipe[mysql::client]'"
|
20
|
-
OUTPUT
|
21
|
-
|
22
|
-
@spiceweasel_binary = File.join(File.dirname(__FILE__), *%w[.. .. bin spiceweasel])
|
23
|
-
end
|
24
|
-
|
25
|
-
it "test kvm, cluster functionality from 2.5" do
|
26
|
-
`#{@spiceweasel_binary} --parallel -r --novalidation examples/kvm-example.yml`.should == @expected_output
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
data/spec/bin/node_spec.rb
DELETED
@@ -1,108 +0,0 @@
|
|
1
|
-
describe 'testing 2.6' do
|
2
|
-
before(:each) do
|
3
|
-
@expected_output = <<-OUTPUT
|
4
|
-
knife node delete serverA -y
|
5
|
-
knife client delete serverA -y
|
6
|
-
knife node delete serverB -y
|
7
|
-
knife client delete serverB -y
|
8
|
-
knife node delete serverC -y
|
9
|
-
knife client delete serverC -y
|
10
|
-
knife linode server delete db1 -y
|
11
|
-
knife node delete db1 -y
|
12
|
-
knife client delete db1 -y
|
13
|
-
knife linode server delete db2 -y
|
14
|
-
knife node delete db2 -y
|
15
|
-
knife client delete db2 -y
|
16
|
-
knife linode server delete db3 -y
|
17
|
-
knife node delete db3 -y
|
18
|
-
knife client delete db3 -y
|
19
|
-
knife node delete winboxA -y
|
20
|
-
knife client delete winboxA -y
|
21
|
-
knife node delete winboxB -y
|
22
|
-
knife client delete winboxB -y
|
23
|
-
knife node delete winboxC -y
|
24
|
-
knife client delete winboxC -y
|
25
|
-
knife digital_ocean droplet destroy DOmysql -y
|
26
|
-
knife digital_ocean droplet destroy DOweb1 -y
|
27
|
-
knife digital_ocean droplet destroy DOweb2 -y
|
28
|
-
knife digital_ocean droplet destroy DOweb3 -y
|
29
|
-
for N in $(knife node list -E digital); do knife client delete $N -y; knife node delete $N -y; done
|
30
|
-
knife bootstrap serverA --identity-file ~/.ssh/mray.pem --ssh-user user --sudo --no-host-key-verify --ssh-port 22 -r 'role[base]'
|
31
|
-
knife bootstrap serverB -E development -i ~/.ssh/mray.pem -x user --sudo -r 'role[base]'
|
32
|
-
knife bootstrap serverC -E development -i ~/.ssh/mray.pem -x user --sudo -r 'role[base]'
|
33
|
-
knife linode server create --image 49 -E qa --flavor 2 -N db1 -r 'recipe[mysql],role[monitoring]'
|
34
|
-
knife linode server create --image 49 -E qa --flavor 2 -N db2 -r 'recipe[mysql],role[monitoring]'
|
35
|
-
knife linode server create --image 49 -E qa --flavor 2 -N db3 -r 'recipe[mysql],role[monitoring]'
|
36
|
-
knife bootstrap windows winrm winboxA -x Administrator -P 'super_secret_password' -r 'role[base],role[iisserver]'
|
37
|
-
knife bootstrap windows ssh winboxB -x Administrator -P 'super_secret_password'
|
38
|
-
knife bootstrap windows ssh winboxC -x Administrator -P 'super_secret_password'
|
39
|
-
knife digital_ocean droplet create -S mray -i ~/.ssh/mray.pem -x ubuntu -I ami-8af0f326 -f m1.medium -N DOmysql -E digital -r 'role[mysql]'
|
40
|
-
knife digital_ocean droplet create -S mray -i ~/.ssh/mray.pem -x ubuntu -I ami-7000f019 -f m1.small -N DOweb1 -E digital -r 'role[webserver],recipe[mysql::client]'
|
41
|
-
knife digital_ocean droplet create -S mray -i ~/.ssh/mray.pem -x ubuntu -I ami-7000f019 -f m1.small -N DOweb2 -E digital -r 'role[webserver],recipe[mysql::client]'
|
42
|
-
knife digital_ocean droplet create -S mray -i ~/.ssh/mray.pem -x ubuntu -I ami-7000f019 -f m1.small -N DOweb3 -E digital -r 'role[webserver],recipe[mysql::client]'
|
43
|
-
OUTPUT
|
44
|
-
@spiceweasel_binary = File.join(File.dirname(__FILE__), *%w[.. .. bin spiceweasel])
|
45
|
-
end
|
46
|
-
|
47
|
-
it "test for cluster deletion and digital_ocean and linode in 2.6" do
|
48
|
-
`#{@spiceweasel_binary} --rebuild --novalidation examples/node-example.yml`.should == @expected_output
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
describe 'testing 2.6 --node-only' do
|
54
|
-
before(:each) do
|
55
|
-
@expected_output = <<-OUTPUT
|
56
|
-
knife node delete serverA -y
|
57
|
-
knife client delete serverA -y
|
58
|
-
knife node delete serverB -y
|
59
|
-
knife client delete serverB -y
|
60
|
-
knife node delete serverC -y
|
61
|
-
knife client delete serverC -y
|
62
|
-
knife node delete db1 -y
|
63
|
-
knife client delete db1 -y
|
64
|
-
knife node delete db2 -y
|
65
|
-
knife client delete db2 -y
|
66
|
-
knife node delete db3 -y
|
67
|
-
knife client delete db3 -y
|
68
|
-
knife node delete winboxA -y
|
69
|
-
knife client delete winboxA -y
|
70
|
-
knife node delete winboxB -y
|
71
|
-
knife client delete winboxB -y
|
72
|
-
knife node delete winboxC -y
|
73
|
-
knife client delete winboxC -y
|
74
|
-
for N in $(knife node list -E digital); do knife client delete $N -y; knife node delete $N -y; done
|
75
|
-
knife node create -d serverA
|
76
|
-
knife node run_list set serverA 'role[base]'
|
77
|
-
knife node create -d serverB
|
78
|
-
knife node run_list set serverB 'role[base]'
|
79
|
-
knife node create -d serverC
|
80
|
-
knife node run_list set serverC 'role[base]'
|
81
|
-
knife node create -d db1
|
82
|
-
knife node run_list set db1 'recipe[mysql],role[monitoring]'
|
83
|
-
knife node create -d db2
|
84
|
-
knife node run_list set db2 'recipe[mysql],role[monitoring]'
|
85
|
-
knife node create -d db3
|
86
|
-
knife node run_list set db3 'recipe[mysql],role[monitoring]'
|
87
|
-
knife node create -d winboxA
|
88
|
-
knife node run_list set winboxA 'role[base],role[iisserver]'
|
89
|
-
knife node create -d winboxB
|
90
|
-
knife node create -d winboxC
|
91
|
-
knife node create -d DOmysql
|
92
|
-
knife node run_list set DOmysql 'role[mysql]'
|
93
|
-
knife node create -d DOweb1
|
94
|
-
knife node run_list set DOweb1 'role[webserver],recipe[mysql::client]'
|
95
|
-
knife node create -d DOweb2
|
96
|
-
knife node run_list set DOweb2 'role[webserver],recipe[mysql::client]'
|
97
|
-
knife node create -d DOweb3
|
98
|
-
knife node run_list set DOweb3 'role[webserver],recipe[mysql::client]'
|
99
|
-
OUTPUT
|
100
|
-
|
101
|
-
@spiceweasel_binary = File.join(File.dirname(__FILE__), *%w[.. .. bin spiceweasel])
|
102
|
-
end
|
103
|
-
|
104
|
-
it "tests node deletion and creation using --node-only" do
|
105
|
-
`#{@spiceweasel_binary} --node-only --rebuild --novalidation examples/node-example.yml`.should == @expected_output
|
106
|
-
end
|
107
|
-
|
108
|
-
end
|
@@ -1,136 +0,0 @@
|
|
1
|
-
# Cover-all spec to prevent regressions during refactor
|
2
|
-
describe 'The Spiceweasel binary' do
|
3
|
-
before(:each) do
|
4
|
-
@expected_output = <<-OUTPUT
|
5
|
-
knife cookbook delete apache2 -a -y
|
6
|
-
knife cookbook delete apt 1.2.0 -a -y
|
7
|
-
knife cookbook delete mysql -a -y
|
8
|
-
knife cookbook delete ntp -a -y
|
9
|
-
knife environment delete development -y
|
10
|
-
knife environment delete qa -y
|
11
|
-
knife environment delete production -y
|
12
|
-
knife role delete base -y
|
13
|
-
knife role delete iisserver -y
|
14
|
-
knife role delete monitoring -y
|
15
|
-
knife role delete webserver -y
|
16
|
-
knife data bag delete users -y
|
17
|
-
knife data bag delete data -y
|
18
|
-
knife data bag delete passwords -y
|
19
|
-
knife node delete serverA -y
|
20
|
-
knife client delete serverA -y
|
21
|
-
knife node delete serverB -y
|
22
|
-
knife client delete serverB -y
|
23
|
-
knife node delete serverC -y
|
24
|
-
knife client delete serverC -y
|
25
|
-
knife rackspace server delete db1 -y
|
26
|
-
knife node delete db1 -y
|
27
|
-
knife client delete db1 -y
|
28
|
-
knife rackspace server delete db2 -y
|
29
|
-
knife node delete db2 -y
|
30
|
-
knife client delete db2 -y
|
31
|
-
knife rackspace server delete db3 -y
|
32
|
-
knife node delete db3 -y
|
33
|
-
knife client delete db3 -y
|
34
|
-
knife node delete winboxA -y
|
35
|
-
knife client delete winboxA -y
|
36
|
-
knife node delete winboxB -y
|
37
|
-
knife client delete winboxB -y
|
38
|
-
knife node delete winboxC -y
|
39
|
-
knife client delete winboxC -y
|
40
|
-
for N in $(knife node list -E amazon); do knife client delete $N -y; knife node delete $N -y; done
|
41
|
-
knife cookbook upload apache2
|
42
|
-
knife cookbook upload apt --freeze
|
43
|
-
knife cookbook upload mysql ntp
|
44
|
-
knife environment from file development.rb production.rb qa.rb
|
45
|
-
knife role from file base.rb iisserver.rb monitoring.rb webserver.rb
|
46
|
-
knife data bag create users
|
47
|
-
knife data bag from file users alice.json bob.json chuck.json
|
48
|
-
knife data bag create data
|
49
|
-
knife data bag create passwords
|
50
|
-
knife data bag from file passwords mysql.json rabbitmq.json --secret-file secret_key
|
51
|
-
knife bootstrap serverA --identity-file ~/.ssh/mray.pem --ssh-user user --sudo --no-host-key-verify --ssh-port 22 -r 'role[base]'
|
52
|
-
knife bootstrap serverB -E development -i ~/.ssh/mray.pem -x user --sudo -r 'role[base]'
|
53
|
-
knife bootstrap serverC -E development -i ~/.ssh/mray.pem -x user --sudo -r 'role[base]'
|
54
|
-
knife rackspace server create --image 49 -E qa --flavor 2 -N db1 -r 'recipe[mysql],role[monitoring]'
|
55
|
-
knife rackspace server create --image 49 -E qa --flavor 2 -N db2 -r 'recipe[mysql],role[monitoring]'
|
56
|
-
knife rackspace server create --image 49 -E qa --flavor 2 -N db3 -r 'recipe[mysql],role[monitoring]'
|
57
|
-
knife bootstrap windows winrm winboxA -x Administrator -P 'super_secret_password' -r 'role[base],role[iisserver]'
|
58
|
-
knife bootstrap windows ssh winboxB -x Administrator -P 'super_secret_password' -r 'role[base],role[iisserver]'
|
59
|
-
knife bootstrap windows ssh winboxC -x Administrator -P 'super_secret_password' -r 'role[base],role[iisserver]'
|
60
|
-
knife ec2 server create -S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-8af0f326 -f m1.medium -E amazon -r 'role[mysql]'
|
61
|
-
knife ec2 server create -S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-7000f019 -f m1.small -E amazon -r 'role[webserver],recipe[mysql::client]'
|
62
|
-
knife ec2 server create -S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-7000f019 -f m1.small -E amazon -r 'role[webserver],recipe[mysql::client]'
|
63
|
-
knife ec2 server create -S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-7000f019 -f m1.small -E amazon -r 'role[webserver],recipe[mysql::client]'
|
64
|
-
knife ssh 'role:monitoring' 'sudo chef-client' -x user
|
65
|
-
knife rackspace server delete -y --node-name db3 --purge
|
66
|
-
knife vsphere vm clone --bootstrap --template 'abc' my-new-webserver1
|
67
|
-
knife vsphere vm clone --bootstrap --template 'def' my-new-webserver2
|
68
|
-
knife vsphere vm clone --bootstrap --template 'ghi' my-new-webserver3
|
69
|
-
OUTPUT
|
70
|
-
|
71
|
-
@spiceweasel_binary = File.join(File.dirname(__FILE__), *%w[.. .. bin spiceweasel])
|
72
|
-
end
|
73
|
-
|
74
|
-
it "maintains consistent output from the example config with yml" do
|
75
|
-
`#{@spiceweasel_binary} -r --novalidation examples/example.yml`.should == @expected_output
|
76
|
-
end
|
77
|
-
|
78
|
-
it "maintains consistent output from the example config with json" do
|
79
|
-
`#{@spiceweasel_binary} -r --novalidation examples/example.json`.should == @expected_output
|
80
|
-
end
|
81
|
-
|
82
|
-
it "maintains consistent output from the example config with rb" do
|
83
|
-
`#{@spiceweasel_binary} -r --novalidation examples/example.rb`.should == @expected_output
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
describe 'The Spiceweasel binary' do
|
88
|
-
before(:each) do
|
89
|
-
@expected_output = <<-OUTPUT
|
90
|
-
knife cookbook delete apache2 -a -y
|
91
|
-
knife cookbook delete apt 1.2.0 -a -y
|
92
|
-
knife cookbook delete mysql -a -y
|
93
|
-
knife cookbook delete ntp -a -y
|
94
|
-
knife environment delete development -y
|
95
|
-
knife environment delete qa -y
|
96
|
-
knife environment delete production -y
|
97
|
-
knife role delete base -y
|
98
|
-
knife role delete iisserver -y
|
99
|
-
knife role delete monitoring -y
|
100
|
-
knife role delete webserver -y
|
101
|
-
knife data bag delete users -y
|
102
|
-
knife data bag delete data -y
|
103
|
-
knife data bag delete passwords -y
|
104
|
-
knife node delete serverA -y
|
105
|
-
knife client delete serverA -y
|
106
|
-
knife node delete serverB -y
|
107
|
-
knife client delete serverB -y
|
108
|
-
knife node delete serverC -y
|
109
|
-
knife client delete serverC -y
|
110
|
-
knife rackspace server delete db1 -y
|
111
|
-
knife node delete db1 -y
|
112
|
-
knife client delete db1 -y
|
113
|
-
knife rackspace server delete db2 -y
|
114
|
-
knife node delete db2 -y
|
115
|
-
knife client delete db2 -y
|
116
|
-
knife rackspace server delete db3 -y
|
117
|
-
knife node delete db3 -y
|
118
|
-
knife client delete db3 -y
|
119
|
-
knife node delete winboxA -y
|
120
|
-
knife client delete winboxA -y
|
121
|
-
knife node delete winboxB -y
|
122
|
-
knife client delete winboxB -y
|
123
|
-
knife node delete winboxC -y
|
124
|
-
knife client delete winboxC -y
|
125
|
-
knife node bulk delete .* -y
|
126
|
-
for N in $(knife node list -E amazon); do knife client delete $N -y; knife node delete $N -y; done
|
127
|
-
OUTPUT
|
128
|
-
|
129
|
-
@spiceweasel_binary = File.join(File.dirname(__FILE__), *%w[.. .. bin spiceweasel])
|
130
|
-
end
|
131
|
-
|
132
|
-
it "maintains consistent output deleting from the example config with yml using --bulkdelete" do
|
133
|
-
`#{@spiceweasel_binary} --bulkdelete -d --novalidation examples/example.yml`.should == @expected_output
|
134
|
-
end
|
135
|
-
|
136
|
-
end
|