diff --git a/REFERENCE.md b/REFERENCE.md index 6d61a2de..bbc59bf3 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -12,7 +12,6 @@ #### Private Classes -* `postfix::augeas`: Provides augeas lenses for postfix files * `postfix::files`: Manages the Postfix related files * `postfix::ldap`: Provides the Postfix LDAP support * `postfix::mailman`: Configure Postfix to work with mailman diff --git a/files/lenses/postfix_canonical.aug b/lib/augeas/lenses/postfix_canonical.aug similarity index 100% rename from files/lenses/postfix_canonical.aug rename to lib/augeas/lenses/postfix_canonical.aug diff --git a/files/lenses/test_postfix_canonical.aug b/lib/augeas/lenses/test_postfix_canonical.aug similarity index 100% rename from files/lenses/test_postfix_canonical.aug rename to lib/augeas/lenses/test_postfix_canonical.aug diff --git a/manifests/augeas.pp b/manifests/augeas.pp deleted file mode 100644 index 3ea11b23..00000000 --- a/manifests/augeas.pp +++ /dev/null @@ -1,16 +0,0 @@ -# @summary Provides augeas lenses for postfix files -# -# This class provides the augeas lenses used by the postfix class -# -# @api private -# -class postfix::augeas { - assert_private() - - $module_path = get_module_path($module_name) - augeas::lens { 'postfix_canonical': - ensure => present, - lens_content => file("${module_path}/files/lenses/postfix_canonical.aug"), - test_content => file("${module_path}/files/lenses/test_postfix_canonical.aug"), - } -} diff --git a/manifests/canonical.pp b/manifests/canonical.pp index 2a2b6706..d769b01c 100644 --- a/manifests/canonical.pp +++ b/manifests/canonical.pp @@ -43,7 +43,6 @@ String[1] $lookup_table_suffix = 'db', ) { include postfix - include postfix::augeas $_file = pick($file, "${postfix::confdir}/canonical") @@ -66,7 +65,7 @@ augeas { "Postfix canonical - ${name}": incl => $_file, - lens => 'Postfix_Canonical.lns', + lens => 'postfix_canonical.lns', changes => $changes, require => Package['postfix'], notify => Exec["generate ${_file}.${lookup_table_suffix}"], diff --git a/metadata.json b/metadata.json index f3f74815..7abcf9c0 100644 --- a/metadata.json +++ b/metadata.json @@ -12,10 +12,6 @@ "name": "puppetlabs/stdlib", "version_requirement": ">= 4.13.0 < 10.0.0" }, - { - "name": "camptocamp/augeas", - "version_requirement": ">= 1.0.0 < 2.0.0" - }, { "name": "puppet/alternatives", "version_requirement": ">= 2.0.0 < 6.0.0" diff --git a/spec/acceptance/canonical_spec.rb b/spec/acceptance/canonical_spec.rb new file mode 100644 index 00000000..cad05588 --- /dev/null +++ b/spec/acceptance/canonical_spec.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +require 'spec_helper_acceptance' + +describe 'postfix::canonical' do + it_behaves_like 'an idempotent resource' do + let(:manifest) do + <<~PUPPET + include postfix + postfix::hash { '/etc/postfix/recipient_canonical': + ensure => present, + } + postfix::config { 'canonical_alias_maps': + value => 'hash:/etc/postfix/recipient_canonical', + } + postfix::canonical { 'user@example.com': + file => '/etc/postfix/recipient_canonical', + ensure => present, + destination => 'root', + } + PUPPET + end + end +end