module ChefApply::TargetHost::MacOS
Public Instance Methods
chown(path, owner)
click to toggle source
# File lib/chef_apply/target_host/macos.rb, line 32 def chown(path, owner) owner ||= user run_command!("chown #{owner} '#{path}'") nil end
del_dir(path)
click to toggle source
# File lib/chef_apply/target_host/macos.rb, line 52 def del_dir(path) del_file(path) end
del_file(path)
click to toggle source
# File lib/chef_apply/target_host/macos.rb, line 48 def del_file(path) run_command!("rm -rf #{path}") end
install_package(remote_path)
click to toggle source
# File lib/chef_apply/target_host/macos.rb, line 38 def install_package(remote_path) install_cmd = <<-EOS hdiutil detach "/Volumes/chef_software" >/dev/null 2>&1 || true hdiutil attach #{remote_path} -mountpoint "/Volumes/chef_software" cd / && sudo /usr/sbin/installer -pkg `sudo find "/Volumes/chef_software" -name \\*.pkg` -target / EOS run_command!(install_cmd) nil end
make_temp_dir()
click to toggle source
# File lib/chef_apply/target_host/macos.rb, line 56 def make_temp_dir installer_dir = "/tmp/chef-installer" run_command!("mkdir -p #{installer_dir}") run_command!("chmod 777 #{installer_dir}") installer_dir end
mkdir(path)
click to toggle source
# File lib/chef_apply/target_host/macos.rb, line 28 def mkdir(path) run_command!("mkdir -p #{path}") end
omnibus_manifest_path()
click to toggle source
# File lib/chef_apply/target_host/macos.rb, line 21 def omnibus_manifest_path # TODO - if habitat install on target, this won't work # 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()
click to toggle source
# File lib/chef_apply/target_host/macos.rb, line 63 def ws_cache_path "/var/chef-workstation" end