Manage Resolvconf service

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

View File

@ -3,6 +3,7 @@
### Enhancements ### Enhancements
* 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.
## 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_service_name**: The Resolvconf service name to manage [default: `resolvconf`].
## Example Playbook ## Example Playbook
@ -63,6 +64,7 @@ For LXC containers, you also have the possibility to disable the management of s
* 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 system informations (list of nameserver).
* Ensure to restart the service if any modification in configuration file.
## Development ## Development

View File

@ -44,5 +44,11 @@ basics__resolvconf_domains:
- '{{ ansible_domain }}' - '{{ ansible_domain }}'
# ]]] # ]]]
# .. envvar:: basics__resolvconf_service_name [[[
#
# The Resolvconf service name to manage.
basics__resolvconf_service_name: 'resolvconf'
# ]]]
# ]]] # ]]]

View File

@ -1,2 +1,7 @@
--- ---
# handlers file for basics # handlers file for basics
- name: restart resolvconf service
service:
name: '{{ basics__resolvconf_service_name }}'
state: '{{ "restarted" if (basics__resolvconf_enabled | bool) }}'
enabled: '{{ basics__resolvconf_enabled | bool }}'

View File

@ -65,4 +65,4 @@
group: root group: root
mode: '0644' mode: '0644'
when: basics__resolvconf_enabled|bool when: basics__resolvconf_enabled|bool
notify: ['restart resolvconf service']