Hello,
I’m trying to create an Ansible role, networking, to automate /etc/resolv.conf file. I created this role like below:
production
networking.yml
group_vars/
agroup
bgroup
roles/
networking/
tasks/main.yml
templates/resolv.conf.j2
In my resolv.conf.j2 file, I put variables in this file:
{% for item in nameserver %}
nameserver {{ item }}
{% endfor %}
The name servers will be different for different group systems.
In group_vars/agroup: