Module: ChefApply::TargetHost::Solaris
- Defined in:
- lib/chef_apply/target_host/solaris.rb
Constant Summary collapse
- MKTEMP_COMMAND =
"d=$(mktemp -d -p${TMPDIR:-/tmp} chef_XXXXXX); echo $d".freeze
Instance Method Summary collapse
- #chown(path, owner) ⇒ Object
- #del_dir(path) ⇒ Object
- #del_file(path) ⇒ Object
- #install_package(target_package_path) ⇒ Object
- #make_temp_dir ⇒ Object
- #mkdir(path) ⇒ Object
-
#normalize_path(path) ⇒ Object
Nothing to escape in a unix-based path.
- #omnibus_manifest_path ⇒ Object
- #ws_cache_path ⇒ Object
Instance Method Details
#chown(path, owner) ⇒ Object
15 16 17 18 19 |
# File 'lib/chef_apply/target_host/solaris.rb', line 15 def chown(path, owner) owner ||= user run_command!("chown #{owner} '#{path}'") nil end |
#del_dir(path) ⇒ Object
38 39 40 |
# File 'lib/chef_apply/target_host/solaris.rb', line 38 def del_dir(path) del_file(path) end |
#del_file(path) ⇒ Object
34 35 36 |
# File 'lib/chef_apply/target_host/solaris.rb', line 34 def del_file(path) run_command!("rm -rf #{path}") end |
#install_package(target_package_path) ⇒ Object
29 30 31 32 |
# File 'lib/chef_apply/target_host/solaris.rb', line 29 def install_package(target_package_path) command = "pkg install -g #{target_package_path} chef" run_command!(command) end |
#make_temp_dir ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/chef_apply/target_host/solaris.rb', line 21 def make_temp_dir # We will cache this so that we only run this once @tempdir ||= begin res = run_command!("bash -c '#{MKTEMP_COMMAND}'") res.stdout.chomp.strip end end |
#mkdir(path) ⇒ Object
11 12 13 |
# File 'lib/chef_apply/target_host/solaris.rb', line 11 def mkdir(path) run_command!("mkdir -p #{path}") end |
#normalize_path(path) ⇒ Object
Nothing to escape in a unix-based path
47 48 49 |
# File 'lib/chef_apply/target_host/solaris.rb', line 47 def normalize_path(path) path end |
#omnibus_manifest_path ⇒ Object
5 6 7 8 9 |
# File 'lib/chef_apply/target_host/solaris.rb', line 5 def omnibus_manifest_path # Note that we can't use File::Join, because that will render for the # CURRENT platform - not the platform of the target. "/opt/chef/version-manifest.json" end |
#ws_cache_path ⇒ Object
42 43 44 |
# File 'lib/chef_apply/target_host/solaris.rb', line 42 def ws_cache_path "/var/chef-workstation" end |