make password file resource sensitive

This commit is contained in:
Nathan L Smith 2015-05-03 23:10:24 -05:00
parent aa1f845864
commit 689345ac5c
2 changed files with 18 additions and 0 deletions

View File

@ -49,6 +49,7 @@ execute 'postmap-sasl_passwd' do
end end
template node['postfix']['sasl_password_file'] do template node['postfix']['sasl_password_file'] do
sensitive true
source 'sasl_passwd.erb' source 'sasl_passwd.erb'
owner 'root' owner 'root'
group node['root_group'] group node['root_group']

17
spec/sasl_auth_spec.rb Normal file
View File

@ -0,0 +1,17 @@
require 'spec_helper'
describe 'postfix::sasl_auth' do
let(:password_file) { '/etc/postfix/sasl_passwd' }
let(:chef_run) do
ChefSpec::Runner.new do |node|
node.default['postfix']['sasl_password_file'] = password_file
end.converge(described_recipe)
end
describe 'password file template' do
it 'does not display sensitive information' do
expect(chef_run).to create_template(password_file).with(sensitive: true)
end
end
end