wombat-cli 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -0
  3. data/.travis.yml +27 -0
  4. data/CHANGELOG.md +15 -1
  5. data/Gemfile +3 -0
  6. data/README.md +2 -2
  7. data/Rakefile +25 -0
  8. data/bin/wombat +1 -1
  9. data/generator_files/cookbooks/automate/metadata.rb +1 -1
  10. data/generator_files/cookbooks/automate/recipes/update-users.rb +1 -1
  11. data/generator_files/cookbooks/chef_server/recipes/default.rb +24 -11
  12. data/generator_files/cookbooks/workstation/.kitchen.ec2.yml +2 -1
  13. data/generator_files/cookbooks/workstation/metadata.rb +1 -1
  14. data/generator_files/cookbooks/workstation/recipes/default.rb +1 -2
  15. data/generator_files/cookbooks/workstation/templates/default/ise_profile.ps1.erb +2 -2
  16. data/generator_files/cookbooks/workstation/test/integration/default/workstation_spec.rb +4 -4
  17. data/generator_files/packer/automate.json +129 -107
  18. data/generator_files/packer/build-node.json +134 -112
  19. data/generator_files/packer/chef-server.json +130 -108
  20. data/generator_files/packer/compliance.json +126 -104
  21. data/generator_files/packer/infranodes-windows.json +136 -97
  22. data/generator_files/packer/infranodes.json +127 -106
  23. data/generator_files/packer/workstation.json +134 -95
  24. data/generator_files/templates/arm.json.erb +576 -0
  25. data/generator_files/wombat.yml +6 -2
  26. data/lib/wombat/aws.rb +67 -0
  27. data/lib/wombat/build.rb +273 -184
  28. data/lib/wombat/cli.rb +182 -147
  29. data/lib/wombat/common.rb +228 -220
  30. data/lib/wombat/crypto.rb +65 -0
  31. data/lib/wombat/delete.rb +48 -18
  32. data/lib/wombat/deploy.rb +147 -34
  33. data/lib/wombat/init.rb +21 -19
  34. data/lib/wombat/latest.rb +27 -0
  35. data/lib/wombat/output.rb +31 -30
  36. data/lib/wombat/update.rb +13 -10
  37. data/lib/wombat/version.rb +1 -1
  38. data/spec/functional/common_spec.rb +26 -0
  39. data/spec/spec_helper.rb +103 -0
  40. data/spec/unit/common_spec.rb +116 -0
  41. data/wombat-cli.gemspec +2 -1
  42. metadata +36 -11
  43. /data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/{delivery.crt → automate.crt} +0 -0
  44. /data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/{delivery.key → automate.key} +0 -0
  45. /data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/{chef-server.crt → chef.crt} +0 -0
  46. /data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/{chef-server.key → chef.key} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb1dde9cdeddd5be9adf57151011076989314185
4
- data.tar.gz: 4e978f5f7614cf027d1253a8dca6af5a19718f9b
3
+ metadata.gz: 4813af6ebde7741373463711fe1de2c8d26ca338
4
+ data.tar.gz: 46c222e69a359a9fbd5ea212badbf3a474bfe0f1
5
5
  SHA512:
