https://github.com/fnichol/chef-dmg
Opscode DMG Chef Cookbook fork which fixes copying of symlinks, like in Dropbox.dmg
https://github.com/fnichol/chef-dmg
Last synced: 3 months ago
JSON representation
Opscode DMG Chef Cookbook fork which fixes copying of symlinks, like in Dropbox.dmg
- Host: GitHub
- URL: https://github.com/fnichol/chef-dmg
- Owner: fnichol
- Created: 2011-09-25T04:47:53.000Z (over 13 years ago)
- Default Branch: symlink-copy-fix
- Last Pushed: 2011-09-25T04:53:34.000Z (over 13 years ago)
- Last Synced: 2025-03-24T03:09:16.462Z (3 months ago)
- Language: Ruby
- Homepage:
- Size: 91.8 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Description
===========Lightweight resource and provider to install OS X applications (.app) from dmg files.
Changes
=======## v0.6.0:
- option to install software that is an .mpkg inside a .dmg
- ignore failure on chmod in case mode is already set, or is root ownedRequirements
============## Platform:
* Mac OS X
Resources and Providers
=======================dmg\_package
------------This resource will install a DMG "Package". It will retrieve the DMG from a remote URL, mount it using OS X's `hdid`, copy the application (.app directory) to the specified destination (/Applications), and detach the image using `hdiutil`. The dmg file will be stored in the `Chef::Config[:file_cache_path]`. If you want to install an application that has already been downloaded (not using the `source` parameter), copy it to the appropriate location. You can find out what directory this is with the following command on the node to run chef:
knife exec -E 'p Chef::Config[:file_cache_path]' -c /etc/chef/client.rb
Optionally, the LWRP can install an "mpkg" package using installer(8).
# Actions:
* :install - Installs the application.
# Parameter attributes:
* `app` - This is the name of the application used by default for the /Volumes directory and the .app directory copied to /Applications.
* `source` - remote URL for the dmg to download if specified. Default is nil.
* `destination` - directory to copy the .app into. Default is /Applications.
* `checksum` - sha256 checksum of the dmg to download. Default is nil.
* `type` - type of package, "app" or "mpkg". Default is "app". When using "mpkg", the destination must be /Applications.
* `volumes_dir` - Directory under /Volumes where the dmg is mounted. Not all dmgs are mounted into a /Volumes location matching the name of the dmg. If not specified, this will use the name attribute.
* `dmg_name` - Specify the name of the dmg if it is not the same as `app`, or if the name has spaces.Usage Examples
==============Install `/Applications/Tunnelblick.app` from the primary download site.
dmg_package "Tunnelblick" do
source "http://tunnelblick.googlecode.com/files/Tunnelblick_3.1.2.dmg"
checksum "a3fae60b6833175f32df20c90cd3a3603a"
action :install
endInstall Google Chrome. Uses the `dmg_name` because the application name has spaces. Installs in `/Applications/Google Chrome.app`.
dmg_package "Google Chrome" do
dmg_name "googlechrome"
source "https://dl-ssl.google.com/chrome/mac/stable/GGRM/googlechrome.dmg"
checksum "7daa2dc5c46d9bfb14f1d7ff4b33884325e5e63e694810adc58f14795165c91a"
action :install
endInstall Dropbox. Uses `volumes_dir` because the mounted directory is different than the name of the application directory. Installs in `/Applications/Dropbox.app`.
dmg_package "Dropbox" do
volumes_dir "Dropbox Installer"
source "http://www.dropbox.com/download?plat=mac"
checksum "b4ea620ca22b0517b75753283ceb82326aca8bc3c86212fbf725de6446a96a13"
action :install
endInstall MacIrssi to `~/Applications` from the local file downloaded to the cache path into an Applications directory in the current user's home directory. Chef should run as a non-root user for this.
directory "#{ENV['HOME']}/Applications"
dmg_package "MacIrssi" do
destination "#{ENV['HOME']}/Applications"
action :install
endInstall Virtualbox to `/Applications` from the .mpkg:
dmg_package "Virtualbox" do
source "http://dlc.sun.com.edgesuite.net/virtualbox/4.0.8/VirtualBox-4.0.8-71778-OSX.dmg"
type "mpkg"
endTo do
=====A few things remain outstanding to make this cookbook "1.0" quality.
* support downloading a .dmg.zip and unzipping it
* specify a local .dmg already downloaded in another location (like ~/Downloads)Some things that would be nice to have at some point.
* use hdiutil to mount/attach the disk image
* automatically detect the `volumes_dir` where the image is attached
* be able to automatically accept license agreementsLicense and Author
==================* Copyright 2011, Joshua Timberman
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and