Manage Resolvconf base configuration file

This commit is contained in:
Jeremy Gardais 2018-05-15 11:08:08 +02:00
parent 7e8b76e19a
commit b2368da3f0
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
5 changed files with 29 additions and 1 deletions

View File

@ -2,6 +2,7 @@
### Enhancements
* Allow to install Resolvconf.
* Manage Resolvconf base configuration file.
## v1.0.3

View File

@ -23,6 +23,7 @@ Manage some basics configuration for IPR's servers.
* **basics__proxmox_*disable**: Allow to disable the management of some files by Proxmox for LXC containers [default: `[]`].
* **basics__resolvconf_packages**: List of Resolvconf packages to install [default: `resolvconf`].
* **basics__resolvconf_enabled**: Enable or disable support for Resolvconf [default: `False`].
* **basics__resolvconf_domains**: List of domains used as search suffixes with Resolvconf [default: `{{ ansible_domain }}`].
## Example Playbook
@ -60,7 +61,8 @@ For LXC containers, you also have the possibility to disable the management of s
## Resolvconf
If specified, Resolvconf is installed to fix the domain's informations given by the DHCP server.
* If specified, Resolvconf is installed to fix the domain's informations given by the DHCP server.
* Configure a default configuration file with the given informations (list of domains) and system informations (list of nameserver).
## Development

View File

@ -36,5 +36,13 @@ basics__resolvconf_packages:
basics__resolvconf_enabled: False
# ]]]
# .. envvar:: basics__resolvconf_domains [[[
#
# List of domains used as search suffixes when resolving host names.
#
basics__resolvconf_domains:
- '{{ ansible_domain }}'
# ]]]
# ]]]

View File

@ -57,3 +57,12 @@
- '{{ basics__resolvconf_packages }}'
when: basics__resolvconf_enabled|bool
- name: Configure Resolvconf with domains
template:
src: '../templates/etc/resolvconf/resolv.conf.d/base.j2'
dest: '/etc/resolvconf/resolv.conf.d/base'
owner: root
group: root
mode: '0644'
when: basics__resolvconf_enabled|bool

View File

@ -0,0 +1,8 @@
# This file is managed remotely, all changes will be lost
{% for server in ansible_dns['nameservers'] %}
nameserver {{ server }}
{% endfor %}
{% for domain in basics__resolvconf_domains %}
domain {{ domain }}
search {{ domain }}
{% endfor %}