6
- metadata.gz: f15e12d70edf2f52397b24a7d4d569fb8d8f49128df723d01681cbcc540a14852b19a3e60485ef6aa68b14f9111f403c11132760be0e36b27041c4605e4ea20c
7
- data.tar.gz: a75640c06a484a88fb1f4b150d30c6d8d90d8f8df8d9b51d13edbfbc34dab03c7efb27e6303f9be4a2ea758bcd38010198d0cbc7b62c0f97cadf548977d82b63
6
+ metadata.gz: 9c9c77b5b678e92f7e259ff95e96e4307d0392c3d34e6d7c1622b6423683121fa0fab8137296c2f6c93359c6badb5b60cff45a7c9555546ce8a709b15e2ee8d3
7
+ data.tar.gz: dba71212dd430556d1a4375d177eecda28de86d0476c538c0e463fa25dc49b16c099cf8e4b70cc6bc2478d723ce375aa487cece244f109962f349f6e53ea328a
data/.gitignore CHANGED
@@ -11,9 +11,13 @@ vendored-cookbooks
11
11
  cloudformation/*.json
12
12
  keys/*
13
13
  packer/keys/*
14
+ generator_files/keys/*
14
15
  *.lock
15
16
  infranodes-info.json
16
17
  output
17
18
  bootstrap-aws.txt
18
19
  *.gem
19
20
  stacks/*
21
+ .envrc
22
+ .direnv
23
+ .ruby-version
data/.travis.yml ADDED
@@ -0,0 +1,27 @@
1
+ language: ruby
2
+ cache: bundler
3
+
4
+ sudo: false
5
+
6
+ branches:
7
+ only:
8
+ - master
9
+
10
+ before_install:
11
+ - gem update --system
12
+ - gem --version
13
+ - gem uninstall bundler -a -x -I
14
+ - rvm @global do gem uninstall bundler -a -x -I
15
+ - gem install bundler
16
+ - bundle --version
17
+ - rm -f .bundle/config
18
+ rvm:
19
+ - 2.3.3
20
+ - 2.4.0
21
+ - ruby-head
22
+
23
+ allow_failures:
24
+ - rvm: ruby-head
25
+
26
+ script:
27
+ - bundle exec rake spec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Change Log
2
2
 
3
+ ## [v0.4.0](https://github.com/chef-cft/wombat/tree/v0.4.0) (2017-02-10)
4
+ [Full Changelog](https://github.com/chef-cft/wombat/compare/v0.3.4...v0.4.0)
5
+
6
+ **Implemented enhancements:**
7
+ - Decrease data\_collector timeout during build [\#262](https://github.com/chef-cft/wombat/issues/262)
8
+ - Add new command`latest` for getting latest cloud images [\#289](https://github.com/chef-cft/wombat/pull/289) ([cheeseplus](https://github.com/cheeseplus))
9
+ - add cli option, env variable, and default wombat.yml [\#266](https://github.com/chef-cft/wombat/pull/266) ([andrewelizondo](https://github.com/andrewelizondo))
10
+ - Fixes for changed automate api [\#283](https://github.com/chef-cft/wombat/pull/283) ([binamov](https://github.com/binamov))
11
+ - Re-enable .NET speed optimizations [\#264](https://github.com/chef-cft/wombat/pull/264) ([nweddle](https://github.com/nweddle))
12
+ - Namespacing and spec tests [\#281](https://github.com/chef-cft/wombat/pull/281) ([cheeseplus](https://github.com/cheeseplus))
13
+ - Implement TravisCI [\#290](https://github.com/chef-cft/wombat/pull/290) ([cheeseplus](https://github.com/cheeseplus))
14
+ - Refactor how source\_ami/image work [\#288](https://github.com/chef-cft/wombat/pull/288) ([cheeseplus](https://github.com/cheeseplus))
15
+ - Lots of Azure support work by ([russellseymour](https://github.com/russellseymour))
16
+
3
17
  ## [v0.3.4](https://github.com/chef-cft/wombat/tree/v0.3.4) (2016-12-07)
4
18
  [Full Changelog](https://github.com/chef-cft/wombat/compare/v0.3.3...v0.3.4)
5
19
 
@@ -35,4 +49,4 @@
35
49
 
36
50
 
37
51
 
38
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
52
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/Gemfile CHANGED
@@ -1,3 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
5
+ gem "chefstyle"
6
+ gem "rspec"
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/wombat-cli.svg)](http://badge.fury.io/rb/wombat-cli)
2
-
2
+ [![Build Status](https://travis-ci.org/chef-cft/wombat.svg?branch=master)](https://travis-ci.org/chef-cft/wombat)
3
3
  [![Stories in Ready](https://badge.waffle.io/chef-cft/wombat.png?label=ready&title=Ready)](https://waffle.io/chef-cft/wombat)
4
4
 
5
5
  # Wombat
@@ -26,7 +26,7 @@ Follow the instructions at https://docs.chef.io/install_dk.html to install and c
26
26
 
27
27
  ##### Install Packer
28
28
 
29
- Downloads are here: https://www.packer.io/downloads.html. The binary must be in $PATH for `wombat build`
29
+ Downloads are here: https://www.packer.io/downloads.html. The binary must be in $PATH for `wombat build`
30
30
 
31
31
  ##### Download your Automate license key
32
32
  Automate requires a valid license to activate successfully. **If you do
data/Rakefile CHANGED
@@ -1 +1,26 @@
1
1
  require 'bundler/gem_tasks'
2
+
3
+ begin
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new do |t|
7
+ t.pattern = "spec/**/*_spec.rb"
8
+ end
9
+ rescue LoadError
10
+ desc "rspec is not installed, this task is disabled"
11
+ task :spec do
12
+ abort "rspec is not installed. `(sudo) gem install rspec` to run unit tests"
13
+ end
14
+ end
15
+
16
+ task :default => :spec
17
+
18
+ begin
19
+ require "chefstyle"
20
+ require "rubocop/rake_task"
21
+ RuboCop::RakeTask.new(:style) do |task|
22
+ task.options += ["--display-cop-names", "--no-color"]
23
+ end
24
+ rescue LoadError
25
+ puts "chefstyle/rubocop is not available. gem install chefstyle to do style checking."
26
+ end
data/bin/wombat CHANGED
@@ -17,7 +17,7 @@ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), %w[.. lib])
17
17
  require "wombat/cli"
