Resolvconf vars use facts values by default

This commit is contained in:
Jeremy Gardais 2018-05-15 11:27:41 +02:00
parent f86967ff8d
commit cf74b17bb9
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
4 changed files with 12 additions and 2 deletions

View File

@ -4,6 +4,7 @@
* Allow to install Resolvconf. * Allow to install Resolvconf.
* Manage Resolvconf base configuration file. * Manage Resolvconf base configuration file.
* Restart Resolvconf service if any modification on configuration file. * Restart Resolvconf service if any modification on configuration file.
* Resolvconf default configuration is set from ansible facts.
## v1.0.3 ## v1.0.3

View File

@ -24,6 +24,7 @@ Manage some basics configuration for IPR's servers.
* **basics__resolvconf_packages**: List of Resolvconf packages to install [default: `resolvconf`]. * **basics__resolvconf_packages**: List of Resolvconf packages to install [default: `resolvconf`].
* **basics__resolvconf_enabled**: Enable or disable support for Resolvconf [default: `False`]. * **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 }}`]. * **basics__resolvconf_domains**: List of domains used as search suffixes with Resolvconf [default: `{{ ansible_domain }}`].
* **basics__resolvconf_nameservers**: List of nameservers to use to resolv host names with Resolvconf [default: `{{ ansible_dns.nameservers }}`].
* **basics__resolvconf_service_name**: The Resolvconf service name to manage [default: `resolvconf`]. * **basics__resolvconf_service_name**: The Resolvconf service name to manage [default: `resolvconf`].
## Example Playbook ## Example Playbook
@ -63,7 +64,7 @@ For LXC containers, you also have the possibility to disable the management of s
## Resolvconf ## 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). * Configure a default configuration file with the given informations (list of domains and nameservers).
* Ensure to restart the service if any modification in configuration file. * Ensure to restart the service if any modification in configuration file.
## Development ## Development

View File

@ -24,6 +24,7 @@ basics__proxmox_host_disable: []
# .. envvar:: basics__resolvconf_packages [[[ # .. envvar:: basics__resolvconf_packages [[[
# #
# List of Resolvconf packages to install. # List of Resolvconf packages to install.
#
basics__resolvconf_packages: basics__resolvconf_packages:
- 'resolvconf' - 'resolvconf'
@ -43,6 +44,13 @@ basics__resolvconf_enabled: False
basics__resolvconf_domains: basics__resolvconf_domains:
- '{{ ansible_domain }}' - '{{ ansible_domain }}'
# ]]]
# .. envvar:: basics__resolvconf_nameservers [[[
#
# List of nameservers to use to resolv host names.
#
basics__resolvconf_nameservers: '{{ ansible_dns.nameservers }}'
# ]]] # ]]]
# .. envvar:: basics__resolvconf_service_name [[[ # .. envvar:: basics__resolvconf_service_name [[[
# #

View File

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