Defined Type: homebrew::tap

Defined in:
manifests/tap.pp

Overview

Parameters:

  • ensure (Enum['present', 'absent']) (defaults to: 'present')
  • repo (Variant[Undef, String[1]]) (defaults to: undef)


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
# File 'manifests/tap.pp', line 3

define homebrew::tap(
  Enum['present', 'absent'] $ensure = 'present',
  Variant[Undef, String[1]] $repo = undef
) {
  $slug = $title

  if $repo {
    $repo_url = $repo
  } else {
    $repo_url = "https://github.com/${slug}"
  }

  $repo_path = "${homebrew::path}/Library/Taps/${slug}"

  exec { "mkdir -p ${repo_path}":
    user    => $homebrew::owner,
    group   => $homebrew::group,
    creates => $repo_path
  }
  -> vcsrepo { $repo_path:
    ensure   => $ensure,
    provider => git,
    source   => $repo_url,
    owner    => $homebrew::owner,
    group    => $homebrew::group,
    require  => Vcsrepo[$homebrew::path]
  }
}