Commit 4a6a1e80 authored by Adam Lewenberg's avatar Adam Lewenberg
Browse files

os: change name of aptitude update exec resource

parent e94099c9
release/005.004 (2017-01-09)
[os] Change the exec resource in the 'aptitude' staged
base::os::debian::apt class to have the name 'apt config aptitude
update' so that it will not interfere with other exec's of the same
name in the 'main' stage. [adamhl]
release/005.003 (2016-12-16)
[ssh] Add "@" to a few more variables on sshd_config.erb. [adamhl]
......
......@@ -137,13 +137,23 @@ class base::os::debian (
# sources, preferences, etc. It is meant to be run in its own phase, before
# the main phase. This is needed so that we can install packages without the
# possibility of weird aptitude errors.
# There is an exec resource in this class that does an 'aptitude
# update'. This class runs in the early 'aptitude' stage (see earlier in
# this file) and hence the exec resource also runs in this early
# stage. However, this can cause a problem if classes running in the
# 'main' stage call 'exec aptitude'. To avoid this issue, we give the
# 'aptitude update' resource in this class a different name; any other
# class that wants to run 'aptitude update' will have to declare the
# 'aptitude update' exec resource itself.
class base::os::debian::apt (
$apt_cache_notin_tmp = false,
$apt_cache_tmp_dir = '/var/cache/apt/tmp'
){
# Define aptitude update as a command we can run
exec { 'aptitude update':
exec { 'apt config aptitude update':
command => 'aptitude update',
path => '/bin:/usr/bin',
refreshonly => true,
......@@ -153,7 +163,7 @@ class base::os::debian::apt (
# Make sure this gets created BEFORE `aptitude update` runs.
file { '/etc/apt/apt.conf.d/10recommends':
source => 'puppet:///modules/base/os/etc/apt/apt.conf.d/10recommends',
before => Exec['aptitude update'],
before => Exec['apt config aptitude update'],
}
# If aptitude is using something other than /tmp, set that up first
......@@ -171,7 +181,7 @@ class base::os::debian::apt (
file { '/etc/apt/apt.conf.d/apt_cache_tmp':
content => template('base/os/etc/apt/apt.conf.d/apt_cache_tmp.erb'),
require => File[$apt_cache_tmp_dir],
before => Exec['aptitude update'],
before => Exec['apt config aptitude update'],
}
}
......@@ -180,7 +190,7 @@ class base::os::debian::apt (
if $::lsbdistcodename == 'wheezy' {
file { '/etc/apt/apt.conf.d/30no-pdiffs':
source => 'puppet:///modules/base/os/etc/apt/apt.conf.d/30no-pdiffs',
before => Exec['aptitude update'],
before => Exec['apt config aptitude update'],
}
}
......@@ -189,18 +199,18 @@ class base::os::debian::apt (
file {
'/etc/apt/sources.list':
content => template('base/os/sources/sources.list.erb'),
notify => Exec['aptitude update'];
notify => Exec['apt config aptitude update'];
'/etc/apt/sources.list.d':
ensure => 'directory',
recurse => true,
purge => true,
notify => Exec['aptitude update'];
notify => Exec['apt config aptitude update'];
'/etc/apt/sources.list.d/backports.list':
content => template('base/os/sources/backports.list.erb'),
notify => Exec['aptitude update'];
notify => Exec['apt config aptitude update'];
'/etc/apt/sources.list.d/stanford.list':
content => template('base/os/sources/stanford.list.erb'),
notify => Exec['aptitude update'];
notify => Exec['apt config aptitude update'];
}
# Install APT preferences. We should never use /etc/apt/preferences
......@@ -213,21 +223,21 @@ class base::os::debian::apt (
if $::lsbdistcodename == 'wheezy' {
file { '/etc/apt/preferences.d/rsyslog':
content => template('base/os/preferences/rsyslog.erb'),
notify => Exec['aptitude update'],
notify => Exec['apt config aptitude update'],
}
}
file {
'/etc/apt/preferences':
content => '',
notify => Exec['aptitude update'];
notify => Exec['apt config aptitude update'];
'/etc/apt/preferences.d/backports':
content => template('base/os/preferences/backports.erb'),
notify => Exec['aptitude update'];
notify => Exec['apt config aptitude update'];
}
# Install the stanford-keyring package
package { 'stanford-keyring':
require => File['/etc/apt/sources.list.d/stanford.list'],
notify => Exec['aptitude update'],
notify => Exec['apt config aptitude update'],
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment