mixlib-install 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -4
- data/CHANGELOG.md +3 -0
- data/acceptance/Gemfile +2 -0
- data/acceptance/ubuntu_install_command/terraform/application.tf +1 -1
- data/acceptance/ubuntu_install_sh/terraform/application.tf +1 -1
- data/acceptance/{powershell_install_ps1 → windows-nano}/.acceptance/acceptance-cookbook/.gitignore +0 -0
- data/acceptance/windows-nano/.acceptance/acceptance-cookbook/libraries/chef_extentions.rb +74 -0
- data/acceptance/{powershell_install_ps1 → windows-nano}/.acceptance/acceptance-cookbook/metadata.rb +0 -0
- data/acceptance/windows-nano/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
- data/acceptance/windows-nano/.acceptance/acceptance-cookbook/recipes/provision.rb +49 -0
- data/acceptance/windows-nano/.acceptance/acceptance-cookbook/recipes/verify.rb +9 -0
- data/acceptance/windows-nano/inspec/verify.rb +11 -0
- data/acceptance/windows-nano/terraform/application.tf +59 -0
- data/acceptance/{powershell_install_ps1 → windows-nano}/terraform/aws.tf +0 -0
- data/acceptance/windows-nano/terraform/variables.tf +10 -0
- data/acceptance/windows-server-2012r2/.acceptance/acceptance-cookbook/.gitignore +2 -0
- data/acceptance/windows-server-2012r2/.acceptance/acceptance-cookbook/metadata.rb +2 -0
- data/acceptance/{powershell_install_ps1 → windows-server-2012r2}/.acceptance/acceptance-cookbook/recipes/destroy.rb +0 -0
- data/acceptance/{powershell_install_ps1 → windows-server-2012r2}/.acceptance/acceptance-cookbook/recipes/provision.rb +0 -0
- data/acceptance/{powershell_install_ps1 → windows-server-2012r2}/.acceptance/acceptance-cookbook/recipes/verify.rb +0 -0
- data/acceptance/{powershell_install_ps1 → windows-server-2012r2}/inspec/verify.rb +0 -0
- data/acceptance/{powershell_install_ps1 → windows-server-2012r2}/terraform/application.tf +1 -1
- data/acceptance/windows-server-2012r2/terraform/aws.tf +8 -0
- data/acceptance/{powershell_install_ps1 → windows-server-2012r2}/terraform/variables.tf +0 -0
- data/ci/before-script.sh +1 -1
- data/ci/run-acceptance-tests.sh +2 -2
- data/lib/mixlib/install/artifact_info.rb +4 -0
- data/lib/mixlib/install/backend/base.rb +13 -6
- data/lib/mixlib/install/options.rb +13 -4
- data/lib/mixlib/install/util.rb +2 -2
- data/lib/mixlib/install/version.rb +1 -1
- metadata +21 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e92952408c7ab6f65b6613a45e2debc1cecc561
|
4
|
+
data.tar.gz: da6e6ae0fff21cf77a0823883f72788a95dc7434
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 210497a42f51a085c00170ad28d77bff5861fbc0c12588ac091fcd7b5268e494b97b792c08f17c1f3bd4f21784420b12e452c9e0a0861b578c13730867364a79
|
7
|
+
data.tar.gz: 8a7b5fe062d3d3f842bbc5e3e031fcb293ca27df61f961d5671ec66bbc56304c6e024128cd62e4f2b398e811974d0009999c251930ba42b2b6f6ac1dc1f3e46d
|
data/.travis.yml
CHANGED
@@ -14,10 +14,13 @@ addons:
|
|
14
14
|
|
15
15
|
matrix:
|
16
16
|
include:
|
17
|
-
- rvm: 2.2
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
- rvm: 2.2
|
18
|
+
- rvm: 2.3
|
19
|
+
env: SUITE=ubuntu
|
20
|
+
- rvm: 2.3
|
21
|
+
env: SUITE=windows-server-2012r2
|
22
|
+
- rvm: 2.3
|
23
|
+
env: SUITE=windows-nano
|
21
24
|
|
22
25
|
before_script:
|
23
26
|
- ci/before-script.sh
|
@@ -34,5 +37,7 @@ env:
|
|
34
37
|
- secure: "b/O77C/ebnrXw/xSTRMcAuhmUz9QH//jfh3XSQrZF2lRJZJbAbfL3L3SPLqQmPkMDJWCAJrs82umQJkZ0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QBi0AaWLJ6Kw5+a4tkIkwMyMPJQh+pKnADZK2pd+Hhrr7CRtnaT6w4V2sZCIfcdlLnKmez/BMNNdBn1+WAfE+aN224JK43rXxgLe4B9CcXCsUUORh6nJbB5f60D15qYokDu7ILi0RufyfyiJulqxIsXVNKtnUXOJRXZvDOPp9Y+2ur0HmVK7aiWr6JwXtODgrrDzZiWq99eR2ErDJB1AFUVMmudUykf5SWyivhvB4RStYDIIpG8EXrIhRKP+k9o4loqQBRcRBGvEMLdyupi7TzuryzK7j2XzhJFD9Eg+50Y5By87lRfvltuAJaDkRPfwIzSbWsh0Lb7YwUXI9a+bJebsteTPSFjb1YOYvkQCV2CB5pH68QInw8Hu9o2hmUkuoNWqqvVaxDI8z3peympfFlVtvTC9eOI60Tdv+pSCyQhBN0/II8FT/fylwQsOL+i8Hez9NIRdaRkx0JEpY56NloErd4An9zpY/xCAa/6JfzMWn7eD673MRVJW0u/j5IGuRAksuUlGZTQS+qudF4ZgVJaacm6qARULaesuCNbufZYtRB0Hg+GINQrUSfYKBw6BZUk2T9ZQ2zFsnF12k0yl9Qr7I="
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [3.1.0]
|
4
|
+
- Add support for Windows Nano 2016 (returns appx packages)
|
5
|
+
|
3
6
|
## [3.0.0]
|
4
7
|
- [Breaking API Change] `Options` validation added to ensure that when any platform option is set they are all provided (platform, platform_version, architecture)
|
5
8
|
- [Breaking API Change] The `platform_version_compatibility_mode` option will automatically be set to `true` when no platform options are provided
|
data/acceptance/Gemfile
CHANGED
data/acceptance/{powershell_install_ps1 → windows-nano}/.acceptance/acceptance-cookbook/.gitignore
RENAMED
File without changes
|
@@ -0,0 +1,74 @@
|
|
1
|
+
class Chef
|
2
|
+
class Recipe
|
3
|
+
def run_tf(command)
|
4
|
+
execute "terraform #{command}" do
|
5
|
+
cwd "#{node['chef-acceptance']['suite-dir']}/terraform"
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class Resource
|
11
|
+
def instance_ip
|
12
|
+
@instance_ip ||= tf_state["modules"].first["resources"]["aws_instance.windows_server_nano_ami"]["primary"]["attributes"]["public_ip"]
|
13
|
+
end
|
14
|
+
|
15
|
+
def instance_id
|
16
|
+
@instance_id ||= tf_state["modules"].first["resources"]["aws_instance.windows_server_nano_ami"]["primary"]["id"]
|
17
|
+
end
|
18
|
+
|
19
|
+
def windows_password
|
20
|
+
@windows_password ||= begin
|
21
|
+
require "aws-sdk"
|
22
|
+
|
23
|
+
ec2 = Aws::EC2::Resource.new
|
24
|
+
instance = ec2.instance(instance_id)
|
25
|
+
instance.wait_until_running
|
26
|
+
|
27
|
+
# AWS periodically needs more time to retrieve the windows password. Retry.
|
28
|
+
time = 3 * 60 # try up to 3 minutes
|
29
|
+
interval = 5 # every 5 seconds
|
30
|
+
tries = time / interval
|
31
|
+
begin
|
32
|
+
password = instance.decrypt_windows_password("#{ENV['HOME']}/.ssh/es-infrastructure.pem")
|
33
|
+
rescue RuntimeError => e
|
34
|
+
if e.message =~ /password not available yet/
|
35
|
+
unless (tries -= 1).zero?
|
36
|
+
sleep interval
|
37
|
+
retry
|
38
|
+
end
|
39
|
+
else
|
40
|
+
raise e
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
password
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def run_shell(script, type = :powershell)
|
49
|
+
require "winrm"
|
50
|
+
|
51
|
+
opts = {
|
52
|
+
endpoint: "http://#{instance_ip}:5985/wsman",
|
53
|
+
user: "Administrator",
|
54
|
+
password: windows_password
|
55
|
+
}
|
56
|
+
|
57
|
+
conn = WinRM::Connection.new(opts)
|
58
|
+
|
59
|
+
conn.shell(type) do |shell|
|
60
|
+
output = shell.run(script) do |stdout, stderr|
|
61
|
+
STDOUT.print stdout
|
62
|
+
STDERR.print stderr
|
63
|
+
end
|
64
|
+
Chef::Log.info "The script exited with exit code #{output.exitcode}"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
private
|
69
|
+
|
70
|
+
def tf_state
|
71
|
+
@tfstate ||= JSON.parse(::File.read("#{node['chef-acceptance']['suite-dir']}/terraform/terraform.tfstate"))
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
data/acceptance/{powershell_install_ps1 → windows-nano}/.acceptance/acceptance-cookbook/metadata.rb
RENAMED
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
run_tf "destroy -force"
|
@@ -0,0 +1,49 @@
|
|
1
|
+
run_tf "plan"
|
2
|
+
|
3
|
+
run_tf "apply"
|
4
|
+
|
5
|
+
ruby_block "install via winrm api" do
|
6
|
+
block do
|
7
|
+
# We do this hackery to ensure we load mixlib-install from source
|
8
|
+
install_command = "install -project angry-omnibus-toolchain -channel current -version 1.1.57"
|
9
|
+
|
10
|
+
shellout_command = <<-EOF.gsub /^\s*/, ""
|
11
|
+
bundle exec ruby -e "require 'mixlib/install';\
|
12
|
+
puts Mixlib::Install.install_ps1, '#{install_command}'"
|
13
|
+
EOF
|
14
|
+
|
15
|
+
require "mixlib/shellout"
|
16
|
+
|
17
|
+
print_script = Mixlib::ShellOut.new(
|
18
|
+
shellout_command,
|
19
|
+
cwd: node['chef-acceptance']['suite-dir']
|
20
|
+
)
|
21
|
+
print_script.run_command
|
22
|
+
|
23
|
+
run_shell(print_script.stdout)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
ruby_block "set omnibus paths" do
|
28
|
+
block do
|
29
|
+
toolchain_install_dir = File.join('c:', 'opscode', 'angry-omnibus-toolchain')
|
30
|
+
|
31
|
+
omnibus_env = []
|
32
|
+
omnibus_env << File.join(toolchain_install_dir, 'embedded', 'bin')
|
33
|
+
omnibus_env << File.join(toolchain_install_dir, 'embedded', 'bin', 'mingw64', 'bin')
|
34
|
+
omnibus_env << File.join(toolchain_install_dir, 'embedded', 'bin', 'usr', 'bin')
|
35
|
+
omnibus_env << File.join(toolchain_install_dir, 'embedded', 'git', 'cmd')
|
36
|
+
omnibus_env << File.join(toolchain_install_dir, 'embedded', 'git', 'mingw64', 'libexec', 'git-core')
|
37
|
+
|
38
|
+
# Join paths by semi-colons then replace forwardslashes with backslashes
|
39
|
+
omnibus_path = omnibus_env.join(";").gsub("/", "\\")
|
40
|
+
|
41
|
+
# Permanently set omnibus path to machine PATH
|
42
|
+
script = <<-EOF.gsub /^\s*/, ""
|
43
|
+
$env:path += ';#{omnibus_path}'
|
44
|
+
setx PATH $env:path /M
|
45
|
+
EOF
|
46
|
+
|
47
|
+
run_shell(script)
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
execute "run inspec" do
|
2
|
+
command lazy { "inspec exec verify.rb -t winrm://Administrator@#{instance_ip} --password $WINDOWS_PASSWORD" }
|
3
|
+
cwd "#{node['chef-acceptance']['suite-dir']}/inspec"
|
4
|
+
environment(
|
5
|
+
lazy {
|
6
|
+
{ "WINDOWS_PASSWORD" => windows_password }
|
7
|
+
}
|
8
|
+
)
|
9
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
describe command("git --version") do
|
2
|
+
its("stdout") { should match "git version" }
|
3
|
+
end
|
4
|
+
|
5
|
+
describe command("ruby --version") do
|
6
|
+
its("stdout") { should match "ruby.*[x64-mingw32]" }
|
7
|
+
end
|
8
|
+
|
9
|
+
describe command("gcc --version") do
|
10
|
+
its("stdout") { should match "gcc.exe" }
|
11
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
data "aws_ami" "windows_ami" {
|
2
|
+
most_recent = true
|
3
|
+
|
4
|
+
filter {
|
5
|
+
name = "owner-alias"
|
6
|
+
values = ["amazon"]
|
7
|
+
}
|
8
|
+
|
9
|
+
filter {
|
10
|
+
name = "name"
|
11
|
+
values = ["Windows_Server-2016-English-Nano-Base-*"]
|
12
|
+
}
|
13
|
+
|
14
|
+
filter {
|
15
|
+
name = "architecture"
|
16
|
+
values = ["x86_64"]
|
17
|
+
}
|
18
|
+
|
19
|
+
filter {
|
20
|
+
name = "virtualization-type"
|
21
|
+
values = ["hvm"]
|
22
|
+
}
|
23
|
+
|
24
|
+
filter {
|
25
|
+
name = "block-device-mapping.volume-type"
|
26
|
+
values = ["gp2"]
|
27
|
+
}
|
28
|
+
|
29
|
+
filter {
|
30
|
+
name = "image-type"
|
31
|
+
values = ["machine"]
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
resource "aws_instance" "windows_server_nano_ami" {
|
36
|
+
count = 1
|
37
|
+
|
38
|
+
ami = "${data.aws_ami.windows_ami.id}"
|
39
|
+
instance_type = "${var.aws_instance_type}"
|
40
|
+
key_name = "es-infrastructure"
|
41
|
+
|
42
|
+
associate_public_ip_address = true
|
43
|
+
|
44
|
+
subnet_id = "subnet-11ac0174" # Planet Releng Public Subnet
|
45
|
+
source_dest_check = false
|
46
|
+
|
47
|
+
vpc_security_group_ids = [
|
48
|
+
"sg-96274af3",
|
49
|
+
]
|
50
|
+
|
51
|
+
tags {
|
52
|
+
# ChefOps's AWS standard tags:
|
53
|
+
X-Dept = "EngServ"
|
54
|
+
X-Contact = "pwright"
|
55
|
+
X-Production = "false"
|
56
|
+
X-Environment = "acceptance"
|
57
|
+
X-Application = "mixlib-install"
|
58
|
+
}
|
59
|
+
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Restrict operation of terraform to chef-es profile so that
|
2
|
+
# we do not create resources in other aws profiles.
|
3
|
+
# We assume user has configured standard aws credentials
|
4
|
+
# under ~/.aws/credentials or with $AWS_SHARED_CREDENTIALS_FILE
|
5
|
+
provider "aws" {
|
6
|
+
region = "${var.aws_region}"
|
7
|
+
profile = "chef-aws"
|
8
|
+
}
|
File without changes
|
data/ci/before-script.sh
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
set -evx
|
4
4
|
|
5
5
|
# Don't run acceptance tests on forks. The decryption keys are not available.
|
6
|
-
if [
|
6
|
+
if [[ $SUITE ]] && [[ $encrypted_e2edbb28e76c_key ]]; then
|
7
7
|
|
8
8
|
# download terraform
|
9
9
|
wget "https://releases.hashicorp.com/terraform/0.7.4/terraform_0.7.4_linux_amd64.zip" -O tf.zip
|
data/ci/run-acceptance-tests.sh
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
set -evx
|
4
4
|
|
5
5
|
# Don't run acceptance tests on forks. The decryption keys are not available.
|
6
|
-
if [
|
6
|
+
if [[ $SUITE ]] && [[ $encrypted_e2edbb28e76c_key ]]; then
|
7
7
|
# setup acceptance tests
|
8
8
|
cd acceptance
|
9
9
|
export BUNDLE_GEMFILE=$PWD/Gemfile
|
10
10
|
bundle install
|
11
11
|
# run acceptances tests and force cleanup
|
12
|
-
bundle exec chef-acceptance test --force-destroy
|
12
|
+
bundle exec chef-acceptance test $SUITE --force-destroy
|
13
13
|
fi
|
@@ -26,8 +26,6 @@ module Mixlib
|
|
26
26
|
class Base
|
27
27
|
attr_reader :options
|
28
28
|
|
29
|
-
SUPPORTED_WINDOWS_DESKTOP_VERSIONS = %w{7 8 8.1 10}
|
30
|
-
|
31
29
|
def initialize(options)
|
32
30
|
@options = options
|
33
31
|
end
|
@@ -123,14 +121,14 @@ module Mixlib
|
|
123
121
|
return closest_compatible_artifact
|
124
122
|
end
|
125
123
|
|
126
|
-
|
124
|
+
# Return an exception if we get to the end of the method
|
127
125
|
raise ArtifactsNotFound, <<-EOF
|
128
126
|
No artifacts found matching criteria.
|
129
127
|
product name: #{options.product_name}
|
130
128
|
channel: #{options.channel}
|
131
129
|
version: #{options.product_version}
|
132
130
|
platform: #{options.platform}
|
133
|
-
platform version: #{options.
|
131
|
+
platform version: #{options.original_platform_version}
|
134
132
|
architecture: #{options.architecture}
|
135
133
|
compatibility mode: #{options.platform_version_compatibility_mode}
|
136
134
|
EOF
|
@@ -146,6 +144,15 @@ EOF
|
|
146
144
|
new_artifacts = [ ]
|
147
145
|
native_artifacts = [ ]
|
148
146
|
|
147
|
+
# We only return appx packages when a nano platform version is requested.
|
148
|
+
if options.class::SUPPORTED_WINDOWS_NANO_VERSIONS.include?(options.original_platform_version)
|
149
|
+
return artifacts.find_all { |a| a.appx_artifact? }
|
150
|
+
|
151
|
+
# Otherwise, we only return msi artifacts and remove all appx packages
|
152
|
+
else
|
153
|
+
artifacts.delete_if { |a| a.appx_artifact? }
|
154
|
+
end
|
155
|
+
|
149
156
|
artifacts.each do |r|
|
150
157
|
next if r.platform != "windows"
|
151
158
|
|
@@ -241,7 +248,7 @@ EOF
|
|
241
248
|
# See https://docs.chef.io/platforms.html
|
242
249
|
#
|
243
250
|
def map_custom_windows_desktop_versions(desktop_version)
|
244
|
-
server_version = Util.
|
251
|
+
server_version = Util.map_windows_version(desktop_version)
|
245
252
|
|
246
253
|
# Windows desktop 10 officially maps to server 2016.
|
247
254
|
# However, we don't test on server 2016 at this time, so we default to 2012r2
|
@@ -255,7 +262,7 @@ EOF
|
|
255
262
|
# options hash allows overriding any valid attribute
|
256
263
|
#
|
257
264
|
def clone_windows_desktop_artifacts(base_artifact, options = {})
|
258
|
-
SUPPORTED_WINDOWS_DESKTOP_VERSIONS.collect do |dv|
|
265
|
+
@options.class::SUPPORTED_WINDOWS_DESKTOP_VERSIONS.collect do |dv|
|
259
266
|
options[:platform_version] = dv
|
260
267
|
options[:url] = base_artifact.url.gsub("\/#{base_artifact.platform_version}\/", "\/#{map_custom_windows_desktop_versions(dv)}\/")
|
261
268
|
|
@@ -25,7 +25,7 @@ module Mixlib
|
|
25
25
|
class Options
|
26
26
|
class InvalidOptions < ArgumentError; end
|
27
27
|
|
28
|
-
attr_reader :options, :errors
|
28
|
+
attr_reader :options, :errors, :original_platform_version
|
29
29
|
|
30
30
|
SUPPORTED_ARCHITECTURES = %w{
|
31
31
|
i386
|
@@ -62,13 +62,20 @@ module Mixlib
|
|
62
62
|
:user_agent_headers,
|
63
63
|
]
|
64
64
|
|
65
|
+
SUPPORTED_WINDOWS_DESKTOP_VERSIONS = %w{7 8 8.1 10}
|
66
|
+
|
67
|
+
SUPPORTED_WINDOWS_NANO_VERSIONS = %w{2016nano}
|
68
|
+
|
65
69
|
def initialize(options)
|
66
70
|
@options = options
|
67
71
|
@errors = []
|
68
72
|
|
73
|
+
# Store original platform version in cases where we must remap it
|
74
|
+
@original_platform_version = options[:platform_version]
|
75
|
+
|
69
76
|
resolve_platform_version_compatibility_mode!
|
70
77
|
|
71
|
-
|
78
|
+
map_windows_versions!
|
72
79
|
|
73
80
|
validate!
|
74
81
|
end
|
@@ -213,8 +220,10 @@ Must provide platform, platform version and architecture when specifying any pla
|
|
213
220
|
end
|
214
221
|
end
|
215
222
|
|
216
|
-
def
|
217
|
-
|
223
|
+
def map_windows_versions!
|
224
|
+
return unless for_windows?
|
225
|
+
|
226
|
+
options[:platform_version] = Util.map_windows_version(platform_version)
|
218
227
|
end
|
219
228
|
|
220
229
|
def all_or_none?(items)
|
data/lib/mixlib/install/util.rb
CHANGED
@@ -130,13 +130,13 @@ module Mixlib
|
|
130
130
|
user_agents.flatten.compact.uniq.join(" ")
|
131
131
|
end
|
132
132
|
|
133
|
-
def
|
133
|
+
def map_windows_version(version)
|
134
134
|
# This logic does not try to compare and determine proper versions based on conditions or ranges.
|
135
135
|
# These are here to improve UX for desktop versions.
|
136
136
|
case version
|
137
137
|
when /^10/
|
138
138
|
"2016"
|
139
|
-
when /^6.3/, /^8.1/
|
139
|
+
when /^6.3/, /^8.1/, /2016nano/
|
140
140
|
"2012r2"
|
141
141
|
when /^6.2/, /^8/
|
142
142
|
"2012"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mixlib-install
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thom May
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-03-
|
12
|
+
date: 2017-03-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mixlib-shellout
|
@@ -216,15 +216,6 @@ files:
|
|
216
216
|
- acceptance/.gitignore
|
217
217
|
- acceptance/Gemfile
|
218
218
|
- acceptance/README.md
|
219
|
-
- acceptance/powershell_install_ps1/.acceptance/acceptance-cookbook/.gitignore
|
220
|
-
- acceptance/powershell_install_ps1/.acceptance/acceptance-cookbook/metadata.rb
|
221
|
-
- acceptance/powershell_install_ps1/.acceptance/acceptance-cookbook/recipes/destroy.rb
|
222
|
-
- acceptance/powershell_install_ps1/.acceptance/acceptance-cookbook/recipes/provision.rb
|
223
|
-
- acceptance/powershell_install_ps1/.acceptance/acceptance-cookbook/recipes/verify.rb
|
224
|
-
- acceptance/powershell_install_ps1/inspec/verify.rb
|
225
|
-
- acceptance/powershell_install_ps1/terraform/application.tf
|
226
|
-
- acceptance/powershell_install_ps1/terraform/aws.tf
|
227
|
-
- acceptance/powershell_install_ps1/terraform/variables.tf
|
228
219
|
- acceptance/ubuntu_install_command/.acceptance/acceptance-cookbook/.gitignore
|
229
220
|
- acceptance/ubuntu_install_command/.acceptance/acceptance-cookbook/metadata.rb
|
230
221
|
- acceptance/ubuntu_install_command/.acceptance/acceptance-cookbook/recipes/destroy.rb
|
@@ -243,6 +234,25 @@ files:
|
|
243
234
|
- acceptance/ubuntu_install_sh/terraform/application.tf
|
244
235
|
- acceptance/ubuntu_install_sh/terraform/aws.tf
|
245
236
|
- acceptance/ubuntu_install_sh/terraform/variables.tf
|
237
|
+
- acceptance/windows-nano/.acceptance/acceptance-cookbook/.gitignore
|
238
|
+
- acceptance/windows-nano/.acceptance/acceptance-cookbook/libraries/chef_extentions.rb
|
239
|
+
- acceptance/windows-nano/.acceptance/acceptance-cookbook/metadata.rb
|
240
|
+
- acceptance/windows-nano/.acceptance/acceptance-cookbook/recipes/destroy.rb
|
241
|
+
- acceptance/windows-nano/.acceptance/acceptance-cookbook/recipes/provision.rb
|
242
|
+
- acceptance/windows-nano/.acceptance/acceptance-cookbook/recipes/verify.rb
|
243
|
+
- acceptance/windows-nano/inspec/verify.rb
|
244
|
+
- acceptance/windows-nano/terraform/application.tf
|
245
|
+
- acceptance/windows-nano/terraform/aws.tf
|
246
|
+
- acceptance/windows-nano/terraform/variables.tf
|
247
|
+
- acceptance/windows-server-2012r2/.acceptance/acceptance-cookbook/.gitignore
|
248
|
+
- acceptance/windows-server-2012r2/.acceptance/acceptance-cookbook/metadata.rb
|
249
|
+
- acceptance/windows-server-2012r2/.acceptance/acceptance-cookbook/recipes/destroy.rb
|
250
|
+
- acceptance/windows-server-2012r2/.acceptance/acceptance-cookbook/recipes/provision.rb
|
251
|
+
- acceptance/windows-server-2012r2/.acceptance/acceptance-cookbook/recipes/verify.rb
|
252
|
+
- acceptance/windows-server-2012r2/inspec/verify.rb
|
253
|
+
- acceptance/windows-server-2012r2/terraform/application.tf
|
254
|
+
- acceptance/windows-server-2012r2/terraform/aws.tf
|
255
|
+
- acceptance/windows-server-2012r2/terraform/variables.tf
|
246
256
|
- bin/mixlib-install
|
247
257
|
- ci/before-script.sh
|
248
258
|
- ci/es-infrastructure.pem.enc
|