diff --git a/manifests/files.pp b/manifests/files.pp index d745901743cc29d01fd36f9b9fb7d41c0a17ba6d..15ca815ffcc7d00883281f135589917580ec31ca 100644 --- a/manifests/files.pp +++ b/manifests/files.pp @@ -10,7 +10,7 @@ class postfix::files { # Aliases file { '/etc/aliases': ensure => present, - content => '# file managed by puppet\n', + content => "# file managed by puppet\n", replace => false, seltype => $postfix::params::seltype, notify => Exec['newaliases'], diff --git a/spec/classes/postfix_spec.rb b/spec/classes/postfix_spec.rb index 0ee2119cc8f9ad98a0da4808bfa8ab26e03c2cfe..9cc622925f97b0423616c949274ac34f32316a7e 100644 --- a/spec/classes/postfix_spec.rb +++ b/spec/classes/postfix_spec.rb @@ -5,17 +5,25 @@ describe 'postfix' do let (:facts) { { :operatingsystem => 'Debian', :osfamily => 'Debian', + :fqdn => 'fqdn.example.com', } } it { should contain_package('postfix') } + it { should contain_package('mailx') } + it { should contain_file('/etc/mailname').with_content("fqdn.example.com\n") } + it { should contain_file('/etc/aliases').with_content("# file managed by puppet\n") } end context 'when on RedHat' do let (:facts) { { :operatingsystem => 'RedHat', :osfamily => 'RedHat', + :fqdn => 'fqdn.example.com', } } it { should contain_package('postfix') } + it { should contain_package('mailx') } + it { should contain_file('/etc/mailname').with_content("fqdn.example.com\n") } + it { should contain_file('/etc/aliases').with_content("# file managed by puppet\n") } end end