forked from micahlmartin/puppet-chocolatey
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add class homebrew to install Homebrew itself.
- Loading branch information
1 parent
42cca80
commit 3ae9742
Showing
4 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class homebrew::compiler { | ||
if $has_compiler == 'true' { | ||
$package = [ ] | ||
} | ||
elsif versioncmp($macosx_productversion_major, '10.7') < 0 { | ||
warn('Please install the Command Line Tools bundled with XCode manually!') | ||
$package = [ ] | ||
} | ||
else { | ||
notice('Installing Command Line Tools.') | ||
$package = $homebrew::command_line_tools_package | ||
$source = $homebrew::command_line_tools_source | ||
} | ||
|
||
package { $package: | ||
ensure => present, | ||
provider => pkgdmg, | ||
source => $source, | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class homebrew( | ||
$command_line_tools_package = $homebrew::params::command_line_tools_package, | ||
$command_line_tools_source = $homebrew::params::command_line_tools_source, | ||
$user = $homebrew::params::user | ||
) inherits homebrew::params { | ||
include homebrew::compiler, homebrew::install | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
class homebrew::install { | ||
$directories = [ '/usr/local', | ||
'/usr/local/bin', | ||
'/usr/local/etc', | ||
'/usr/local/include', | ||
'/usr/local/lib', | ||
'/usr/local/lib/pkgconfig', | ||
'/usr/local/Library', | ||
'/usr/local/sbin', | ||
'/usr/local/share', | ||
'/usr/local/var', | ||
'/usr/local/var/log', | ||
'/usr/local/share/locale', | ||
'/usr/local/share/man', | ||
'/usr/local/share/man/man1', | ||
'/usr/local/share/man/man2', | ||
'/usr/local/share/man/man3', | ||
'/usr/local/share/man/man4', | ||
'/usr/local/share/man/man5', | ||
'/usr/local/share/man/man6', | ||
'/usr/local/share/man/man7', | ||
'/usr/local/share/man/man8', | ||
'/usr/local/share/info', | ||
'/usr/local/share/doc', | ||
'/usr/local/share/aclocal' ] | ||
|
||
file { $directories: | ||
ensure => directory, | ||
owner => $homebrew::user, | ||
group => 'admin', | ||
mode => 0775, | ||
} | ||
|
||
exec { 'install-homebrew': | ||
cwd => '/usr/local', | ||
command => "/usr/bin/su ${homebrew::user} -c '/bin/bash -o pipefail -c \"/usr/bin/curl -skSfL https://github.com/mxcl/homebrew/tarball/master | /usr/bin/tar xz -m --strip 1\"'", | ||
creates => '/usr/local/bin/brew', | ||
logoutput => on_failure, | ||
timeout => 0, | ||
require => File[$directories], | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class homebrew::params { | ||
if $operatingsystem != 'Darwin' { | ||
err('This Module works on Mac OS X only!') | ||
fail('Exit') | ||
} | ||
|
||
$command_line_tools_package = 'command_line_tools_for_xcode_os_x_lion_aug_2013.dmg' | ||
$command_line_tools_source = 'http://puppet/command_line_tools_for_xcode_os_x_lion_aug_2013.dmg' | ||
$user = 'root' | ||
} |