name: 'Debian',
release: {
major: '9',
- full: '9.0',
+ full: '9.0'
},
distro: {
codename: 'stretch',
- id: 'Debian',
- },
- },
+ id: 'Debian'
+ }
+ }
}
end
end
end
- context 'with lots of non-defaults' do
+ context 'with lots of non-defaults - one' do
let :params do
{
update: { 'frequency' => 'always', 'timeout' => 1, 'tries' => 3 },
purge: { 'sources.list' => false, 'sources.list.d' => false,
'preferences' => false, 'preferences.d' => false,
- 'apt.conf.d' => false },
+ 'apt.conf.d' => false }
}
end
}
end
- context 'with lots of non-defaults' do
+ context 'with lots of non-defaults - two' do
let :params do
{
update: { 'frequency' => 'always', 'timeout' => 1, 'tries' => 3 },
purge: { 'sources.list' => true, 'sources.list.d' => true,
'preferences' => true, 'preferences.d' => true,
- 'apt.conf.d' => true },
+ 'apt.conf.d' => true }
}
end
{
update: { 'frequency' => 'always', 'timeout' => 1, 'tries' => 3 },
purge: { 'sources.list' => true },
- sources_list_force: false,
+ sources_list_force: false
}
end
{
update: { 'frequency' => 'always', 'timeout' => 1, 'tries' => 3 },
purge: { 'sources.list' => true },
- sources_list_force: true,
+ sources_list_force: true
}
end
name: 'Ubuntu',
release: {
major: '18',
- full: '18.04',
+ full: '18.04'
},
distro: {
codename: 'bionic',
- id: 'Ubuntu',
- },
- },
+ id: 'Ubuntu'
+ }
+ }
},
'Debian 9.0' => {
os: {
name: 'Debian',
release: {
major: '9',
- full: '9.0',
+ full: '9.0'
},
distro: {
codename: 'stretch',
- id: 'Debian',
- },
- },
+ id: 'Debian'
+ }
+ }
},
'Debian 10.0' => {
os: {
name: 'Debian',
release: {
major: '10',
- full: '10.0',
+ full: '10.0'
},
distro: {
codename: 'buster',
- id: 'Debian',
- },
- },
- },
+ id: 'Debian'
+ }
+ }
+ }
}
facts_hash.each do |os, facts|
- context "on #{os}" do
+ context "when on #{os}" do
let(:facts) do
facts
end
{
machine: 'deb.example.net',
login: 'foologin',
- password: 'secret',
+ password: 'secret'
},
{
machine: 'apt.example.com',
login: 'aptlogin',
- password: 'supersecret',
+ password: 'supersecret'
},
- ],
+ ]
}
end
super().merge(manage_auth_conf: true)
end
- auth_conf_content = "// This file is managed by Puppet. DO NOT EDIT.
-machine deb.example.net login foologin password secret
-machine apt.example.com login aptlogin password supersecret
-"
+ auth_conf_content = <<~CONTENT
+ // This file is managed by Puppet. DO NOT EDIT.
+ machine deb.example.net login foologin password secret
+ machine apt.example.com login aptlogin password supersecret
+ CONTENT
it {
expect(subject).to contain_file('/etc/apt/auth.conf').with(ensure: 'present',
{
machinn: 'deb.example.net',
username: 'foologin',
- password: 'secret',
+ password: 'secret'
},
{
machine: 'apt.example.com',
login: 'aptlogin',
- password: 'supersecret',
+ password: 'supersecret'
},
- ],
+ ]
}
end
name: 'Ubuntu',
release: {
major: '18',
- full: '18.04',
+ full: '18.04'
},
distro: {
codename: 'bionic',
- id: 'Ubuntu',
- },
- },
+ id: 'Ubuntu'
+ }
+ }
}
end
let(:params) do
'repos' => 'main contrib non-free',
'key' => { 'id' => '150C8614919D8446E01E83AF9AA38DCD55BE302B', 'server' => 'subkeys.pgp.net' },
'pin' => '-10',
- 'include' => { 'src' => true },
+ 'include' => { 'src' => true }
},
'puppetlabs' => {
'location' => 'http://apt.puppetlabs.com',
'repos' => 'main',
- 'key' => { 'id' => '6F6B15509CF8E59E6E469F327F438280EF8D349F', 'server' => 'pgp.mit.edu' },
- },
+ 'key' => { 'id' => '6F6B15509CF8E59E6E469F327F438280EF8D349F', 'server' => 'pgp.mit.edu' }
+ }
} }
end
name: 'Ubuntu',
release: {
major: '18',
- full: '18.04',
+ full: '18.04'
},
distro: {
codename: 'bionic',
- id: 'Ubuntu',
- },
- },
+ id: 'Ubuntu'
+ }
+ }
}
end
let(:params) do
{ confs: {
'foo' => {
- 'content' => 'foo',
+ 'content' => 'foo'
},
'bar' => {
- 'content' => 'bar',
- },
+ 'content' => 'bar'
+ }
} }
end
name: 'Ubuntu',
release: {
major: '18',
- full: '18.04',
+ full: '18.04'
},
distro: {
codename: 'bionic',
- id: 'Ubuntu',
- },
- },
+ id: 'Ubuntu'
+ }
+ }
}
end
let(:params) do
{ keys: {
'55BE302B' => {
- 'server' => 'subkeys.pgp.net',
+ 'server' => 'subkeys.pgp.net'
},
'EF8D349F' => {
- 'server' => 'pgp.mit.edu',
- },
+ 'server' => 'pgp.mit.edu'
+ }
} }
end
name: 'Ubuntu',
release: {
major: '18',
- full: '18.04',
+ full: '18.04'
},
distro: {
codename: 'bionic',
- id: 'Ubuntu',
- },
- },
+ id: 'Ubuntu'
+ }
+ }
}
end
let(:params) do
{ ppas: {
'ppa:drizzle-developers/ppa' => {},
- 'ppa:nginx/stable' => {},
+ 'ppa:nginx/stable' => {}
} }
end
name: 'Ubuntu',
release: {
major: '18',
- full: '18.04',
+ full: '18.04'
},
distro: {
codename: 'bionic',
- id: 'Ubuntu',
- },
- },
+ id: 'Ubuntu'
+ }
+ }
}
end
let(:params) do
{ settings: {
'conf-banana' => { 'content' => 'banana' },
- 'pref-banana' => { 'content' => 'banana' },
+ 'pref-banana' => { 'content' => 'banana' }
} }
end
name: 'Ubuntu',
release: {
major: '18',
- full: '18.04',
+ full: '18.04'
},
distro: {
codename: 'bionic',
- id: 'Ubuntu',
- },
- },
+ id: 'Ubuntu'
+ }
+ }
}
end
let(:params) do
{ pins: {
'stable' => { 'priority' => 600, 'order' => 50 },
- 'testing' => { 'priority' => 700, 'order' => 100 },
+ 'testing' => { 'priority' => 700, 'order' => 100 }
} }
end