##### Parameters (all optional)
+* `confs`: Creates new `apt::conf` resources. Valid options: a hash to be passed to the [`create_resources` function](https://docs.puppetlabs.com/references/latest/function.html#createresources). Default: {}.
+
* `keys`: Creates new `apt::key` resources. Valid options: a hash to be passed to the [`create_resources` function](https://docs.puppetlabs.com/references/latest/function.html#createresources). Default: {}.
* `ppas`: Creates new `apt::ppa` resources. Valid options: a hash to be passed to the [`create_resources` function](https://docs.puppetlabs.com/references/latest/function.html#createresources). Default: {}.
+# == Class: apt
#
-class apt(
+# Manage APT (Advanced Packaging Tool)
+#
+class apt (
+ $confs = {},
$update = {},
$purge = {},
$proxy = {},
$_proxy = merge($apt::proxy_defaults, $proxy)
+ validate_hash($confs)
validate_hash($sources)
validate_hash($keys)
validate_hash($settings)
notify => Class['apt::update'],
}
+ if $confs {
+ create_resources('apt::conf', $confs)
+ }
# manage sources if present
if $sources {
create_resources('apt::source', $sources)
it { is_expected.to contain_file('/etc/apt/sources.list.d/puppetlabs.list').with_content(/^deb http:\/\/apt.puppetlabs.com precise main$/) }
end
+ context 'with confs defined on valid osfamily' do
+ let :facts do
+ { :osfamily => 'Debian',
+ :lsbdistcodename => 'precise',
+ :lsbdistid => 'Debian',
+ :puppetversion => Puppet.version,
+ }
+ end
+ let(:params) { { :confs => {
+ 'foo' => {
+ 'content' => 'foo',
+ },
+ 'bar' => {
+ 'content' => 'bar',
+ }
+ } } }
+
+ it { is_expected.to contain_apt__conf('foo').with({
+ :content => 'foo',
+ })}
+
+ it { is_expected.to contain_apt__conf('bar').with({
+ :content => 'bar',
+ })}
+ end
+
context 'with keys defined on valid osfamily' do
let :facts do
{ :osfamily => 'Debian',