let :default_params do
{
:ensure => 'present',
+ :order => '',
:packages => '*',
:priority => '0',
:release => nil
:packages => 'apache',
:priority => '1'
},
+ {
+ :order => 50,
+ :packages => 'apache',
+ :priority => '1'
+ },
{
:ensure => 'absent',
:packages => 'apache',
it { should contain_file("#{title}.pref").with({
'ensure' => param_hash[:ensure],
- 'path' => "/etc/apt/preferences.d/#{title}.pref",
+ 'path' => "/etc/apt/preferences.d/#{param_hash[:order] == '' ? "" : "#{param_hash[:order]}-"}#{title}.pref",
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
- 'content' => "# #{title}\nPackage: #{param_hash[:packages]}\nPin: release a=#{param_hash[:release] || title}\nPin-Priority: #{param_hash[:priority]}\n",
+ 'content' => "# #{title}\nExplanation: : #{title}\nPackage: #{param_hash[:packages]}\nPin: release a=#{param_hash[:release] || title}\nPin-Priority: #{param_hash[:priority]}\n",
})
}
end