Don't purge by default. That seems unnecessarily destructive.
This commit is contained in:
parent
db9daeb183
commit
3a20254108
3 changed files with 14 additions and 15 deletions
10
README.md
10
README.md
|
@ -39,7 +39,7 @@ class { 'apt': }
|
|||
|
||||
### Classes
|
||||
|
||||
* `apt`: Main class, provides common resources and options. Allows Puppet to manage your system's sources.list file and sources.list.d directory. By default, it will purge any existing content it finds that wasn't declared with Puppet.
|
||||
* `apt`: Main class, provides common resources and options. Allows Puppet to manage your system's sources.list file and sources.list.d directory. By default, it will not purge existing content it finds that wasn't declared with Puppet.
|
||||
|
||||
* `apt::backports`: This class adds the necessary components to get backports for Ubuntu and Debian. The release name defaults to "$lsbdistcodename-backports". Setting this manually can cause undefined and potentially serious behavior.
|
||||
|
||||
|
@ -195,10 +195,10 @@ apt::sources:
|
|||
* 'timeout': Overrides the exec timeout in seconds for `apt-get update`. Defaults to exec default (300).
|
||||
* 'tries': Sets how many times to attempt running `apt-get update`. Use this to work around transient DNS and HTTP errors. By default, the command runs only once.
|
||||
* `purge`: Hash to configure various purge settings. Valid keys are:
|
||||
* 'sources.list': If set to 'true', Puppet purges all unmanaged entries from sources.list. Accepts `true` or `false`. Defaults to `true`.
|
||||
* 'sources.list.d': If set to 'true', Puppet purges all unmanaged entries from sources.list.d. Accepts `true` or `false`. Defaults to `true`.
|
||||
* 'preferences.list': If set to 'true', Puppet purges all unmanaged entries from preferences.list. Accepts `true` or `false`. Defaults to `true`.
|
||||
* 'preferences.list.d': If set to 'true', Puppet purges all unmanaged entries from preferences.list.d. Accepts `true` or `false`. Defaults to `true`.
|
||||
* 'sources.list': If set to 'true', Puppet purges all unmanaged entries from sources.list. Accepts `true` or `false`. Defaults to `false`.
|
||||
* 'sources.list.d': If set to 'true', Puppet purges all unmanaged entries from sources.list.d. Accepts `true` or `false`. Defaults to `false`.
|
||||
* 'preferences.list': If set to 'true', Puppet purges all unmanaged entries from preferences.list. Accepts `true` or `false`. Defaults to `false`.
|
||||
* 'preferences.list.d': If set to 'true', Puppet purges all unmanaged entries from preferences.list.d. Accepts `true` or `false`. Defaults to `false`.
|
||||
* `proxy`: Hash to configure various proxy settings. Valid keys are:
|
||||
* 'host': Configures a proxy host and stores the configuration in /etc/apt/apt.conf.d/01proxy.
|
||||
* 'port': Configures a proxy port and stores the configuration in /etc/apt/apt.conf.d/01proxy.
|
||||
|
|
|
@ -69,10 +69,10 @@ class apt::params {
|
|||
}
|
||||
|
||||
$purge_defaults = {
|
||||
'sources.list' => true,
|
||||
'sources.list.d' => true,
|
||||
'preferences' => true,
|
||||
'preferences.d' => true,
|
||||
'sources.list' => false,
|
||||
'sources.list.d' => false,
|
||||
'preferences' => false,
|
||||
'preferences.d' => false,
|
||||
}
|
||||
|
||||
$source_key_defaults = {
|
||||
|
|
|
@ -9,7 +9,6 @@ describe 'apt' do
|
|||
:owner => 'root',
|
||||
:group => 'root',
|
||||
:mode => '0644',
|
||||
:content => "# Repos managed by puppet.\n",
|
||||
:notify => 'Exec[apt_update]',
|
||||
})}
|
||||
|
||||
|
@ -19,13 +18,13 @@ describe 'apt' do
|
|||
:owner => 'root',
|
||||
:group => 'root',
|
||||
:mode => '0644',
|
||||
:purge => true,
|
||||
:recurse => true,
|
||||
:purge => false,
|
||||
:recurse => false,
|
||||
:notify => 'Exec[apt_update]',
|
||||
})}
|
||||
|
||||
it { is_expected.to contain_file('preferences').that_notifies('Exec[apt_update]').only_with({
|
||||
:ensure => 'absent',
|
||||
:ensure => 'file',
|
||||
:path => '/etc/apt/preferences',
|
||||
:owner => 'root',
|
||||
:group => 'root',
|
||||
|
@ -39,8 +38,8 @@ describe 'apt' do
|
|||
:owner => 'root',
|
||||
:group => 'root',
|
||||
:mode => '0644',
|
||||
:purge => true,
|
||||
:recurse => true,
|
||||
:purge => false,
|
||||
:recurse => false,
|
||||
:notify => 'Exec[apt_update]',
|
||||
})}
|
||||
|
||||
|
|
Loading…
Reference in a new issue