Abs paths for all commands

This commit is contained in:
Ben Godfrey 2011-03-11 17:02:50 +00:00 committed by Ben Godfrey
parent 627718fd34
commit 71fc425176
6 changed files with 20 additions and 20 deletions

View file

@ -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}"
}
}
}

View file

@ -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"] ],

View file

@ -7,7 +7,7 @@ define apt::pin(
) {
include apt
file { "${name}.pref":
name => "${apt::root}/preferences.d/${name}",
ensure => file,

View file

@ -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'

View file

@ -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}\";"
}
}
}

View file

@ -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"],
}
}