18
18
 
19
19
  begin
20
- Runner.new(Options.parse(ARGV)).start
20
+ Wombat::Runner.new(Wombat::Options.parse(ARGV)).start
21
21
  rescue => ex
22
22
  $stderr.puts ">>> #{ex.message}"
23
23
  exit(($? && $?.exitstatus) || 99)
@@ -4,7 +4,7 @@ maintainer_email 'you@example.com'
4
4
  license 'all_rights'
5
5
  description 'Installs/Configures automate'
6
6
  long_description 'Installs/Configures automate'
7
- version '0.2.0'
7
+ version '0.2.1'
8
8
 
9
9
  depends 'chef-ingredient'
10
10
  depends 'line'
@@ -34,7 +34,7 @@ ruby_block "Create Delivery Users" do
34
34
 
35
35
  # Set Password
36
36
  if info['password']
37
- delivery_api.post("/internal-users/#{username}/reset-password", { "password" => info['password'] })
37
+ delivery_api.post("/internal-users/#{username}/change-password", { "password" => info['password'] })
38
38
  end
39
39
  end
40
40
  end
@@ -35,20 +35,26 @@ end
35
35
  end
36
36
 
37
37
  chef_ingredient 'chef-server' do
38
+ action [ :install, :reconfigure ]
38
39
  channel node['demo']['versions']['chef-server'].split('-')[0].to_sym
39
40
  version node['demo']['versions']['chef-server'].split('-')[1]
41
+ config <<-EOH
42
+ api_fqdn 'chef.#{node['demo']['domain']}'
43
+ data_collector['root_url'] = 'https://#{node['demo']['domain_prefix']}automate.#{node['demo']['domain']}/data-collector/v0/'
44
+ data_collector['token'] = "#{node['demo']['data_collector_token']}"
45
+ profiles["root_url"] = "https://#{node['demo']['domain_prefix']}automate.#{node['demo']['domain']}"
46
+ EOH
40
47
  end
41
48
 
42
- chef_ingredient 'chef-server' do
43
- action :reconfigure
44
- config <<-EOH
45
- api_fqdn 'chef.#{node['demo']['domain']}'
46
- data_collector['root_url'] = 'https://#{node['demo']['domain_prefix']}automate.#{node['demo']['domain']}/data-collector/v0/'
47
- data_collector['token'] = "#{node['demo']['data_collector_token']}"
48
- profiles["root_url"] = "https://#{node['demo']['domain_prefix']}automate.#{node['demo']['domain']}"
49
- EOH
49
+ # Temporarily reduced timeout to speed up the build.
50
+ append_if_no_line "Append a 1ms timeout for the data collector" do
51
+ path "/etc/opscode/chef-server.rb"
52
+ line "data_collector['timeout'] = '1'"
50
53
  end
51
54
 
55
+ # Use an execute block so we don't revert the config.
56
+ execute 'chef-server-ctl reconfigure'
57
+
52
58
  if node['platform'] == 'centos'
53
59
  # hardcoding this one as other permutations are known broken
54
60
  filename = 'opscode-push-jobs-server-1.1.6-1.x86_64.rpm'
@@ -83,9 +89,8 @@ chef_ingredient 'manage' do
83
89
  action :install
