chef-apply 0.5.16 → 0.6.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 +4 -4
- data/Gemfile +1 -7
- data/Rakefile +0 -7
- data/lib/chef_apply/action/converge_target.rb +1 -1
- data/lib/chef_apply/action/install_chef.rb +6 -0
- data/lib/chef_apply/action/install_chef/minimum_chef_version.rb +4 -0
- data/lib/chef_apply/target_host.rb +5 -0
- data/lib/chef_apply/target_host/macos.rb +69 -0
- data/lib/chef_apply/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b787c2d47fe3b153a3c8e46613bb62f13b6346a8efad7ae1efe8ece667b3c53c
|
4
|
+
data.tar.gz: 398bd9ad985fff7b688ce12983c195daadd93048f226834a7463f141c5f71675
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c70ecbd0e62ae60c3fc6e7d9e19e72f44aefa5325f83218f495e6cd42abc5bc7809b76b1a1bf2c06f47375be2f85ad0e4d7bd51a637c6210cc87b9237864e0d7
|
7
|
+
data.tar.gz: 6564f0e408919ac1ae2b1e611feeb9bd7517117d1a3a2e33240a973ec3bca0ea4577650e2b0c20fc7ae71229965fad38879b1429425bf9ff84f48f0ee16ea5ec
|
data/Gemfile
CHANGED
@@ -19,18 +19,12 @@ source "https://rubygems.org"
|
|
19
19
|
gemspec
|
20
20
|
|
21
21
|
group :development do
|
22
|
-
gem "chefstyle", "1.7.
|
22
|
+
gem "chefstyle", "1.7.4"
|
23
23
|
gem "rake", ">= 10.1.0"
|
24
24
|
gem "rspec", "~> 3.0"
|
25
25
|
gem "simplecov"
|
26
26
|
end
|
27
27
|
|
28
|
-
group :docs do
|
29
|
-
gem "yard"
|
30
|
-
gem "redcarpet"
|
31
|
-
gem "github-markup"
|
32
|
-
end
|
33
|
-
|
34
28
|
group :debug do
|
35
29
|
gem "pry"
|
36
30
|
gem "pry-byebug"
|
data/Rakefile
CHANGED
@@ -24,13 +24,6 @@ rescue LoadError
|
|
24
24
|
puts "chefstyle gem is not installed. bundle install first to make sure all dependencies are installed."
|
25
25
|
end
|
26
26
|
|
27
|
-
begin
|
28
|
-
require "yard"
|
29
|
-
YARD::Rake::YardocTask.new(:docs)
|
30
|
-
rescue LoadError
|
31
|
-
puts "yard is not available. bundle install first to make sure all dependencies are installed."
|
32
|
-
end
|
33
|
-
|
34
27
|
task :console do
|
35
28
|
require "irb"
|
36
29
|
require "irb/completion"
|
@@ -198,7 +198,7 @@ module ChefApply::Action
|
|
198
198
|
else
|
199
199
|
# cd is shell a builtin, so we'll invoke bash. This also means all commands are executed
|
200
200
|
# with sudo (as long as we are hardcoding our sudo use)
|
201
|
-
"bash -c 'cd #{working_dir}; chef-client -z --config #{File.join(working_dir, config_file)} --recipe-url #{File.join(working_dir, policy)}'"
|
201
|
+
"bash -c 'cd #{working_dir}; /opt/chef/bin/chef-client -z --config #{File.join(working_dir, config_file)} --recipe-url #{File.join(working_dir, policy)}'"
|
202
202
|
end
|
203
203
|
end
|
204
204
|
|
@@ -86,6 +86,12 @@ module ChefApply
|
|
86
86
|
platform_version_compatibility_mode: true,
|
87
87
|
}
|
88
88
|
case platform.name
|
89
|
+
when /mac_os_x/
|
90
|
+
if platform.release.to_i >= 17
|
91
|
+
opts[:platform_version] = "10.13"
|
92
|
+
else
|
93
|
+
raise NotImplementedError
|
94
|
+
end
|
89
95
|
when /windows/
|
90
96
|
opts[:platform] = "windows"
|
91
97
|
when "redhat", "centos"
|
@@ -139,6 +139,9 @@ module ChefApply
|
|
139
139
|
when :windows
|
140
140
|
require_relative "target_host/windows"
|
141
141
|
class << self; include ChefApply::TargetHost::Windows; end
|
142
|
+
when :macos
|
143
|
+
require_relative "target_host/macos"
|
144
|
+
class << self; include ChefApply::TargetHost::MacOS; end
|
142
145
|
when :other
|
143
146
|
raise ChefApply::TargetHost::UnsupportedTargetOS.new(platform.name)
|
144
147
|
end
|
@@ -169,6 +172,8 @@ module ChefApply
|
|
169
172
|
:windows
|
170
173
|
elsif platform.linux?
|
171
174
|
:linux
|
175
|
+
elsif platform.darwin?
|
176
|
+
:macos
|
172
177
|
else
|
173
178
|
:other
|
174
179
|
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright (c) 2017 Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
module ChefApply
|
19
|
+
class TargetHost
|
20
|
+
module MacOS
|
21
|
+
def omnibus_manifest_path
|
22
|
+
# TODO - if habitat install on target, this won't work
|
23
|
+
# Note that we can't use File::Join, because that will render for the
|
24
|
+
# CURRENT platform - not the platform of the target.
|
25
|
+
"/opt/chef/version-manifest.json"
|
26
|
+
end
|
27
|
+
|
28
|
+
def mkdir(path)
|
29
|
+
run_command!("mkdir -p #{path}")
|
30
|
+
end
|
31
|
+
|
32
|
+
def chown(path, owner)
|
33
|
+
owner ||= user
|
34
|
+
run_command!("chown #{owner} '#{path}'")
|
35
|
+
nil
|
36
|
+
end
|
37
|
+
|
38
|
+
def install_package(remote_path)
|
39
|
+
install_cmd = <<-EOS
|
40
|
+
hdiutil detach "/Volumes/chef_software" >/dev/null 2>&1 || true
|
41
|
+
hdiutil attach #{remote_path} -mountpoint "/Volumes/chef_software"
|
42
|
+
cd / && sudo /usr/sbin/installer -pkg `sudo find "/Volumes/chef_software" -name \\*.pkg` -target /
|
43
|
+
EOS
|
44
|
+
run_command!(install_cmd)
|
45
|
+
nil
|
46
|
+
end
|
47
|
+
|
48
|
+
def del_file(path)
|
49
|
+
run_command!("rm -rf #{path}")
|
50
|
+
end
|
51
|
+
|
52
|
+
def del_dir(path)
|
53
|
+
del_file(path)
|
54
|
+
end
|
55
|
+
|
56
|
+
def make_temp_dir
|
57
|
+
installer_dir = "/tmp/chef-installer"
|
58
|
+
run_command!("mkdir -p #{installer_dir}")
|
59
|
+
run_command!("chmod 777 #{installer_dir}")
|
60
|
+
installer_dir
|
61
|
+
end
|
62
|
+
|
63
|
+
def ws_cache_path
|
64
|
+
"/var/chef-workstation"
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
data/lib/chef_apply/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-apply
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-cli
|
@@ -251,6 +251,7 @@ files:
|
|
251
251
|
- lib/chef_apply/status_reporter.rb
|
252
252
|
- lib/chef_apply/target_host.rb
|
253
253
|
- lib/chef_apply/target_host/linux.rb
|
254
|
+
- lib/chef_apply/target_host/macos.rb
|
254
255
|
- lib/chef_apply/target_host/windows.rb
|
255
256
|
- lib/chef_apply/target_resolver.rb
|
256
257
|
- lib/chef_apply/telemeter.rb
|