Closed pprkut closed 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?
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 :-/
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.
Looks good to me.
Merging this please be aware of the postfix changes:
postfix:
aliases:
use_file: True
content: |
#old aliases content
postmaster: root
Using the alias states makes it easier to add/remove single entries rather than having to migrate the entire file into a pillar config.