Hi all. I’m trying to configure my bind servers with ansible, and I’m a little stumped about the best way forward. This question is also to help me better understand ansible and how to approach questions like this.
I’ll try an describe what I’m trying to do without being too bind specific. I want to generate about 10 configuration files and the data I require is actually really simple. The names of the files, the contents of the files and what files I need are all really easy to generate programatically. And there is the rub.
I could make separate template files for each file I need, and record all the data manually in yaml files or something, and run a playbook that generates each configuration file individually. That would be the boring but easy solution.
I could probably re-arrange my bind configurations to be more uniform and make it easier, but then I’d miss this opportunity to learn how to solve this kind of problem with ansible.
What I’d really like is to be able to write a minimal YAML file and maintain minimal templates and have ansible generate the necessary configurations.
I’ll try and give an example.
Lets say I have this data in a YAML file