From 7e8b76e19a4adbfdcbbf10ee50d3e29b74f09205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Tue, 15 May 2018 10:21:21 +0200 Subject: [PATCH] Allow to install Resolvconf --- CHANGELOG.md | 5 +++++ README.md | 6 ++++++ defaults/main.yml | 26 +++++++++++++++++++++++++- tasks/main.yml | 10 ++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 413a1ce..193f58d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v1.X + +### Enhancements +* Allow to install Resolvconf. + ## v1.0.3 ### Fixes diff --git a/README.md b/README.md index 79e4263..d04ab3f 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ Manage some basics configuration for IPR's servers. * **basics__hosts_ipv4_manage** : If the ipv4 address line should be managed [default : `false`]. * **basics__hosts_ipv4_content** : Content of the ipv4 address line [default : `{{ ansible_hostname }}.{{ basics__domain }} {{ ansible_hostname }}`]. * **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`]. ## Example Playbook @@ -56,6 +58,10 @@ Ensure to have the correct fqdn and hostname in /etc/hosts : For LXC containers, you also have the possibility to disable the management of some files (/etc/hosts,…) by Proxmox. See [Proxmox wiki about LXC][wiki proxmox lxc]. +## Resolvconf + +If specified, Resolvconf is installed to fix the domain's informations given by the DHCP server. + ## Development This source code comes from our [Gogs instance][basics source] and the [Github repo][basics github] exist just to be able to send the role to Ansible Galaxy… diff --git a/defaults/main.yml b/defaults/main.yml index b1695dd..5e9255e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,8 @@ --- -# defaults file for basics +# .. vim: foldmarker=[[[,]]]:foldmethod=marker +# +# ipr-cnrs.basics default variables [[[ +# ===================================== # Domain basics__domain: "{{ ansible_domain }}" @@ -14,3 +17,24 @@ basics__hosts_ipv4_content: "{{ ansible_hostname }}.{{ basics__domain }} {{ ansi basics__proxmox_disable: [] basics__proxmox_group_disable: [] basics__proxmox_host_disable: [] + +# Resolvconf [[[ +# -------------- + +# .. envvar:: basics__resolvconf_packages [[[ +# +# List of Resolvconf packages to install. +basics__resolvconf_packages: + - 'resolvconf' + + # ]]] +# .. envvar:: basics__resolvconf_enabled [[[ +# +# Enable or disable support for Resolvconf on a given host. Disabling this +# option does not remove existing installation and configuration. +# +basics__resolvconf_enabled: False + + # ]]] + + # ]]] diff --git a/tasks/main.yml b/tasks/main.yml index 9080b15..be2061f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -47,3 +47,13 @@ - '{{ basics__proxmox_host_disable }}' when: ansible_virtualization_type == "lxc" +# Resolvconf [[[1 +- name: Ensure Resolvconf required packages are in there desired state + package: + name: '{{ item }}' + state: 'present' + install_recommends: False + with_flattened: + - '{{ basics__resolvconf_packages }}' + when: basics__resolvconf_enabled|bool +