Created
August 3, 2013 12:57
-
-
Save tmtk75/6146360 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class vagrant { | |
| include remote_file | |
| include install | |
| Class['vagrant::remote_file'] -> Class['vagrant::install'] | |
| } | |
| $dmg_url = "http://files.vagrantup.com/packages/7ec0ee1d00a916f80b109a298bab08e391945243/Vagrant-1.2.7.dmg" | |
| $node_vagrant_mount = "/Users/tsakuma/Vagrant-1.2.7.dmg" | |
| class vagrant::remote_file { | |
| exec { "dmg": | |
| path => "/bin:/usr/bin:/usr/local/bin", | |
| cwd => "/Users/tsakuma", | |
| command => "curl -O ${dmg_url}", | |
| creates => "${node_vagrant_mount}", | |
| unless => "ls ${node_vagrant_mount}" | |
| #onlyif => "test ${node_vagrant_mount}" | |
| } | |
| } | |
| class vagrant::install { | |
| $path = "/bin:/usr/bin:/usr/local/bin" | |
| exec { "htiutil": | |
| path => $path, | |
| command => "hdiutil mount ${node_vagrant_archive}", | |
| } | |
| exec { "installer": | |
| path => $path, | |
| command => "sudo installer -pkg '${node_vagrant_mount}/Vagrant.pkg' -target /", | |
| require => Exec['htiutil'], | |
| } | |
| exec { "umount": | |
| path => $path, | |
| command => "umount '${node_vagrant_mount}/'", | |
| require => Exec['installer'], | |
| } | |
| } | |
| include vagrant |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment