saltstack-formulas / bind-formula

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

Add support for multiple views serving the same zone but different record sets. #118

Closed crux-capacitor closed 5 years ago

crux-capacitor commented 5 years ago

During the for-loop in named.conf.local.jinja, I added a check for a new 'file' argument. If set, then use that file, otherwise default to the specified zone name for this view.

This allows you to set up multiple views configured to serve the same zone but specify the zone file to be used so that they can serve different record sets.

An example of this would be internal and external views that both serve the same zone (company.com), but the external view returns public IPs, and the internal view returns private IPs.

I can provide a working pillar.example of this implementation if needed.

aboe76 commented 5 years ago

@crux-capacitor please add a working pillar.example, that way more variables are documented

crux-capacitor commented 5 years ago

@aboe76 added pillar-with-views.example. Let me know if anything else should be clarified. Thanks!

crux-capacitor commented 5 years ago

Changed to a WIP. Need to do some more testing on zone file creations.

crux-capacitor commented 5 years ago

@aboe76 Ready for review / merge.

crux-capacitor commented 5 years ago

Woohoo! Thanks. This is my first pull request ever!

javierbertoli commented 5 years ago

@crux-capacitor, @aboe76 it LGTM (indeed nicely done, btw :))

My only suggestion would be if you can squash the commits so we merge the PR.

crux-capacitor commented 5 years ago

Hmm, I'm not having much luck with that. Is there an option to squash and merge?

javierbertoli commented 5 years ago

You can do that in your local working dir, with

git rebase -i HEAD~N

where N is the number of commits you want to rebase (ie 13, here?)

Then, git will open you a commit comment window, where you can decide which commit comment remains, which is 'squashed' etc, and the will produce a result commit which you can push.

Hope that helps

crux-capacitor commented 5 years ago

Ah yes, I was missing the HEAD~N part. Hopefully I did that right. Thanks!

aboe76 commented 5 years ago

@crux-capacitor merged it, nice one, and @javierbertoli thanks for review.