Manage some basics configurations for IPR's servers
This repository has been archived on 2020-11-04. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Jeremy Gardais cf74b17bb9
Resolvconf vars use facts values by default
2018-05-15 11:27:41 +02:00
defaults Resolvconf vars use facts values by default 2018-05-15 11:27:41 +02:00
handlers Manage Resolvconf service 2018-05-15 11:15:39 +02:00
meta Manage localhost and default_ipv4 line in /etc/hosts. 2018-01-11 15:33:54 +01:00
tasks Manage Resolvconf service 2018-05-15 11:15:39 +02:00
templates/etc/resolvconf/resolv.conf.d Resolvconf vars use facts values by default 2018-05-15 11:27:41 +02:00
tests Manage localhost and default_ipv4 line in /etc/hosts. 2018-01-11 15:33:54 +01:00
CHANGELOG.md Resolvconf vars use facts values by default 2018-05-15 11:27:41 +02:00
README.md Resolvconf vars use facts values by default 2018-05-15 11:27:41 +02:00

README.md

Basics

  1. Overview
  2. Role Variables
  3. Example Playbook
  4. Configuration
  5. Development
  6. License
  7. Author Information

Overview

Manage some basics configuration for IPR's servers.

Role Variables

  • basics__domain: Domain to use [default: {{ ansible_domain }}].
  • basics__hosts_localhost_manage: If the localhost (127.0.0.1) line should be managed [default: false].
  • basics__hosts_localhost_content: Content of the localhost (127.0.0.1) line [default: localhost.localdomain localhost].
  • 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].
  • 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].

Example Playbook

  • If you want to manage both localhost (127.0.0.1) and permanent IP (ipv4) lines:
- hosts: serverXYZ
  roles:
    - role: ipr-cnrs.basics
      basics__hosts_localhost_manage: true
      basics__hosts_ipv4_manage: true
  • If the domain is not defined on the remote host, you should set the basics__domain variable:
- hosts: serverXYZ
  roles:
    - role: ipr-cnrs.basics
      basics__domain: 'mydomain.org'
      basics__hosts_ipv4_manage: true

Configuration

Hosts

Ensure to have the correct fqdn and hostname in /etc/hosts:

  • You can define the domain if it's not correct on the remote host.
  • You can choose to define the localhost (127.0.0.1) line content.
  • You can choose to define the permanent ip (ipv4) line content.
    • All other lines that contains hostname without this permanent ip address will be removed.

For LXC containers, you also have the possibility to disable the management of some files (/etc/hosts,…) by Proxmox. See Proxmox wiki about LXC.

Resolvconf

  • 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 nameservers).
  • Ensure to restart the service if any modification in configuration file.

Development

This source code comes from our Gogs instance and the Github repo exist just to be able to send the role to Ansible Galaxy…

But feel free to send issue/PR here :)

Thanks to this hook, Github automatically got updates from our Gogs instance :)

License

WTFPL

Author Information

Jérémy Gardais