resolvconf: add role

This commit is contained in:
jeltz 2022-08-26 19:11:40 +02:00
parent 3d2ce8f79f
commit e26d5dfc27
Signed by: jeltz
GPG key ID: 800882B66C0C3326
2 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,9 @@
---
- name: Install resolv.conf
template:
src: resolv.conf.j2
dest: /etc/resolv.conf
owner: root
group: root
mode: u=rw,g=r,o=r
...

View file

@ -0,0 +1,11 @@
{{ ansible_managed | comment }}
{% for nameserver in resolvconf__nameservers %}
nameserver {{ nameserver | ipaddr }}
{% endfor %}
{% if resolvconf__domain is defined %}
domain {{ resolvconf__domain }}
{% endif %}
{% if resolvconf__search is defined %}
search {{ resolvconf__search | join(" ") }}
{% endif %}