-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Hiera support for postfix::config, postfix::hash, postfix::transport and postfix::virtual #50
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,14 @@ | |
# | ||
# [*use_sympa*] - (boolean) Whether to setup for Sympa | ||
# | ||
# [*configs*] - (hash) postfix::config definitions (for Hiera usage) | ||
# | ||
# [*hashs*] - (hash) postfix::hash definitions (for Hiera usage) | ||
# | ||
# [*transports*] - (hash) postfix::transport definitions (for Hiera usage) | ||
# | ||
# [*virtuals*] - (hash) postfix::virtual definitions (for Hiera usage) | ||
# | ||
# === Examples | ||
# | ||
# class { 'postfix': | ||
|
@@ -92,6 +100,10 @@ | |
$use_dovecot_lda = false, # postfix_use_dovecot_lda | ||
$use_schleuder = false, # postfix_use_schleuder | ||
$use_sympa = false, # postfix_use_sympa | ||
$configs = {}, | ||
$hashs = {}, | ||
$transports = {}, | ||
$virtuals = {}, | ||
) inherits postfix::params { | ||
|
||
|
||
|
@@ -123,7 +135,15 @@ | |
} | ||
validate_string($smtp_listen) | ||
|
||
validate_hash($configs) | ||
validate_hash($hashs) | ||
validate_hash($transports) | ||
validate_hash($virtuals) | ||
|
||
create_resources('postfix::config', $configs) | ||
create_resources('postfix::hash', $hashs) | ||
create_resources('postfix::transport', $transports) | ||
create_resources('postfix::virtual', $virtuals) | ||
|
||
$_smtp_listen = $mailman ? { | ||
true => '0.0.0.0', | ||
|
@@ -137,8 +157,7 @@ | |
|
||
class { 'postfix::packages': } -> | ||
class { 'postfix::files': } ~> | ||
class { 'postfix::service': } -> | ||
Class['postfix'] | ||
class { 'postfix::service': } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should work if create_resources is done in postfix::config subclass |
||
|
||
if $ldap { | ||
include ::postfix::ldap | ||
|
@@ -164,5 +183,4 @@ | |
|
||
# Relationships | ||
Postfix::Config <| |> ~> Class['postfix::service'] | ||
Class['postfix'] -> Postfix::Hash <| |> | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create_resources should be done in postfix::config class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can't be done in postfix::config since this is define type... My proposed way is the recommend way to implement hiera support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're right, not in postfix::config, in postfix::files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But thats not the way other module work. I just want to do 'include postfix' and everything else is done in hiera. If i would implemented it that way you suggest, i would also need to do 'include postfix::files'. I don't see any benefit here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, postfix::files is included in init, so no need to include it afterwards.
Keep the params to init class like you did, but create the resources in postfix::files instead of in init this should fix the cyclic dependency.