resolv role

This commit is contained in:
Ruben Blanco 2024-02-14 16:35:51 +01:00
parent 0e300c93e0
commit 9bb40e7798
4 changed files with 26 additions and 0 deletions

View File

@ -7,6 +7,12 @@ hosts:
name: localhost
- ip: 127.0.1.1
name: test-playbook.lab.dc.verdnatura.es test-playbook
domain_name: verdnatura.es
search_name: verdnatura.es
resolvs:
- ip: 10.0.0.4
- ip: 10.0.0.5
################################################################################
### FAIL2BAN ####################################################################

View File

@ -0,0 +1,10 @@
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- name: Replace old /etc/resolv.conf with new /etc/resolv.conf
template:
src: resolv.j2
dest: "{{ path_resolv }}"
owner: root
group: root
mode: '0644'
backup: true
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

View File

@ -0,0 +1,7 @@
domain {{ domain_name | default('verdnatura.es') }}
search {{ search_name | default('verdnatura.es') }}
{% if resolvs is defined %}
{% for resolv in resolvs %}
nameserver {{resolv.ip}}
{% endfor %}
{% endif %}

View File

@ -0,0 +1,3 @@
---
# vars file
path_resolv: /etc/resolv.conf