chef-apply 0.7.1 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/chef_apply/action/install_chef.rb +2 -1
- data/lib/chef_apply/action/install_chef/minimum_chef_version.rb +4 -0
- data/lib/chef_apply/target_host.rb +6 -2
- data/lib/chef_apply/target_host/solaris.rb +55 -0
- data/lib/chef_apply/ui/terminal.rb +0 -1
- 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: dcf42f06fe2a7733f4c9755f5cd02b965f45b31e7666db57345b48f0e9692d54
|
4
|
+
data.tar.gz: f667eca9ca4afb06480ba754c3de012eb7435c3d1552142e7dbd491c124bf441
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47f31dfb20d1562308d4b2735f8f3f225bf7de794e2fcbb47c7d6cff362d763df7681bf4ed005aec0d74816570e7caa39f164aabdaadca1172db25ab0b8fc7e4
|
7
|
+
data.tar.gz: 7b4d37d955d6faa57c8314e6d9fd116b850ca76e78bbbdca506a4b51942fa5daed30d5b0cd310c6e89e34047583d5ab23f813c9775065da035c215095e7462f7
|
data/Gemfile
CHANGED
@@ -14,7 +14,6 @@
|
|
14
14
|
# See the License for the specific language governing permissions and
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
|
-
|
18
17
|
require_relative "base"
|
19
18
|
require_relative "install_chef/minimum_chef_version"
|
20
19
|
require "fileutils" unless defined?(FileUtils)
|
@@ -98,6 +97,8 @@ module ChefApply
|
|
98
97
|
opts[:platform] = "el"
|
99
98
|
when "suse"
|
100
99
|
opts[:platform] = "sles"
|
100
|
+
when "solaris"
|
101
|
+
opts[:platform] = "solaris2"
|
101
102
|
when "amazon"
|
102
103
|
opts[:platform] = "el"
|
103
104
|
if platform.release.to_i > 2010 # legacy Amazon version 1
|
@@ -18,7 +18,6 @@
|
|
18
18
|
require_relative "log"
|
19
19
|
require_relative "error"
|
20
20
|
require "train"
|
21
|
-
|
22
21
|
module ChefApply
|
23
22
|
class TargetHost
|
24
23
|
attr_reader :config, :reporter, :backend, :transport_type
|
@@ -142,6 +141,9 @@ module ChefApply
|
|
142
141
|
when :macos
|
143
142
|
require_relative "target_host/macos"
|
144
143
|
class << self; include ChefApply::TargetHost::MacOS; end
|
144
|
+
when :solaris
|
145
|
+
require_relative "target_host/solaris"
|
146
|
+
class << self; include ChefApply::TargetHost::Solaris; end
|
145
147
|
when :other
|
146
148
|
raise ChefApply::TargetHost::UnsupportedTargetOS.new(platform.name)
|
147
149
|
end
|
@@ -174,6 +176,8 @@ module ChefApply
|
|
174
176
|
:linux
|
175
177
|
elsif platform.darwin?
|
176
178
|
:macos
|
179
|
+
elsif platform.solaris?
|
180
|
+
:solaris
|
177
181
|
else
|
178
182
|
:other
|
179
183
|
end
|
@@ -312,7 +316,7 @@ module ChefApply
|
|
312
316
|
case original_exception.message # original_exception.reason
|
313
317
|
when /Sudo requires a password/ # :sudo_password_required
|
314
318
|
"CHEFTRN003"
|
315
|
-
when /Wrong sudo password/
|
319
|
+
when /Wrong sudo password/ # :bad_sudo_password
|
316
320
|
"CHEFTRN004"
|
317
321
|
when /Can't find sudo command/, /No such file/, /command not found/ # :sudo_command_not_found
|
318
322
|
# NOTE: In the /No such file/ case, reason will be nil - we still have
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module ChefApply
|
2
|
+
class TargetHost
|
3
|
+
module Solaris
|
4
|
+
|
5
|
+
def omnibus_manifest_path
|
6
|
+
# Note that we can't use File::Join, because that will render for the
|
7
|
+
# CURRENT platform - not the platform of the target.
|
8
|
+
"/opt/chef/version-manifest.json"
|
9
|
+
end
|
10
|
+
|
11
|
+
def mkdir(path)
|
12
|
+
run_command!("mkdir -p #{path}")
|
13
|
+
end
|
14
|
+
|
15
|
+
def chown(path, owner)
|
16
|
+
owner ||= user
|
17
|
+
run_command!("chown #{owner} '#{path}'")
|
18
|
+
nil
|
19
|
+
end
|
20
|
+
|
21
|
+
def make_temp_dir
|
22
|
+
# We will cache this so that we only run this once
|
23
|
+
@tempdir ||= begin
|
24
|
+
res = run_command!("bash -c '#{MKTEMP_COMMAND}'")
|
25
|
+
res.stdout.chomp.strip
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def install_package(target_package_path)
|
30
|
+
command = "pkg install -g #{target_package_path} chef"
|
31
|
+
run_command!(command)
|
32
|
+
end
|
33
|
+
|
34
|
+
def del_file(path)
|
35
|
+
run_command!("rm -rf #{path}")
|
36
|
+
end
|
37
|
+
|
38
|
+
def del_dir(path)
|
39
|
+
del_file(path)
|
40
|
+
end
|
41
|
+
|
42
|
+
def ws_cache_path
|
43
|
+
"/var/chef-workstation"
|
44
|
+
end
|
45
|
+
|
46
|
+
# Nothing to escape in a unix-based path
|
47
|
+
def normalize_path(path)
|
48
|
+
path
|
49
|
+
end
|
50
|
+
|
51
|
+
MKTEMP_COMMAND = "d=$(mktemp -d -p${TMPDIR:-/tmp} chef_XXXXXX); echo $d".freeze
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
55
|
+
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.8.1
|
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-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-cli
|
@@ -252,6 +252,7 @@ files:
|
|
252
252
|
- lib/chef_apply/target_host.rb
|
253
253
|
- lib/chef_apply/target_host/linux.rb
|
254
254
|
- lib/chef_apply/target_host/macos.rb
|
255
|
+
- lib/chef_apply/target_host/solaris.rb
|
255
256
|
- lib/chef_apply/target_host/windows.rb
|
256
257
|
- lib/chef_apply/target_resolver.rb
|
257
258
|
- lib/chef_apply/telemeter.rb
|