saltstack-formulas / postfix-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
25 stars 130 forks source link

Use alias states for managing mail aliases. #57

Closed pprkut closed 7 years ago

pprkut commented 7 years ago

Using the alias states makes it easier to add/remove single entries rather than having to migrate the entire file into a pillar config.

aboe76 commented 7 years ago

@pprkut, this looks good but it is a backward incompatible change that I want to have some more people to review... @javierbertoli could you also take a look?

pprkut commented 7 years ago

Sure, no problem.

Maybe also worth considering, I noticed the use case mentioned in #50 wouldn't be working anymore (regexp dictionary types). Not sure how to handle that though :-/

pprkut commented 7 years ago

I made a couple changes to my approach, next to fixes for the comments from @EvaSDK. I kept the old code and introduced a "use_file" boolean. If set to true (the default), behavior would be as previous, where the entire aliases file is managed. The only difference would be the content now being in postfix:aliases:content rather than postfix:aliases. If set to false, people would get the new behavior to manage single aliases.

EvaSDK commented 7 years ago

Looks good to me.

aboe76 commented 7 years ago

Merging this please be aware of the postfix changes:

postfix:
  aliases:
    use_file: True
    content: |
      #old aliases content
      postmaster: root