Adds an apt source to `/etc/apt/sources.list.d/`.
apt::source { 'debian_unstable':
+ comment => 'This is the iWeb Debian unstable mirror',
location => 'http://debian.mirror.iweb.ca/debian/',
release => 'unstable',
repos => 'main contrib non-free',
# add an apt source
define apt::source(
+ $comment = $name,
$ensure = present,
$location = '',
$release = 'UNDEF',
EOS
apply_manifest(pp, :expect_failures => true) do |r|
- expect(r.stderr).to match(/Host not found/)
+ expect(r.stderr).to match(/(Host not found|Couldn't resolve host)/)
end
end
end
it 'should work with no errors' do
pp = <<-EOS
include apt
- apt::force { 'vim': timeout => '1' }
+ apt::force { 'ocaml': timeout => '1' }
EOS
shell('apt-get clean')
end
end
- describe package('vim') do
+ describe package('ocaml') do
it { should_not be_installed }
end
end
end
let :content do
- content = "# #{title}"
+ content = "#file generated by puppet\n"
+ if param_hash[:comment]
+ content << "# #{comment}"
+ else
+ content << "# #{title}"
+ end
if param_hash[:architecture]
arch = "[arch=#{param_hash[:architecture]}] "
end
-# <%= @name %>
+#file generated by puppet
+# <%= @comment %>
deb <% if @architecture %>[arch=<%= @architecture %>] <% end %><%= @location %> <%= @release_real %> <%= @repos %>
<%- if @include_src then -%>
deb-src <% if @architecture %>[arch=<%= @architecture %>] <% end %><%= @location %> <%= @release_real %> <%= @repos %>