From 3df0990a2015b39427b7e9a2ef11ef5b4a8d24e6 Mon Sep 17 00:00:00 2001 From: "kirby@puppetlabs.com" Date: Tue, 28 Apr 2015 13:49:56 -0700 Subject: [PATCH 1/2] Update init so it can actually install git on something that isn't osx --- manifests/init.pp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 33d5b14..9b5f24c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -5,8 +5,13 @@ include git::params + case $::operatingsystem { + 'Darwin': { $source = $sources } + default: { $source = undef } + } + package { $git::params::packages: ensure => present, - source => $sources, + source => $source } } From 2f808770dfa5e5a253fcd729bd1dba66aa1ddf30 Mon Sep 17 00:00:00 2001 From: "kirby@puppetlabs.com" Date: Tue, 28 Apr 2015 14:00:21 -0700 Subject: [PATCH 2/2] Ignore sources --- manifests/init.pp | 19 ++++++++++++------- manifests/params.pp | 6 +++--- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 9b5f24c..72aa908 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,17 +1,22 @@ # install everything required to be a git client class git ( + $ensure = present, $sources = "https://git-osx-installer.googlecode.com/files/git-1.8.3.2-intel-universal-snow-leopard.dmg" ){ include git::params case $::operatingsystem { - 'Darwin': { $source = $sources } - default: { $source = undef } - } - - package { $git::params::packages: - ensure => present, - source => $source + 'Darwin': { + package { $git::params::packages: + ensure => $ensure, + source => $sources + } + } + default: { + package { $git::params::packages: + ensure => $ensure + } + } } } diff --git a/manifests/params.pp b/manifests/params.pp index 7f0018c..d235bb9 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,11 +1,11 @@ # = Class: git::params # class git::params { - case $operatingsystem { + case $::operatingsystem { 'Debian': { $packages = 'git' } 'Ubuntu': { $packages = 'git-core' } 'Ubuntu': { - case $operatingsystemrelease { + case $::operatingsystemrelease { 'Hardy', 'Lucid': { $packages = 'git-core' } default: { $packages = 'git' } } @@ -24,6 +24,6 @@ require => File['/usr/local/bin'], } } - default: { fail("No git package known for operating system ${operatingsystem}") } + default: { fail("No git package known for operating system ${::operatingsystem}") } } }