Defined Type: puppet::git-modules

Defined in:
manifests/git-modules.pp

Overview

Parameters:

  • cloneUrl (Any)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'manifests/git-modules.pp', line 1

define puppet::git-modules ($cloneUrl) {

  include 'puppet::common'
  require 'git'

  $path = "/etc/puppet/repos/${name}"

  exec {"puppet repo ${name}":
    command => "git clone ${cloneUrl} ${path}",
    path => ['/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin'],
    creates => $path,
    notify => Exec['/etc/puppet/conf.d/main-modulepath'],
  }

  $command = "cd '${path}' && git pull --quiet"
  cron {"cron ${command}":
    command => $command,
    user    => root,
  }
}