wombat-cli 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +23 -23
- data/.travis.yml +22 -27
- data/CHANGELOG.md +438 -423
- data/DESIGN.md +49 -49
- data/Gemfile +5 -5
- data/README.md +146 -146
- data/Rakefile +26 -26
- data/bin/wombat +24 -24
- data/generator_files/Vagrantfile +120 -120
- data/generator_files/cookbooks/automate/.gitignore +16 -16
- data/generator_files/cookbooks/automate/.kitchen.ec2.yml +34 -34
- data/generator_files/cookbooks/automate/.kitchen.yml +24 -24
- data/generator_files/cookbooks/automate/Berksfile +6 -6
- data/generator_files/cookbooks/automate/README.md +4 -4
- data/generator_files/cookbooks/automate/chefignore +102 -102
- data/generator_files/cookbooks/automate/libraries/_helper.rb +52 -52
- data/generator_files/cookbooks/automate/libraries/delivery_api.rb +204 -204
- data/generator_files/cookbooks/automate/libraries/delivery_project.rb +31 -31
- data/generator_files/cookbooks/automate/libraries/dsl.rb +4 -4
- data/generator_files/cookbooks/automate/metadata.rb +11 -11
- data/generator_files/cookbooks/automate/recipes/default.rb +118 -124
- data/generator_files/cookbooks/automate/recipes/update-users.rb +48 -48
- data/generator_files/cookbooks/automate/templates/delivery.erb +6 -6
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/metadata.rb +3 -3
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/recipes/default.rb +27 -27
- data/generator_files/cookbooks/automate/test/integration/default/automate_spec.rb +56 -56
- data/generator_files/cookbooks/build_node/.gitignore +16 -16
- data/generator_files/cookbooks/build_node/.kitchen.ec2.yml +37 -37
- data/generator_files/cookbooks/build_node/.kitchen.yml +23 -23
- data/generator_files/cookbooks/build_node/Berksfile +8 -8
- data/generator_files/cookbooks/build_node/README.md +4 -4
- data/generator_files/cookbooks/build_node/chefignore +102 -102
- data/generator_files/cookbooks/build_node/metadata.rb +12 -12
- data/generator_files/cookbooks/build_node/recipes/default.rb +38 -38
- data/generator_files/cookbooks/build_node/templates/client.erb +2 -2
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/metadata.rb +2 -2
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/recipes/default.rb +18 -18
- data/generator_files/cookbooks/build_node/test/integration/default/build-node_spec.rb +40 -40
- data/generator_files/cookbooks/chef_server/.gitignore +16 -16
- data/generator_files/cookbooks/chef_server/.kitchen.ec2.yml +34 -34
- data/generator_files/cookbooks/chef_server/.kitchen.yml +24 -24
- data/generator_files/cookbooks/chef_server/Berksfile +6 -6
- data/generator_files/cookbooks/chef_server/README.md +4 -4
- data/generator_files/cookbooks/chef_server/chefignore +102 -102
- data/generator_files/cookbooks/chef_server/metadata.rb +11 -11
- data/generator_files/cookbooks/chef_server/recipes/bootstrap_users.rb +91 -91
- data/generator_files/cookbooks/chef_server/recipes/default.rb +113 -113
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/metadata.rb +2 -2
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/recipes/default.rb +23 -23
- data/generator_files/cookbooks/chef_server/test/integration/default/chef_server_spec.rb +50 -50
- data/generator_files/cookbooks/compliance/.gitignore +16 -16
- data/generator_files/cookbooks/compliance/.kitchen.ec2.yml +34 -34
- data/generator_files/cookbooks/compliance/.kitchen.yml +24 -24
- data/generator_files/cookbooks/compliance/Berksfile +7 -7
- data/generator_files/cookbooks/compliance/README.md +4 -4
- data/generator_files/cookbooks/compliance/chefignore +102 -102
- data/generator_files/cookbooks/compliance/metadata.rb +11 -11
- data/generator_files/cookbooks/compliance/recipes/default.rb +57 -57
- data/generator_files/cookbooks/compliance/spec/spec_helper.rb +2 -2
- data/generator_files/cookbooks/compliance/spec/unit/recipes/default_spec.rb +20 -20
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/metadata.rb +4 -4
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/recipes/default.rb +21 -21
- data/generator_files/cookbooks/compliance/test/integration/default/compliance.rb +28 -28
- data/generator_files/cookbooks/infranodes/.gitignore +16 -16
- data/generator_files/cookbooks/infranodes/.kitchen.ec2.yml +48 -48
- data/generator_files/cookbooks/infranodes/.kitchen.yml +21 -21
- data/generator_files/cookbooks/infranodes/Berksfile +6 -6
- data/generator_files/cookbooks/infranodes/README.md +4 -4
- data/generator_files/cookbooks/infranodes/attributes/default.rb +2 -2
- data/generator_files/cookbooks/infranodes/chefignore +102 -102
- data/generator_files/cookbooks/infranodes/metadata.rb +13 -13
- data/generator_files/cookbooks/infranodes/recipes/default.rb +57 -57
- data/generator_files/cookbooks/infranodes/spec/spec_helper.rb +2 -2
- data/generator_files/cookbooks/infranodes/spec/unit/recipes/default_spec.rb +20 -20
- data/generator_files/cookbooks/infranodes/templates/default/client.rb.erb +5 -5
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/metadata.rb +3 -3
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/recipes/default.rb +27 -27
- data/generator_files/cookbooks/infranodes/test/integration/default/infranodes_spec.rb +22 -22
- data/generator_files/cookbooks/infranodes/test/integration/helpers/serverspec/spec_helper.rb +8 -8
- data/generator_files/cookbooks/wombat/.gitignore +16 -16
- data/generator_files/cookbooks/wombat/.kitchen.yml +43 -43
- data/generator_files/cookbooks/wombat/Berksfile +5 -5
- data/generator_files/cookbooks/wombat/README.md +4 -4
- data/generator_files/cookbooks/wombat/attributes/default.rb +79 -80
- data/generator_files/cookbooks/wombat/attributes/packer.rb +18 -18
- data/generator_files/cookbooks/wombat/chefignore +102 -102
- data/generator_files/cookbooks/wombat/metadata.rb +13 -13
- data/generator_files/cookbooks/wombat/recipes/authorized-keys.rb +20 -20
- data/generator_files/cookbooks/wombat/recipes/default.rb +111 -111
- data/generator_files/cookbooks/wombat/recipes/etc-hosts.rb +51 -51
- data/generator_files/cookbooks/workstation/.gitignore +16 -16
- data/generator_files/cookbooks/workstation/.kitchen.azure.yml +45 -0
- data/generator_files/cookbooks/workstation/.kitchen.ec2.yml +46 -30
- data/generator_files/cookbooks/workstation/.kitchen.yml +42 -22
- data/generator_files/cookbooks/workstation/Berksfile +7 -7
- data/generator_files/cookbooks/workstation/README.md +3 -3
- data/generator_files/cookbooks/workstation/chefignore +106 -102
- data/generator_files/cookbooks/workstation/files/atom.apm.list +10 -7
- data/generator_files/cookbooks/workstation/files/atom.config.cson +6 -3
- data/generator_files/cookbooks/workstation/{templates/default/ise_profile.ps1.erb → files/ise_profile.ps1} +11 -11
- data/generator_files/cookbooks/workstation/libraries/home.rb +4 -4
- data/generator_files/cookbooks/workstation/metadata.rb +14 -14
- data/generator_files/cookbooks/workstation/recipes/browser.rb +53 -58
- data/generator_files/cookbooks/workstation/recipes/certs-keys.rb +41 -45
- data/generator_files/cookbooks/workstation/recipes/chef.rb +29 -28
- data/generator_files/cookbooks/workstation/recipes/default.rb +24 -21
- data/generator_files/cookbooks/workstation/recipes/dotnet.rb +19 -17
- data/generator_files/cookbooks/workstation/recipes/editor.rb +46 -18
- data/generator_files/cookbooks/workstation/recipes/profile.rb +14 -41
- data/generator_files/cookbooks/workstation/recipes/terminal.rb +11 -11
- data/generator_files/cookbooks/workstation/templates/default/bookmarks.html.erb +23 -23
- data/generator_files/cookbooks/workstation/templates/default/data_collector.rb.erb +2 -2
- data/generator_files/cookbooks/workstation/templates/default/knife.rb.erb +10 -10
- data/generator_files/cookbooks/workstation/templates/default/master_preferences.json.erb +28 -28
- data/generator_files/cookbooks/workstation/templates/default/ssh_config.erb +16 -16
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/chef.crt +26 -26
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/metadata.rb +2 -2
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/recipes/default.rb +21 -21
- data/generator_files/cookbooks/workstation/test/integration/default/workstation_spec.rb +77 -37
- data/generator_files/packer/automate.json +136 -136
- data/generator_files/packer/build-node.json +142 -142
- data/generator_files/packer/chef-server.json +137 -137
- data/generator_files/packer/compliance.json +133 -133
- data/generator_files/packer/infranodes-windows.json +143 -143
- data/generator_files/packer/infranodes.json +134 -134
- data/generator_files/packer/scripts/PreSysprep.ps1 +9 -0
- data/generator_files/packer/workstation.json +160 -142
- data/generator_files/templates/arm.md.json.erb +754 -754
- data/generator_files/templates/arm.vhd.json.erb +630 -630
- data/generator_files/templates/bootstrap-aws.erb +39 -39
- data/generator_files/templates/cfn.json.erb +675 -674
- data/generator_files/wombat.yml +75 -74
- data/lib/wombat/aws.rb +67 -67
- data/lib/wombat/build.rb +392 -392
- data/lib/wombat/cli.rb +254 -254
- data/lib/wombat/common.rb +420 -420
- data/lib/wombat/crypto.rb +65 -65
- data/lib/wombat/delete.rb +67 -67
- data/lib/wombat/deploy.rb +128 -128
- data/lib/wombat/init.rb +32 -32
- data/lib/wombat/latest.rb +27 -27
- data/lib/wombat/output.rb +101 -101
- data/lib/wombat/update.rb +20 -20
- data/lib/wombat/version.rb +3 -3
- data/lib/wombat.rb +8 -8
- data/spec/functional/common_spec.rb +26 -26
- data/spec/spec_helper.rb +103 -103
- data/spec/unit/common_spec.rb +116 -116
- data/terraform/README.md +13 -13
- data/terraform/templates/terraform.tfvars.erb +12 -12
- data/terraform/wombat.tf +328 -328
- data/wombat-cli.gemspec +36 -36
- metadata +6 -4
data/spec/unit/common_spec.rb
CHANGED
@@ -1,116 +1,116 @@
|
|
1
|
-
require "wombat/common"
|
2
|
-
require "yaml"
|
3
|
-
|
4
|
-
describe "Wombat::Common" do
|
5
|
-
let(:common) do
|
6
|
-
klass = Class.new { include Wombat::Common }
|
7
|
-
|
8
|
-
return klass.new
|
9
|
-
end
|
10
|
-
|
11
|
-
describe "#conf" do
|
12
|
-
describe "when files_dir is set" do
|
13
|
-
it "sets files_dir to default value" do
|
14
|
-
|
15
|
-
content = common.conf
|
16
|
-
|
17
|
-
expect(content["files_dir"]).to eq("files")
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
describe "#lock" do
|
23
|
-
describe "when a lock does not exist" do
|
24
|
-
it "warn and return 1" do
|
25
|
-
|
26
|
-
expect(File).to receive(:exist?).
|
27
|
-
with("wombat.lock").
|
28
|
-
and_return(false)
|
29
|
-
|
30
|
-
expect(common).to receive(:warn)
|
31
|
-
|
32
|
-
lock = common.lock
|
33
|
-
|
34
|
-
expect(lock).to be(1)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
describe "when a lock does exist" do
|
39
|
-
it "load lock file" do
|
40
|
-
|
41
|
-
expect(File).to receive(:exist?).
|
42
|
-
with("wombat.lock").
|
43
|
-
and_return(true)
|
44
|
-
|
45
|
-
expect(File).to receive(:read).
|
46
|
-
with("wombat.lock").
|
47
|
-
and_return("{")
|
48
|
-
|
49
|
-
expect(JSON).to receive(:parse).with("{")
|
50
|
-
|
51
|
-
common.lock
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
describe "#wombat" do
|
57
|
-
describe "when WOMBAT_YML is set" do
|
58
|
-
it "loads a configuration file from WOMBAT_YML" do
|
59
|
-
stub_const("ENV", {"WOMBAT_YML" => "aesthetics.yml"})
|
60
|
-
|
61
|
-
expect(File).to receive(:exist?).
|
62
|
-
with("aesthetics.yml").
|
63
|
-
and_return(true)
|
64
|
-
|
65
|
-
expect(File).to receive(:read).
|
66
|
-
with("aesthetics.yml").
|
67
|
-
and_return("---")
|
68
|
-
|
69
|
-
expect(YAML).to receive(:load).with("---")
|
70
|
-
|
71
|
-
common.wombat
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
describe "when WOMBAT_YML is not set" do
|
76
|
-
it "loads a configuration file from a default location" do
|
77
|
-
stub_const("ENV", {})
|
78
|
-
|
79
|
-
expect(File).to receive(:exist?).
|
80
|
-
with("wombat.yml").
|
81
|
-
and_return(true)
|
82
|
-
|
83
|
-
expect(File).to receive(:read).
|
84
|
-
with("wombat.yml").
|
85
|
-
and_return("---")
|
86
|
-
|
87
|
-
expect(YAML).to receive(:load).with("---")
|
88
|
-
|
89
|
-
common.wombat
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
describe "when a configuration file does not exist" do
|
94
|
-
it "copies example configuration file to default location" do
|
95
|
-
stub_const("ENV", {})
|
96
|
-
|
97
|
-
expect(File).to receive(:exist?).
|
98
|
-
with("wombat.yml").
|
99
|
-
and_return(false)
|
100
|
-
|
101
|
-
expect(common).to receive(:warn)
|
102
|
-
|
103
|
-
expect(FileUtils).to receive(:cp_r).
|
104
|
-
with(/generator_files\/wombat\.yml/, Dir.pwd)
|
105
|
-
|
106
|
-
expect(File).to receive(:read).
|
107
|
-
with("wombat.yml").
|
108
|
-
and_return("---")
|
109
|
-
|
110
|
-
expect(YAML).to receive(:load).with("---")
|
111
|
-
|
112
|
-
common.wombat
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
1
|
+
require "wombat/common"
|
2
|
+
require "yaml"
|
3
|
+
|
4
|
+
describe "Wombat::Common" do
|
5
|
+
let(:common) do
|
6
|
+
klass = Class.new { include Wombat::Common }
|
7
|
+
|
8
|
+
return klass.new
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "#conf" do
|
12
|
+
describe "when files_dir is set" do
|
13
|
+
it "sets files_dir to default value" do
|
14
|
+
|
15
|
+
content = common.conf
|
16
|
+
|
17
|
+
expect(content["files_dir"]).to eq("files")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe "#lock" do
|
23
|
+
describe "when a lock does not exist" do
|
24
|
+
it "warn and return 1" do
|
25
|
+
|
26
|
+
expect(File).to receive(:exist?).
|
27
|
+
with("wombat.lock").
|
28
|
+
and_return(false)
|
29
|
+
|
30
|
+
expect(common).to receive(:warn)
|
31
|
+
|
32
|
+
lock = common.lock
|
33
|
+
|
34
|
+
expect(lock).to be(1)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe "when a lock does exist" do
|
39
|
+
it "load lock file" do
|
40
|
+
|
41
|
+
expect(File).to receive(:exist?).
|
42
|
+
with("wombat.lock").
|
43
|
+
and_return(true)
|
44
|
+
|
45
|
+
expect(File).to receive(:read).
|
46
|
+
with("wombat.lock").
|
47
|
+
and_return("{")
|
48
|
+
|
49
|
+
expect(JSON).to receive(:parse).with("{")
|
50
|
+
|
51
|
+
common.lock
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe "#wombat" do
|
57
|
+
describe "when WOMBAT_YML is set" do
|
58
|
+
it "loads a configuration file from WOMBAT_YML" do
|
59
|
+
stub_const("ENV", {"WOMBAT_YML" => "aesthetics.yml"})
|
60
|
+
|
61
|
+
expect(File).to receive(:exist?).
|
62
|
+
with("aesthetics.yml").
|
63
|
+
and_return(true)
|
64
|
+
|
65
|
+
expect(File).to receive(:read).
|
66
|
+
with("aesthetics.yml").
|
67
|
+
and_return("---")
|
68
|
+
|
69
|
+
expect(YAML).to receive(:load).with("---")
|
70
|
+
|
71
|
+
common.wombat
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
describe "when WOMBAT_YML is not set" do
|
76
|
+
it "loads a configuration file from a default location" do
|
77
|
+
stub_const("ENV", {})
|
78
|
+
|
79
|
+
expect(File).to receive(:exist?).
|
80
|
+
with("wombat.yml").
|
81
|
+
and_return(true)
|
82
|
+
|
83
|
+
expect(File).to receive(:read).
|
84
|
+
with("wombat.yml").
|
85
|
+
and_return("---")
|
86
|
+
|
87
|
+
expect(YAML).to receive(:load).with("---")
|
88
|
+
|
89
|
+
common.wombat
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
describe "when a configuration file does not exist" do
|
94
|
+
it "copies example configuration file to default location" do
|
95
|
+
stub_const("ENV", {})
|
96
|
+
|
97
|
+
expect(File).to receive(:exist?).
|
98
|
+
with("wombat.yml").
|
99
|
+
and_return(false)
|
100
|
+
|
101
|
+
expect(common).to receive(:warn)
|
102
|
+
|
103
|
+
expect(FileUtils).to receive(:cp_r).
|
104
|
+
with(/generator_files\/wombat\.yml/, Dir.pwd)
|
105
|
+
|
106
|
+
expect(File).to receive(:read).
|
107
|
+
with("wombat.yml").
|
108
|
+
and_return("---")
|
109
|
+
|
110
|
+
expect(YAML).to receive(:load).with("---")
|
111
|
+
|
112
|
+
common.wombat
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
data/terraform/README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
# Terraform
|
2
|
-
- `wombat.tf` is a Terraform configuration for the wombat
|
3
|
-
|
4
|
-
|
5
|
-
## Using Terraform
|
6
|
-
1. Install Terraform https://www.terraform.io/downloads.html
|
7
|
-
2. configure AWS keys for Terraform
|
8
|
-
- either with env vars `TF_VAR_access_key TF_VAR_secret_key` or a terraform.tfvars file
|
9
|
-
- https://gist.github.com/scarolan/60ae8a2d5f2a8fdb5c55
|
10
|
-
3. `terraform plan` to see what resources would be built
|
11
|
-
4. `terraform apply` to build (or update) resources
|
12
|
-
5. `terraform output` to display outputs (in our case public IPs)
|
13
|
-
6. `terraform destroy` to destroy resources
|
1
|
+
# Terraform
|
2
|
+
- `wombat.tf` is a Terraform configuration for the wombat
|
3
|
+
|
4
|
+
|
5
|
+
## Using Terraform
|
6
|
+
1. Install Terraform https://www.terraform.io/downloads.html
|
7
|
+
2. configure AWS keys for Terraform
|
8
|
+
- either with env vars `TF_VAR_access_key TF_VAR_secret_key` or a terraform.tfvars file
|
9
|
+
- https://gist.github.com/scarolan/60ae8a2d5f2a8fdb5c55
|
10
|
+
3. `terraform plan` to see what resources would be built
|
11
|
+
4. `terraform apply` to build (or update) resources
|
12
|
+
5. `terraform output` to display outputs (in our case public IPs)
|
13
|
+
6. `terraform destroy` to destroy resources
|
@@ -1,12 +1,12 @@
|
|
1
|
-
# We have to define these, but we leave them blank so that Terraform
|
2
|
-
# knows to read them from environment vars or ~/.aws/credentials
|
3
|
-
access_key = ""
|
4
|
-
secret_key = ""
|
5
|
-
key_name = ""
|
6
|
-
customer = "wombat"
|
7
|
-
|
8
|
-
# Default AMIs for building the demo
|
9
|
-
ami-chef-server = "<%= @chef_server_ami %>"
|
10
|
-
ami-automate = "<%= @automate_ami %>"
|
11
|
-
ami-build-node = "<%= @automate_builder_ami %>"
|
12
|
-
ami-workstation = "<%= @workstation_ami %>"
|
1
|
+
# We have to define these, but we leave them blank so that Terraform
|
2
|
+
# knows to read them from environment vars or ~/.aws/credentials
|
3
|
+
access_key = ""
|
4
|
+
secret_key = ""
|
5
|
+
key_name = ""
|
6
|
+
customer = "wombat"
|
7
|
+
|
8
|
+
# Default AMIs for building the demo
|
9
|
+
ami-chef-server = "<%= @chef_server_ami %>"
|
10
|
+
ami-automate = "<%= @automate_ami %>"
|
11
|
+
ami-build-node = "<%= @automate_builder_ami %>"
|
12
|
+
ami-workstation = "<%= @workstation_ami %>"
|