84
90
  end
85
91
 
86
- chef_ingredient 'chef-server' do
87
- action :reconfigure
88
- end
92
+ # Another execute block. Keep our temp config until we finish.
93
+ execute 'chef-server-ctl reconfigure'
89
94
 
90
95
  chef_ingredient 'manage' do
91
96
  accept_license true
@@ -94,7 +99,15 @@ end
94
99
 
95
100
  include_recipe 'chef_server::bootstrap_users'
96
101
 
102
+ # Temporary timeout no longer required. We can return to defaults now.
103
+ delete_lines "Remove the data_collector timeout before we finish." do
104
+ path "/etc/opscode/chef-server.rb"
105
+ pattern "^.*data_collector.*timeout.*"
106
+ notifies :reconfigure, 'chef_ingredient[chef-server]', :immediately
107
+ end
108
+
97
109
  delete_lines "Remove temporary hostfile entry we added earlier" do
98
110
  path "/etc/hosts"
99
111
  pattern "^#{node['ipaddress']}.*#{node['demo']['domain_prefix']}chef\.#{node['demo']['domain']}.*chef"
100
112
  end
113
+
@@ -16,13 +16,14 @@ provisioner:
16
16
  platforms:
17
17
  - name: windows-2012r2
18
18
  driver:
19
- image_id: ami-1719f677
19
+ image_id: ami-1c7ad77c
20
20
  transport:
21
21
  ssh_key: <%= ENV["EC2_SSH_KEY_PATH"] %>
22
22
 
23
23
  suites:
24
24
  - name: default
25
25
  run_list:
26
+ - recipe[mock_data]
26
27
  - recipe[workstation]
27
28
 
28
29
  verifier:
@@ -4,7 +4,7 @@ maintainer_email 'cheeseplus@chef.io'
4
4
  license 'Apache 2.0'
5
5
  description 'Configures a Windows workstation'
6
6
  long_description 'Configures a Windows workstation'
7
- version '0.2.4'
7
+ version '0.2.6'
8
8
  supports 'windows'
9
9
 
10
10
  depends 'chocolatey'
@@ -17,5 +17,4 @@ include_recipe 'workstation::editor'
17
17
  include_recipe 'workstation::chef'
18
18
  include_recipe 'workstation::profile'
19
19
  include_recipe 'wombat::etc-hosts'
20
- # disable while we figure out why this broke
21
- # include_recipe 'workstation::dotnet'
20
+ include_recipe 'workstation::dotnet'
@@ -1,5 +1,5 @@
1
- # Load posh-git example profile
2
- . '<%= @home %>\Documents\WindowsPowerShell\Modules\posh-git\profile.example.ps1'
1
+ # Load posh-git
2
+ Import-Module posh-git
3
3
 
4
4
  # Load PSReadline
5
5
  Import-Module PSReadLine
@@ -28,10 +28,10 @@ describe command('choco list -l git-credential-manager-for-windows') do
28
28
  its(:stdout) { should match(/1 packages installed\./) }
29
29
  end
30
30
 
31
- describe command('choco list -l visualstudiocode') do
32
- its(:stdout) { should match(/1 packages installed\./) }
31
+ describe command('Get-Module -ListAvailable -Name posh-git') do
32
+ its(:stdout) { should match(/Script 0.7.0 posh-git/) }
33
33
  end
34
34
 
35
- describe command('choco list -l poshgit') do
36
- its(:stdout) { should match(/1 packages installed\./) }
35
+ describe file('C:\Users\Administrator\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1') do
36
+ its('content') { should match(/Import-Module posh-git/) }
37
37
  end
