file { "${apt_conf_d}/${priority}${name}":
ensure => $ensure,
- content => $content,
+ content => template('apt/_header.erb', 'apt/conf.erb'),
owner => root,
group => root,
mode => '0644',
file { '/etc/apt/apt.conf.d/15update-stamp':
ensure => 'file',
- content => 'APT::Update::Post-Invoke-Success {"touch /var/lib/apt/periodic/update-success-stamp 2>/dev/null || true";};',
+ content => template('apt/_header.erb', 'apt/15update-stamp.erb'),
group => 'root',
mode => '0644',
owner => 'root',
true: {
file { '99progressbar':
ensure => present,
- content => 'Dpkg::Progress-Fancy "1";',
+ content => template('apt/_header.erb', 'apt/progressbar.erb'),
path => "${apt_conf_d}/99progressbar",
}
}
true: {
file { '99unauth':
ensure => present,
- content => "APT::Get::AllowUnauthenticated 1;\n",
+ content => template('apt/_header.erb', 'apt/unauth.erb'),
path => "${apt_conf_d}/99unauth",
}
}
file { '01proxy':
ensure => present,
path => "${apt_conf_d}/01proxy",
- content => "Acquire::http::Proxy \"http://${proxy_host}:${proxy_port}\";\n",
+ content => template('apt/_header.erb', 'apt/proxy.erb'),
notify => Exec['apt_update'],
mode => '0644',
owner => root,
owner => root,
group => root,
mode => '0644',
- content => template('apt/pin.pref.erb'),
+ content => template('apt/_header.erb', 'apt/pin.pref.erb'),
}
}
owner => root,
group => root,
mode => '0644',
- content => "APT::Default-Release \"${release_id}\";"
+ content => template('apt/_header.erb', 'apt/release.erb'),
}
}
owner => root,
group => root,
mode => '0644',
- content => template("${module_name}/source.list.erb"),
+ content => template('apt/_header.erb', 'apt/source.list.erb'),
notify => Exec['apt_update'],
}
owner => 'root',
group => 'root',
mode => '0644',
- content => template('apt/50unattended-upgrades.erb'),
+ content => template('apt/_header.erb', 'apt/50unattended-upgrades.erb'),
require => Package['unattended-upgrades'],
}
owner => 'root',
group => 'root',
mode => '0644',
- content => template('apt/10periodic.erb'),
+ content => template('apt/_header.erb', 'apt/10periodic.erb'),
require => Package['unattended-upgrades'],
}
}
'group' => 'root',
'mode' => '0644',
'owner' => 'root',
- }).with_content('APT::Update::Post-Invoke-Success {"touch /var/lib/apt/periodic/update-success-stamp 2>/dev/null || true";};')
+ }).with_content(/APT::Update::Post-Invoke-Success \{"touch \/var\/lib\/apt\/periodic\/update-success-stamp 2>\/dev\/null \|\| true";\};/)
end
it { should contain_file('old-proxy-file').that_notifies('Exec[apt_update]').only_with({
it { should contain_file('99progressbar').only_with({
'ensure' => 'present',
- 'content' => 'Dpkg::Progress-Fancy "1";',
+ 'content' => /Dpkg::Progress-Fancy "1";/,
'path' => '/etc/apt/apt.conf.d/99progressbar',
})}
it { should contain_file('99unauth').only_with({
'ensure' => 'present',
- 'content' => "APT::Get::AllowUnauthenticated 1;\n",
+ 'content' => /APT::Get::AllowUnauthenticated 1;/,
'path' => '/etc/apt/apt.conf.d/99unauth',
})}
it { should contain_file('01proxy').that_notifies('Exec[apt_update]').only_with({
'ensure' => 'present',
'path' => '/etc/apt/apt.conf.d/01proxy',
- 'content' => "Acquire::http::Proxy \"http://foo:9876\";\n",
+ 'content' => /Acquire::http::Proxy "http:\/\/foo:9876";/,
'notify' => 'Exec[apt_update]',
'mode' => '0644',
'owner' => 'root',
"mode" => "0644",
"owner" => "root",
"group" => "root",
- "content" => "APT::Default-Release \"#{param_set[:release_id]}\";"
+ "content" => /APT::Default-Release "#{param_set[:release_id]}";/
})
}
end
it { should contain_file(filename).with({
'ensure' => 'present',
- 'content' => "Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;\n",
+ 'content' => /Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;/,
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
it { should contain_file(filename).with({
'ensure' => 'absent',
- 'content' => "Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;\n",
+ 'content' => /Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;/,
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
- }).with_content(/#file generated by puppet\n# my_source\ndeb-src wheezy main\n/)
+ }).with_content(/# my_source\ndeb-src wheezy main\n/)
}
end
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
- }).with_content(/#file generated by puppet\n# foo\ndeb \[arch=x86_64 trusted=yes\] http:\/\/debian\.mirror\.iweb\.ca\/debian\/ sid testing\n/).without_content(/deb-src/)
+ }).with_content(/# foo\ndeb \[arch=x86_64 trusted=yes\] http:\/\/debian\.mirror\.iweb\.ca\/debian\/ sid testing\n/).without_content(/deb-src/)
}
it { is_expected.to contain_apt__pin('my_source').that_comes_before('File[my_source.list]').with({
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
- }).with_content(/#file generated by puppet\n# my_source\ndeb \[trusted=yes\] wheezy main\n/)
+ }).with_content(/# my_source\ndeb \[trusted=yes\] wheezy main\n/)
}
end
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
- }).with_content(/#file generated by puppet\n# my_source\ndeb-src \[arch=x86_64 \] wheezy main\n/)
+ }).with_content(/# my_source\ndeb-src \[arch=x86_64 \] wheezy main\n/)
}
end
--- /dev/null
+APT::Update::Post-Invoke-Success {"touch /var/lib/apt/periodic/update-success-stamp 2>/dev/null || true";};
--- /dev/null
+# This file is managed by Puppet. DO NOT EDIT.
--- /dev/null
+<%= @content -%>
--- /dev/null
+Dpkg::Progress-Fancy "1";
--- /dev/null
+Acquire::http::Proxy "http://<%= @proxy_host %>:<%= @proxy_port %>";
--- /dev/null
+APT::Default-Release "<%= @release_id %>";
-#file generated by puppet
# <%= @comment %>
<%- if @include_deb then -%>
deb <%- if @architecture or @trusted_source -%>
--- /dev/null
+APT::Get::AllowUnauthenticated 1;