diff --git a/manifests/force.pp b/manifests/force.pp index e56246b..564ed75 100644 --- a/manifests/force.pp +++ b/manifests/force.pp @@ -5,12 +5,12 @@ define apt::force( $release = 'testing', $version = false ) { - - exec { "aptitude -y -t ${release} install ${name}": + + exec { "/usr/bin/aptitude -y -t ${release} install ${name}": unless => $version ? { - false => "dpkg -l | grep ${name}", - default => "dpkg -l | grep ${name} | grep ${version}" + false => "/usr/bin/dpkg -l | grep ${name}", + default => "/usr/bin/dpkg -l | grep ${name} | grep ${version}" } } - + } diff --git a/manifests/init.pp b/manifests/init.pp index f7b7746..7513983 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -2,8 +2,8 @@ class apt { $root = '/etc/apt' - $provider = 'apt-get' - + $provider = '/usr/bin/apt-get' + file { "sources.list": name => "${root}/sources.list", ensure => present, @@ -11,14 +11,14 @@ class apt { group => root, mode => 644, } - + file { "sources.list.d": name => "${root}/sources.list.d", ensure => directory, owner => root, group => root, } - + exec { "apt_update": command => "${provider} update", subscribe => [ File["sources.list"], File["sources.list.d"] ], diff --git a/manifests/pin.pp b/manifests/pin.pp index 5a9dae6..e8b251f 100644 --- a/manifests/pin.pp +++ b/manifests/pin.pp @@ -7,7 +7,7 @@ define apt::pin( ) { include apt - + file { "${name}.pref": name => "${apt::root}/preferences.d/${name}", ensure => file, diff --git a/manifests/ppa.pp b/manifests/ppa.pp index 75f0a69..51959cf 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -1,10 +1,10 @@ # ppa.pp define apt::ppa( - + ) { include apt - + exec { "/usr/bin/add-apt-repository ${name}": require => Package["python-software-properties"], # TODO: unless => 'check' diff --git a/manifests/release.pp b/manifests/release.pp index 294bb78..cdd3da0 100644 --- a/manifests/release.pp +++ b/manifests/release.pp @@ -4,11 +4,11 @@ define apt::release ( ) { include apt - + file { "${apt::root}/apt.conf.d/01release": owner => root, group => root, mode => 644, content => "APT::Default-Release \"${name}\";" - } + } } diff --git a/manifests/source.pp b/manifests/source.pp index e9fa308..d6d93e4 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -22,27 +22,27 @@ define apt::source( mode => 644, content => template("apt/source.list.erb"), } - + if $pin != false { apt::pin { "${release}": priority => "${pin}" } } - + exec { "${name} apt update": command => "${apt::provider} update", subscribe => File["${name}.list"], refreshonly => true, } - + if $required_packages != false { exec { "${apt::provider} -y install ${required_packages}": subscribe => File["${name}.list"], refreshonly => true, } } - + if $key != false { - exec { "apt-key adv --keyserver ${key_server} --recv-keys ${key}": - unless => "apt-key list | grep ${key}", + exec { "/usr/bin/apt-key adv --keyserver ${key_server} --recv-keys ${key}": + unless => "/usr/bin/apt-key list | grep ${key}", before => File["${name}.list"], } }