@@ -1,110 +1,132 @@
1
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-8e0b9499",
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": "ubuntu-1404-trusty-v20160809a",
17
- "build-nodes": "1",
18
- "chef_channel": "stable",
19
- "chef_install_url": "curl -L https://omnitruck.chef.io/install.sh",
20
- "chef_ver": "latest",
21
- "chefdk": "stable-latest",
22
- "automate": "stable-latest",
23
- "domain": "animals.biz",
24
- "domain_prefix": "",
25
- "enterprise": "mammals",
26
- "org": "marsupials",
27
- "workstations": "1",
28
- "ssh_username": "ubuntu"
29
- },
30
-
31
- "builders": [
32
- { "type": "amazon-ebs",
33
- "access_key": "{{user `aws_access_key`}}",
34
- "secret_key": "{{user `aws_secret_key`}}",
35
- "region": "{{user `aws_region`}}",
36
- "source_ami": "{{user `aws_source_ami`}}",
37
- "instance_type": "t2.medium",
38
- "communicator": "ssh",
39
- "associate_public_ip_address": true,
40
- "ssh_private_ip": false,
41
- "ssh_username": "{{user `ssh_username`}}",
42
- "ssh_pty" : true,
43
- "ami_name": "automate-{{timestamp}}"
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-8e0b9499",
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
+ "azure_object_id": "{{env `AZURE_OBJECT_ID`}}",
14
+ "azure_location": "",
15
+ "gce_account_file": "{{env `GCE_ACCOUNT_FILE`}}",
16
+ "gce_project_id": "{{env `GCE_PROJECT_ID`}}",
17
+ "gce_zone": "{{env `GCE_ZONE`}}",
18
+ "gce_source_image": "ubuntu-1404-trusty-v20160809a",
19
+ "build-nodes": "1",
20
+ "chef_channel": "stable",
21
+ "chef_install_url": "curl -L https://omnitruck.chef.io/install.sh",
22
+ "chef_ver": "latest",
23
+ "chefdk": "stable-latest",
24
+ "automate": "stable-latest",
25
+ "domain": "animals.biz",
26
+ "domain_prefix": "",
27
+ "enterprise": "mammals",
28
+ "org": "marsupials",
29
+ "workstations": "1",
30
+ "ssh_username": "ubuntu"
44
31
  },
45
- {
46
- "type": "azure-arm",
47
- "client_id": "{{user `azure_client_id`}}",
48
- "client_secret": "{{user `azure_client_secret`}}",
49
- "resource_group_name": "{{user `azure_resource_group`}}",
50
- "storage_account": "{{user `azure_storage_account`}}",
51
- "subscription_id": "{{user `azure_subscription_id`}}",
52
- "tenant_id": "{{user `azure_tenant_id`}}",
53
- "capture_container_name": "images",
54
- "capture_name_prefix": "automate",
55
- "image_publisher": "Canonical",
56
- "image_offer": "UbuntuServer",
57
- "image_sku": "14.04.3-LTS",
58
- "location": "West US",
59
- "vm_size": "Standard_D3_V2",
60
- "os_type": "Linux"
61
- },
62
- {
63
- "type": "googlecompute",
64
- "account_file": "{{user `gce_account_file`}}",
65
- "project_id": "{{user `gce_project_id`}}",
66
- "source_image": "{{user `gce_source_image`}}",
67
- "zone": "{{user `gce_zone`}}",
68
- "disk_type": "pd-ssd",
69
- "disk_size": "80",
70
- "image_name": "automate-{{timestamp}}",
71
- "machine_type": "n1-standard-2",
72
- "ssh_username": "{{user `ssh_username`}}",
73
- "ssh_pty" : true
74
- }
75
- ],
76
-
77
- "provisioners" : [
78
- {
79
- "type": "file",
80
- "source": "{{template_dir}}/files/",
81
- "destination": "/tmp"
82
- },
83
- {
84
- "type": "file",
85
- "source": "{{pwd}}/keys/",
86
- "destination": "/tmp"
87
- },
88
- {
89
- "type": "chef-solo",
90
- "install_command": "{{user `chef_install_url`}} | sudo bash -s -- -c {{user `chef_channel`}} -v {{user `chef_ver`}}",
91
- "cookbook_paths": [ "{{pwd}}/vendored-cookbooks/automate" ],
92
- "run_list": [ "automate", "wombat::authorized-keys", "wombat::etc-hosts" ],
93
- "json": {
94
- "demo": {
95
- "admin-user": "{{user `ssh_username`}}",
96
- "domain_prefix": "{{user `domain_prefix`}}",
97
- "domain": "{{user `domain`}}",
98
- "enterprise": "{{user `enterprise`}}",
99
- "org": "{{user `org`}}",
100
- "build-nodes": "{{user `build-nodes`}}",
101
- "workstations": "{{user `workstations`}}",
102
- "versions": {
103
- "chefdk": "{{user `chefdk`}}",
104
- "automate": "{{user `automate`}}"
105
- }
32
+ "builders": [
33
+ {
34
+ "type": "amazon-ebs",
35
+ "access_key": "{{user `aws_access_key`}}",
36
+ "secret_key": "{{user `aws_secret_key`}}",
37
+ "region": "{{user `aws_region`}}",
38
+ "source_ami": "{{user `aws_source_ami`}}",
39
+ "instance_type": "m4.large",
40
+ "communicator": "ssh",
41
+ "associate_public_ip_address": true,
42
+ "ssh_private_ip": false,
43
+ "ssh_username": "{{user `ssh_username`}}",
44
+ "ssh_pty": true,
45
+ "ami_name": "automate-{{timestamp}}"
46
+ },
47
+ {
48
+ "type": "azure-arm",
49
+ "subscription_id": "{{user `azure_subscription_id`}}",
50
+ "client_id": "{{user `azure_client_id`}}",
51
+ "client_secret": "{{user `azure_client_secret`}}",
52
+ "tenant_id": "{{user `azure_tenant_id`}}",
53
+ "resource_group_name": "{{user `azure_resource_group`}}",
54
+ "storage_account": "{{user `azure_storage_account`}}",
55
+ "object_id": "{{user `azure_object_id`}}",
56
+ "capture_container_name": "images",
57
+ "capture_name_prefix": "automate",
58
+ "os_type": "Linux",
59
+ "image_publisher": "Canonical",
60
+ "image_offer": "UbuntuServer",
61
+ "image_sku": "14.04.5-LTS",
62
+ "location": "{{user `azure_location`}}",
63
+ "vm_size": "Standard_DS3_v2",
64
+ "ssh_username": "{{user `ssh_username`}}",
65
+ "ssh_pty": true
66
+ },
67
+ {
68
+ "type": "googlecompute",
69
+ "account_file": "{{user `gce_account_file`}}",
70
+ "project_id": "{{user `gce_project_id`}}",
71
+ "source_image": "{{user `gce_source_image`}}",
72
+ "zone": "{{user `gce_zone`}}",
73
+ "disk_type": "pd-ssd",
74
+ "disk_size": "80",
75
+ "image_name": "automate-{{timestamp}}",
76
+ "machine_type": "n1-standard-2",
77
+ "ssh_username": "{{user `ssh_username`}}",
78
+ "ssh_pty": true
79
+ }
80
+ ],
81
+ "provisioners": [
82
+ {
83
+ "type": "file",
84
+ "source": "{{pwd}}/files/",
85
+ "destination": "/tmp"
86
+ },
87
+ {
88
+ "type": "file",
89
+ "source": "{{pwd}}/keys/",
90
+ "destination": "/tmp"
91
+ },
92
+ {
93
+ "type": "chef-solo",
94
+ "install_command": "{{user `chef_install_url`}} | sudo bash -s -- -c {{user `chef_channel`}} -v {{user `chef_ver`}}",
95
+ "cookbook_paths": [
96
+ "{{pwd}}/vendored-cookbooks/automate"
97
+ ],
98
+ "run_list": [
99
+ "automate",
100
+ "wombat::authorized-keys",
101
+ "wombat::etc-hosts"
102
+ ],
103
+ "json": {
104
+ "demo": {
105
+ "admin-user": "{{user `ssh_username`}}",
106
+ "domain_prefix": "{{user `domain_prefix`}}",
107
+ "domain": "{{user `domain`}}",
108
+ "enterprise": "{{user `enterprise`}}",
109
+ "org": "{{user `org`}}",
110
+ "build-nodes": "{{user `build-nodes`}}",
111
+ "workstations": "{{user `workstations`}}",
112
+ "versions": {
113
+ "chefdk": "{{user `chefdk`}}",
114
+ "automate": "{{user `automate`}}"
115
+ }
116
+ }
117
+ }
118
+ },
119
+ {
120
+ "only": [
121
+ "azure-arm"
122
+ ],
123
+ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
124
+ "inline": [
125
+ "/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
126
+ ],
127
+ "inline_shebang": "/bin/sh -x",
128
+ "type": "shell",
129
+ "skip_clean": true
106
130
  }
107
- }
108
- }
109
- ]
110
- }
131
+ ]
132
+ }