Use append_if_no_such_line instead of line.
This commit is contained in:
parent
7a0dc9a37a
commit
2d75cda2db
2 changed files with 6 additions and 5 deletions
|
@ -1,9 +1,8 @@
|
|||
class apt::dselect {
|
||||
# suppress annoying help texts of dselect
|
||||
line { dselect_expert:
|
||||
append_if_no_such_line { dselect_expert:
|
||||
file => "/etc/dpkg/dselect.cfg",
|
||||
line => "expert",
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
package { dselect: ensure => installed }
|
||||
|
|
|
@ -105,13 +105,13 @@ class apt {
|
|||
|
||||
config_file { '/etc/apt/apt.conf.d/99from_puppet': }
|
||||
# little default settings which keep the system sane
|
||||
line { 'apt-get-show-upgraded':
|
||||
append_if_no_such_line { 'apt-get-show-upgraded':
|
||||
file => "/etc/apt/apt.conf.d/99from_puppet",
|
||||
line => "APT::Get::Show-Upgraded true;",
|
||||
before => Config_file[apt_config],
|
||||
require => Config_file['/etc/apt/apt.conf.d/99from_puppet'],
|
||||
}
|
||||
line { 'dselect-clean':
|
||||
append_if_no_such_line { 'dselect-clean':
|
||||
file => "/etc/apt/apt.conf.d/99from_puppet",
|
||||
line => "DSelect::Clean ${real_apt_clean};",
|
||||
before => Config_file[apt_config],
|
||||
|
@ -121,7 +121,9 @@ class apt {
|
|||
file {
|
||||
"/etc/apt/apt.conf.d/from_puppet":
|
||||
ensure => 'absent',
|
||||
require => [ Line['apt-get-show-upgraded'], Line['dselect-clean'] ],
|
||||
require => [ Append_if_no_such_line['apt-get-show-upgraded'],
|
||||
Append_if_no_such_line['dselect-clean']
|
||||
],
|
||||
}
|
||||
|
||||
if $apt_unattended_upgrades {
|
||||
|
|
Loading…
Reference in a new issue