Puppet Class: homebrew

Defined in:
manifests/init.pp

Overview

Init class for the puppet-homebrew module

Parameters:

  • user (Any)
  • command_line_tools_package (Any) (defaults to: undef)
  • command_line_tools_source (Any) (defaults to: undef)
  • github_token (Any) (defaults to: undef)
  • group (Any) (defaults to: 'admin')
  • multiuser (Any) (defaults to: false)


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'manifests/init.pp', line 2

class homebrew (
  $user,
  $command_line_tools_package = undef,
  $command_line_tools_source  = undef,
  $github_token               = undef,
  $group                      = 'admin',
  $multiuser                  = false,
) {

  if $::operatingsystem != 'Darwin' {
    fail('This Module works on Mac OSX only!')
  }

  if $homebrew::user == 'root' {
    fail('Homebrew does not support installation as the "root" user.')
  }

  class { '::homebrew::compiler': }
  -> class { '::homebrew::install': }

  contain '::homebrew::compiler'
  contain '::homebrew::install'

  if $homebrew::github_token {
    file { '/etc/environment': ensure => present }
    -> file_line { 'homebrew-github-api-token':
      path  => '/etc/environment',
      line  => "HOMEBREW_GITHUB_API_TOKEN=${homebrew::github_token}",
      match => '^HOMEBREW_GITHUB_API_TOKEN',
    }
  }

}