wombat-cli 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/DESIGN.md +40 -0
- data/Gemfile +3 -0
- data/README.md +132 -0
- data/Rakefile +52 -0
- data/Vagrantfile +121 -0
- data/bin/wombat +24 -0
- data/cookbooks/automate/.gitignore +16 -0
- data/cookbooks/automate/.kitchen.ec2.yml +27 -0
- data/cookbooks/automate/.kitchen.yml +25 -0
- data/cookbooks/automate/Berksfile +6 -0
- data/cookbooks/automate/README.md +4 -0
- data/cookbooks/automate/chefignore +102 -0
- data/cookbooks/automate/libraries/_helper.rb +52 -0
- data/cookbooks/automate/libraries/delivery_api.rb +204 -0
- data/cookbooks/automate/libraries/delivery_project.rb +31 -0
- data/cookbooks/automate/libraries/dsl.rb +5 -0
- data/cookbooks/automate/metadata.rb +13 -0
- data/cookbooks/automate/recipes/default.rb +111 -0
- data/cookbooks/automate/recipes/update-users.rb +48 -0
- data/cookbooks/automate/templates/delivery.erb +5 -0
- data/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -0
- data/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/automate.key +27 -0
- data/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -0
- data/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/chef.key +27 -0
- data/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -0
- data/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -0
- data/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/private.pem +27 -0
- data/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/public.pub +1 -0
- data/cookbooks/automate/test/fixtures/cookbooks/mock_data/metadata.rb +3 -0
- data/cookbooks/automate/test/fixtures/cookbooks/mock_data/recipes/default.rb +27 -0
- data/cookbooks/automate/test/integration/default/automate_spec.rb +55 -0
- data/cookbooks/build_node/.gitignore +16 -0
- data/cookbooks/build_node/.kitchen.ec2.yml +30 -0
- data/cookbooks/build_node/.kitchen.yml +23 -0
- data/cookbooks/build_node/Berksfile +8 -0
- data/cookbooks/build_node/README.md +4 -0
- data/cookbooks/build_node/chefignore +102 -0
- data/cookbooks/build_node/metadata.rb +15 -0
- data/cookbooks/build_node/recipes/default.rb +35 -0
- data/cookbooks/build_node/templates/client.erb +3 -0
- data/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -0
- data/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/automate.key +27 -0
- data/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -0
- data/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/chef.key +27 -0
- data/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -0
- data/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -0
- data/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/private.pem +27 -0
- data/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/public.pub +1 -0
- data/cookbooks/build_node/test/fixtures/cookbooks/mock_data/metadata.rb +2 -0
- data/cookbooks/build_node/test/fixtures/cookbooks/mock_data/recipes/default.rb +18 -0
- data/cookbooks/build_node/test/integration/default/build-node_spec.rb +39 -0
- data/cookbooks/chef_server/.gitignore +16 -0
- data/cookbooks/chef_server/.kitchen.ec2.yml +26 -0
- data/cookbooks/chef_server/.kitchen.yml +25 -0
- data/cookbooks/chef_server/Berksfile +6 -0
- data/cookbooks/chef_server/README.md +4 -0
- data/cookbooks/chef_server/chefignore +102 -0
- data/cookbooks/chef_server/metadata.rb +13 -0
- data/cookbooks/chef_server/recipes/cheffish.rb +91 -0
- data/cookbooks/chef_server/recipes/default.rb +79 -0
- data/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -0
- data/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/automate.key +27 -0
- data/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -0
- data/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/chef.key +27 -0
- data/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -0
- data/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -0
- data/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/private.pem +27 -0
- data/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/public.pub +1 -0
- data/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/metadata.rb +2 -0
- data/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/recipes/default.rb +23 -0
- data/cookbooks/chef_server/test/integration/default/chef_server_spec.rb +47 -0
- data/cookbooks/compliance/.gitignore +16 -0
- data/cookbooks/compliance/.kitchen.ec2.yml +26 -0
- data/cookbooks/compliance/.kitchen.yml +24 -0
- data/cookbooks/compliance/Berksfile +7 -0
- data/cookbooks/compliance/README.md +4 -0
- data/cookbooks/compliance/chefignore +102 -0
- data/cookbooks/compliance/metadata.rb +12 -0
- data/cookbooks/compliance/recipes/default.rb +59 -0
- data/cookbooks/compliance/spec/spec_helper.rb +2 -0
- data/cookbooks/compliance/spec/unit/recipes/default_spec.rb +20 -0
- data/cookbooks/compliance/templates/default/chef-compliance.rb.erb +1 -0
- data/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -0
- data/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/automate.key +27 -0
- data/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -0
- data/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/chef.key +27 -0
- data/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -0
- data/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -0
- data/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/private.pem +27 -0
- data/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/public.pub +1 -0
- data/cookbooks/compliance/test/fixtures/cookbooks/mock_data/metadata.rb +4 -0
- data/cookbooks/compliance/test/fixtures/cookbooks/mock_data/recipes/default.rb +21 -0
- data/cookbooks/compliance/test/integration/default/compliance.rb +27 -0
- data/cookbooks/infranodes/.gitignore +16 -0
- data/cookbooks/infranodes/.kitchen.ec2.yml +27 -0
- data/cookbooks/infranodes/.kitchen.yml +21 -0
- data/cookbooks/infranodes/Berksfile +6 -0
- data/cookbooks/infranodes/README.md +4 -0
- data/cookbooks/infranodes/attributes/default.rb +3 -0
- data/cookbooks/infranodes/chefignore +102 -0
- data/cookbooks/infranodes/metadata.rb +13 -0
- data/cookbooks/infranodes/recipes/default.rb +41 -0
- data/cookbooks/infranodes/spec/spec_helper.rb +2 -0
- data/cookbooks/infranodes/spec/unit/recipes/default_spec.rb +20 -0
- data/cookbooks/infranodes/templates/default/client.rb.erb +5 -0
- data/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -0
- data/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/automate.key +27 -0
- data/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -0
- data/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/chef.key +27 -0
- data/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -0
- data/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -0
- data/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/private.pem +27 -0
- data/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/public.pub +1 -0
- data/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/metadata.rb +3 -0
- data/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/recipes/default.rb +21 -0
- data/cookbooks/infranodes/test/integration/default/infranodes_spec.rb +20 -0
- data/cookbooks/infranodes/test/integration/helpers/serverspec/spec_helper.rb +8 -0
- data/cookbooks/wombat/.gitignore +16 -0
- data/cookbooks/wombat/.kitchen.yml +43 -0
- data/cookbooks/wombat/Berksfile +6 -0
- data/cookbooks/wombat/README.md +4 -0
- data/cookbooks/wombat/attributes/default.rb +71 -0
- data/cookbooks/wombat/attributes/packer.rb +18 -0
- data/cookbooks/wombat/chefignore +102 -0
- data/cookbooks/wombat/metadata.rb +11 -0
- data/cookbooks/wombat/recipes/authorized-keys.rb +10 -0
- data/cookbooks/wombat/recipes/default.rb +112 -0
- data/cookbooks/wombat/recipes/etc-hosts.rb +51 -0
- data/cookbooks/workstation/.gitignore +16 -0
- data/cookbooks/workstation/.kitchen.ec2.yml +29 -0
- data/cookbooks/workstation/.kitchen.yml +22 -0
- data/cookbooks/workstation/Berksfile +7 -0
- data/cookbooks/workstation/README.md +3 -0
- data/cookbooks/workstation/chefignore +102 -0
- data/cookbooks/workstation/files/atom.apm.list +7 -0
- data/cookbooks/workstation/files/atom.config.cson +3 -0
- data/cookbooks/workstation/files/cmder.xml +605 -0
- data/cookbooks/workstation/metadata.rb +14 -0
- data/cookbooks/workstation/recipes/browser.rb +45 -0
- data/cookbooks/workstation/recipes/certs-keys.rb +44 -0
- data/cookbooks/workstation/recipes/chef.rb +29 -0
- data/cookbooks/workstation/recipes/default.rb +16 -0
- data/cookbooks/workstation/recipes/dotnet.rb +17 -0
- data/cookbooks/workstation/recipes/editor.rb +19 -0
- data/cookbooks/workstation/recipes/profile.rb +42 -0
- data/cookbooks/workstation/recipes/terminal.rb +13 -0
- data/cookbooks/workstation/templates/default/bookmarks.html.erb +23 -0
- data/cookbooks/workstation/templates/default/data_collector.rb.erb +2 -0
- data/cookbooks/workstation/templates/default/ise_profile.ps1.erb +11 -0
- data/cookbooks/workstation/templates/default/knife.rb.erb +10 -0
- data/cookbooks/workstation/templates/default/master_preferences.json.erb +28 -0
- data/cookbooks/workstation/templates/default/ssh_config.erb +16 -0
- data/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/chef-server.crt +26 -0
- data/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/chef-server.key +27 -0
- data/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -0
- data/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -0
- data/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/delivery.crt +26 -0
- data/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/delivery.key +27 -0
- data/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/private.pem +27 -0
- data/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/public.pub +1 -0
- data/cookbooks/workstation/test/fixtures/cookbooks/mock_data/metadata.rb +2 -0
- data/cookbooks/workstation/test/fixtures/cookbooks/mock_data/recipes/default.rb +21 -0
- data/cookbooks/workstation/test/integration/default/workstation_spec.rb +37 -0
- data/keys/.gitkeep +0 -0
- data/lib/wombat/build.rb +195 -0
- data/lib/wombat/cli.rb +169 -0
- data/lib/wombat/common.rb +163 -0
- data/lib/wombat/delete.rb +28 -0
- data/lib/wombat/deploy.rb +105 -0
- data/lib/wombat/output.rb +45 -0
- data/lib/wombat/version.rb +3 -0
- data/lib/wombat.rb +8 -0
- data/logs/.gitkeep +0 -0
- data/packer/automate.json +108 -0
- data/packer/build-node.json +114 -0
- data/packer/chef-server.json +106 -0
- data/packer/compliance.json +106 -0
- data/packer/files/.gitkeep +0 -0
- data/packer/infranodes.json +108 -0
- data/packer/mock-data/.gitignore +16 -0
- data/packer/mock-data/.kitchen.yml +21 -0
- data/packer/mock-data/Berksfile +3 -0
- data/packer/mock-data/README.md +4 -0
- data/packer/mock-data/chefignore +102 -0
- data/packer/mock-data/metadata.rb +7 -0
- data/packer/mock-data/recipes/default.rb +69 -0
- data/packer/mock-data/spec/spec_helper.rb +2 -0
- data/packer/mock-data/spec/unit/recipes/default_spec.rb +20 -0
- data/packer/mock-data/test/integration/default/serverspec/default_spec.rb +9 -0
- data/packer/mock-data/test/integration/helpers/serverspec/spec_helper.rb +8 -0
- data/packer/workstation.json +97 -0
- data/templates/bootstrap-aws.erb +36 -0
- data/templates/cfn.json.erb +661 -0
- data/terraform/README.md +13 -0
- data/terraform/templates/terraform.tfvars.erb +12 -0
- data/terraform/wombat.tf +328 -0
- data/wombat-cli.gemspec +32 -0
- data/wombat.example.yml +52 -0
- metadata +331 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Put files/directories that should be ignored in this file when uploading
|
|
2
|
+
# to a chef-server or supermarket.
|
|
3
|
+
# Lines that start with '# ' are comments.
|
|
4
|
+
|
|
5
|
+
# OS generated files #
|
|
6
|
+
######################
|
|
7
|
+
.DS_Store
|
|
8
|
+
Icon?
|
|
9
|
+
nohup.out
|
|
10
|
+
ehthumbs.db
|
|
11
|
+
Thumbs.db
|
|
12
|
+
|
|
13
|
+
# SASS #
|
|
14
|
+
########
|
|
15
|
+
.sass-cache
|
|
16
|
+
|
|
17
|
+
# EDITORS #
|
|
18
|
+
###########
|
|
19
|
+
\#*
|
|
20
|
+
.#*
|
|
21
|
+
*~
|
|
22
|
+
*.sw[a-z]
|
|
23
|
+
*.bak
|
|
24
|
+
REVISION
|
|
25
|
+
TAGS*
|
|
26
|
+
tmtags
|
|
27
|
+
*_flymake.*
|
|
28
|
+
*_flymake
|
|
29
|
+
*.tmproj
|
|
30
|
+
.project
|
|
31
|
+
.settings
|
|
32
|
+
mkmf.log
|
|
33
|
+
|
|
34
|
+
## COMPILED ##
|
|
35
|
+
##############
|
|
36
|
+
a.out
|
|
37
|
+
*.o
|
|
38
|
+
*.pyc
|
|
39
|
+
*.so
|
|
40
|
+
*.com
|
|
41
|
+
*.class
|
|
42
|
+
*.dll
|
|
43
|
+
*.exe
|
|
44
|
+
*/rdoc/
|
|
45
|
+
|
|
46
|
+
# Testing #
|
|
47
|
+
###########
|
|
48
|
+
.watchr
|
|
49
|
+
.rspec
|
|
50
|
+
spec/*
|
|
51
|
+
spec/fixtures/*
|
|
52
|
+
test/*
|
|
53
|
+
features/*
|
|
54
|
+
examples/*
|
|
55
|
+
Guardfile
|
|
56
|
+
Procfile
|
|
57
|
+
.kitchen*
|
|
58
|
+
.rubocop.yml
|
|
59
|
+
spec/*
|
|
60
|
+
Rakefile
|
|
61
|
+
.travis.yml
|
|
62
|
+
.foodcritic
|
|
63
|
+
.codeclimate.yml
|
|
64
|
+
|
|
65
|
+
# SCM #
|
|
66
|
+
#######
|
|
67
|
+
.git
|
|
68
|
+
*/.git
|
|
69
|
+
.gitignore
|
|
70
|
+
.gitmodules
|
|
71
|
+
.gitconfig
|
|
72
|
+
.gitattributes
|
|
73
|
+
.svn
|
|
74
|
+
*/.bzr/*
|
|
75
|
+
*/.hg/*
|
|
76
|
+
*/.svn/*
|
|
77
|
+
|
|
78
|
+
# Berkshelf #
|
|
79
|
+
#############
|
|
80
|
+
Berksfile
|
|
81
|
+
Berksfile.lock
|
|
82
|
+
cookbooks/*
|
|
83
|
+
tmp
|
|
84
|
+
|
|
85
|
+
# Cookbooks #
|
|
86
|
+
#############
|
|
87
|
+
CONTRIBUTING*
|
|
88
|
+
CHANGELOG*
|
|
89
|
+
TESTING*
|
|
90
|
+
MAINTAINERS.toml
|
|
91
|
+
|
|
92
|
+
# Strainer #
|
|
93
|
+
############
|
|
94
|
+
Colanderfile
|
|
95
|
+
Strainerfile
|
|
96
|
+
.colander
|
|
97
|
+
.strainer
|
|
98
|
+
|
|
99
|
+
# Vagrant #
|
|
100
|
+
###########
|
|
101
|
+
.vagrant
|
|
102
|
+
Vagrantfile
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: mock-data
|
|
3
|
+
# Recipe:: default
|
|
4
|
+
#
|
|
5
|
+
# Copyright (c) 2016 The Authors, All Rights Reserved.
|
|
6
|
+
|
|
7
|
+
require 'cheffish'
|
|
8
|
+
Chef::Config.ssl_verify_mode :verify_none
|
|
9
|
+
|
|
10
|
+
config = {
|
|
11
|
+
:chef_server_url => 'https://chef',
|
|
12
|
+
:options => {
|
|
13
|
+
:client_name => 'pivotal',
|
|
14
|
+
:signing_key_filename => '/etc/opscode/pivotal.pem'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
#taken from cheffish
|
|
19
|
+
chef_user 'automate' do
|
|
20
|
+
chef_server config
|
|
21
|
+
admin true
|
|
22
|
+
display_name 'automate'
|
|
23
|
+
email 'chefeval@chef.io'
|
|
24
|
+
password 'automate'
|
|
25
|
+
source_key_path '/tmp/private.pem'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
chef_user 'workstation' do
|
|
29
|
+
chef_server config
|
|
30
|
+
admin true
|
|
31
|
+
display_name 'workstation'
|
|
32
|
+
email 'workstation@chef.io'
|
|
33
|
+
password 'workstation'
|
|
34
|
+
source_key_path '/tmp/private.pem'
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
chef_organization "#{ENV['ORG']}" do
|
|
38
|
+
members ['automate', 'workstation']
|
|
39
|
+
chef_server config
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
conf_with_org = config.merge({
|
|
43
|
+
:chef_server_url => "#{config[:chef_server_url]}/organizations/#{ENV['ORG']}"
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
build_nodes = []
|
|
47
|
+
num = ENV['BUILD_NODES'].to_i
|
|
48
|
+
|
|
49
|
+
1.upto(num) do |i|
|
|
50
|
+
build_nodes << "build-node-#{i}"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
build_nodes.each do |node_name|
|
|
54
|
+
chef_node node_name do
|
|
55
|
+
tag 'delivery-build-node'
|
|
56
|
+
chef_server conf_with_org
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
chef_client node_name do
|
|
60
|
+
source_key_path '/tmp/private.pem'
|
|
61
|
+
chef_server conf_with_org
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
chef_acl "" do
|
|
66
|
+
rights :all, users: %w(automate workstation), clients: build_nodes
|
|
67
|
+
recursive true
|
|
68
|
+
chef_server conf_with_org
|
|
69
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: mock-data
|
|
3
|
+
# Spec:: default
|
|
4
|
+
#
|
|
5
|
+
# Copyright (c) 2016 The Authors, All Rights Reserved.
|
|
6
|
+
|
|
7
|
+
require 'spec_helper'
|
|
8
|
+
|
|
9
|
+
describe 'mock-data::default' do
|
|
10
|
+
context 'When all attributes are default, on an unspecified platform' do
|
|
11
|
+
let(:chef_run) do
|
|
12
|
+
runner = ChefSpec::ServerRunner.new
|
|
13
|
+
runner.converge(described_recipe)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'converges successfully' do
|
|
17
|
+
expect { chef_run }.to_not raise_error
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"variables": {
|
|
3
|
+
"aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
|
|
4
|
+
"aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
|
|
5
|
+
"aws_region": "{{env `AWS_REGION`}}",
|
|
6
|
+
"aws_source_ami": "ami-87c037e7",
|
|
7
|
+
"azure_client_id": "{{env `AZURE_CLIENT_ID`}}",
|
|
8
|
+
"azure_tenant_id": "{{env `AZURE_TENANT_ID`}}",
|
|
9
|
+
"azure_client_secret": "{{env `AZURE_CLIENT_SECRET`}}",
|
|
10
|
+
"azure_subscription_id": "{{env `AZURE_SUBSCRIPTION_ID`}}",
|
|
11
|
+
"azure_storage_account": "{{env `AZURE_STORAGE_ACCOUNT`}}",
|
|
12
|
+
"azure_resource_group": "{{env `AZURE_RESOURCE_GROUP`}}",
|
|
13
|
+
"gce_account_file": "{{env `GCE_ACCOUNT_FILE`}}",
|
|
14
|
+
"gce_project_id": "{{env `GCE_PROJECT_ID`}}",
|
|
15
|
+
"gce_zone": "{{env `GCE_ZONE`}}",
|
|
16
|
+
"gce_source_image": "windows-server-2012-r2-dc-v20160809",
|
|
17
|
+
"build-nodes": "1",
|
|
18
|
+
"chefdk": "stable-latest",
|
|
19
|
+
"domain_prefix": "",
|
|
20
|
+
"domain": "animals.biz",
|
|
21
|
+
"enterprise": "mammals",
|
|
22
|
+
"org": "marsupials",
|
|
23
|
+
"winrm_password": "RL9@T40BTmXh",
|
|
24
|
+
"winrm_username": "Administrator",
|
|
25
|
+
"workstation-number": "1",
|
|
26
|
+
"workstations": "1"
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
"builders": [
|
|
30
|
+
{ "type": "amazon-ebs",
|
|
31
|
+
"access_key": "{{user `aws_access_key`}}",
|
|
32
|
+
"secret_key": "{{user `aws_secret_key`}}",
|
|
33
|
+
"region": "{{user `aws_region`}}",
|
|
34
|
+
"source_ami": "{{user `aws_source_ami`}}",
|
|
35
|
+
"instance_type": "m3.large",
|
|
36
|
+
"communicator": "winrm",
|
|
37
|
+
"associate_public_ip_address": true,
|
|
38
|
+
"ssh_private_ip": false,
|
|
39
|
+
"winrm_port": 5985,
|
|
40
|
+
"winrm_username": "{{user `winrm_username`}}",
|
|
41
|
+
"winrm_password": "{{user `winrm_password`}}",
|
|
42
|
+
"user_data_file": "{{template_dir}}/scripts/bootstrap-aws.txt",
|
|
43
|
+
"ami_name": "workstation-{{user `workstation-number`}}-{{timestamp}}"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"type": "googlecompute",
|
|
47
|
+
"account_file": "{{user `gce_account_file`}}",
|
|
48
|
+
"project_id": "{{user `gce_project_id`}}",
|
|
49
|
+
"source_image": "{{user `gce_source_image`}}",
|
|
50
|
+
"zone": "{{user `gce_zone`}}",
|
|
51
|
+
"disk_type": "pd-ssd",
|
|
52
|
+
"disk_size": "80",
|
|
53
|
+
"machine_type": "n1-highcpu-8",
|
|
54
|
+
"image_name": "workstation-{{user `workstation-number`}}-{{timestamp}}",
|
|
55
|
+
"communicator": "winrm",
|
|
56
|
+
"winrm_port": 5985,
|
|
57
|
+
"winrm_username": "{{user `winrm_username`}}",
|
|
58
|
+
"winrm_password": "{{user `winrm_password`}}",
|
|
59
|
+
"metadata": {
|
|
60
|
+
"windows-startup-script-ps1": "gs://wombat-bootstrap/win-bootstrap.ps1"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
|
|
65
|
+
"provisioners" : [
|
|
66
|
+
{
|
|
67
|
+
"type": "file",
|
|
68
|
+
"source": "{{pwd}}/keys/",
|
|
69
|
+
"destination": "C:\\Windows\\Temp"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"type": "file",
|
|
73
|
+
"source": "{{template_dir}}/files/",
|
|
74
|
+
"destination": "C:\\Windows\\Temp"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"type": "chef-solo",
|
|
78
|
+
"install_command": "powershell.exe -Command \". { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; install -channel {{user `chef_channel`}} -version {{user `chef_ver`}}\"",
|
|
79
|
+
"guest_os_type": "windows",
|
|
80
|
+
"cookbook_paths": [ "{{pwd}}/vendored-cookbooks/workstation" ],
|
|
81
|
+
"run_list": [ "workstation" ],
|
|
82
|
+
"json": {
|
|
83
|
+
"demo": {
|
|
84
|
+
"domain_prefix": "{{user `domain_prefix`}}",
|
|
85
|
+
"domain": "{{user `domain`}}",
|
|
86
|
+
"enterprise": "{{user `enterprise`}}",
|
|
87
|
+
"org": "{{user `org`}}",
|
|
88
|
+
"workstation-number": "{{user `workstation-number`}}",
|
|
89
|
+
"build-nodes": "{{user `build-nodes`}}",
|
|
90
|
+
"versions": {
|
|
91
|
+
"chefdk": "{{user `chefdk`}}"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<powershell>
|
|
2
|
+
|
|
3
|
+
write-output "Running User Data Script"
|
|
4
|
+
write-host "(host) Running User Data Script"
|
|
5
|
+
|
|
6
|
+
# set administrator password
|
|
7
|
+
cmd.exe /c net user Administrator <%= @workstation_passwd %>
|
|
8
|
+
|
|
9
|
+
# RDP
|
|
10
|
+
cmd.exe /c netsh advfirewall firewall add rule name="Open Port 3389" dir=in action=allow protocol=TCP localport=3389
|
|
11
|
+
cmd.exe /c reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
|
|
12
|
+
|
|
13
|
+
# WinRM
|
|
14
|
+
write-output "Setting up WinRM"
|
|
15
|
+
write-host "(host) setting up WinRM"
|
|
16
|
+
|
|
17
|
+
cmd.exe /c winrm quickconfig -q
|
|
18
|
+
cmd.exe /c winrm quickconfig '-transport:http'
|
|
19
|
+
cmd.exe /c winrm set "winrm/config" '@{MaxTimeoutms="1800000"}'
|
|
20
|
+
cmd.exe /c winrm set "winrm/config/winrs" '@{MaxMemoryPerShellMB="512"}'
|
|
21
|
+
cmd.exe /c winrm set "winrm/config/service" '@{AllowUnencrypted="true"}'
|
|
22
|
+
cmd.exe /c winrm set "winrm/config/client" '@{AllowUnencrypted="true"}'
|
|
23
|
+
cmd.exe /c winrm set "winrm/config/service/auth" '@{Basic="true"}'
|
|
24
|
+
cmd.exe /c winrm set "winrm/config/client/auth" '@{Basic="true"}'
|
|
25
|
+
cmd.exe /c winrm set "winrm/config/service/auth" '@{CredSSP="true"}'
|
|
26
|
+
cmd.exe /c winrm set "winrm/config/listener?Address=*+Transport=HTTP" '@{Port="5985"}'
|
|
27
|
+
cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
|
|
28
|
+
cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985"
|
|
29
|
+
cmd.exe /c net stop winrm
|
|
30
|
+
cmd.exe /c sc config winrm start= auto
|
|
31
|
+
cmd.exe /c net start winrm
|
|
32
|
+
cmd.exe /c wmic useraccount where "name='Administrator'" set PasswordExpires=FALSE
|
|
33
|
+
|
|
34
|
+
Set-ExecutionPolicy Unrestricted
|
|
35
|
+
|
|
36
|
+
</powershell>
|