Abs paths for all commands
This commit is contained in:
parent
627718fd34
commit
71fc425176
6 changed files with 20 additions and 20 deletions
|
@ -5,12 +5,12 @@ define apt::force(
|
||||||
$release = 'testing',
|
$release = 'testing',
|
||||||
$version = false
|
$version = false
|
||||||
) {
|
) {
|
||||||
|
|
||||||
exec { "aptitude -y -t ${release} install ${name}":
|
exec { "/usr/bin/aptitude -y -t ${release} install ${name}":
|
||||||
unless => $version ? {
|
unless => $version ? {
|
||||||
false => "dpkg -l | grep ${name}",
|
false => "/usr/bin/dpkg -l | grep ${name}",
|
||||||
default => "dpkg -l | grep ${name} | grep ${version}"
|
default => "/usr/bin/dpkg -l | grep ${name} | grep ${version}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
class apt {
|
class apt {
|
||||||
$root = '/etc/apt'
|
$root = '/etc/apt'
|
||||||
$provider = 'apt-get'
|
$provider = '/usr/bin/apt-get'
|
||||||
|
|
||||||
file { "sources.list":
|
file { "sources.list":
|
||||||
name => "${root}/sources.list",
|
name => "${root}/sources.list",
|
||||||
ensure => present,
|
ensure => present,
|
||||||
|
@ -11,14 +11,14 @@ class apt {
|
||||||
group => root,
|
group => root,
|
||||||
mode => 644,
|
mode => 644,
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "sources.list.d":
|
file { "sources.list.d":
|
||||||
name => "${root}/sources.list.d",
|
name => "${root}/sources.list.d",
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
owner => root,
|
owner => root,
|
||||||
group => root,
|
group => root,
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { "apt_update":
|
exec { "apt_update":
|
||||||
command => "${provider} update",
|
command => "${provider} update",
|
||||||
subscribe => [ File["sources.list"], File["sources.list.d"] ],
|
subscribe => [ File["sources.list"], File["sources.list.d"] ],
|
||||||
|
|
|
@ -7,7 +7,7 @@ define apt::pin(
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include apt
|
include apt
|
||||||
|
|
||||||
file { "${name}.pref":
|
file { "${name}.pref":
|
||||||
name => "${apt::root}/preferences.d/${name}",
|
name => "${apt::root}/preferences.d/${name}",
|
||||||
ensure => file,
|
ensure => file,
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
# ppa.pp
|
# ppa.pp
|
||||||
|
|
||||||
define apt::ppa(
|
define apt::ppa(
|
||||||
|
|
||||||
) {
|
) {
|
||||||
include apt
|
include apt
|
||||||
|
|
||||||
exec { "/usr/bin/add-apt-repository ${name}":
|
exec { "/usr/bin/add-apt-repository ${name}":
|
||||||
require => Package["python-software-properties"],
|
require => Package["python-software-properties"],
|
||||||
# TODO: unless => 'check'
|
# TODO: unless => 'check'
|
||||||
|
|
|
@ -4,11 +4,11 @@ define apt::release (
|
||||||
|
|
||||||
) {
|
) {
|
||||||
include apt
|
include apt
|
||||||
|
|
||||||
file { "${apt::root}/apt.conf.d/01release":
|
file { "${apt::root}/apt.conf.d/01release":
|
||||||
owner => root,
|
owner => root,
|
||||||
group => root,
|
group => root,
|
||||||
mode => 644,
|
mode => 644,
|
||||||
content => "APT::Default-Release \"${name}\";"
|
content => "APT::Default-Release \"${name}\";"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,27 +22,27 @@ define apt::source(
|
||||||
mode => 644,
|
mode => 644,
|
||||||
content => template("apt/source.list.erb"),
|
content => template("apt/source.list.erb"),
|
||||||
}
|
}
|
||||||
|
|
||||||
if $pin != false {
|
if $pin != false {
|
||||||
apt::pin { "${release}": priority => "${pin}" }
|
apt::pin { "${release}": priority => "${pin}" }
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { "${name} apt update":
|
exec { "${name} apt update":
|
||||||
command => "${apt::provider} update",
|
command => "${apt::provider} update",
|
||||||
subscribe => File["${name}.list"],
|
subscribe => File["${name}.list"],
|
||||||
refreshonly => true,
|
refreshonly => true,
|
||||||
}
|
}
|
||||||
|
|
||||||
if $required_packages != false {
|
if $required_packages != false {
|
||||||
exec { "${apt::provider} -y install ${required_packages}":
|
exec { "${apt::provider} -y install ${required_packages}":
|
||||||
subscribe => File["${name}.list"],
|
subscribe => File["${name}.list"],
|
||||||
refreshonly => true,
|
refreshonly => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if $key != false {
|
if $key != false {
|
||||||
exec { "apt-key adv --keyserver ${key_server} --recv-keys ${key}":
|
exec { "/usr/bin/apt-key adv --keyserver ${key_server} --recv-keys ${key}":
|
||||||
unless => "apt-key list | grep ${key}",
|
unless => "/usr/bin/apt-key list | grep ${key}",
|
||||||
before => File["${name}.list"],
|
before => File["${name}.list"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue