Compare commits
No commits in common. "master" and "v1.0.1" have entirely different histories.
36
CHANGELOG.md
36
CHANGELOG.md
|
@ -1,44 +1,12 @@
|
||||||
## v1.1.2
|
|
||||||
|
|
||||||
### Fix
|
|
||||||
* Fix E405 Remote package tasks should have a retry.
|
|
||||||
* Use to_nice_json to manage packages list.
|
|
||||||
* Fix E203 Most files should not contain tabs.
|
|
||||||
* Fix E404 Doesn't need a relative path in role.
|
|
||||||
|
|
||||||
## v1.1.1
|
|
||||||
|
|
||||||
### Fix
|
|
||||||
* Set empty dependencies line to fix Galaxy warning.
|
|
||||||
* Deprecation warning in favor of debops.netbase and debops.resources role.
|
|
||||||
|
|
||||||
## v1.1.0
|
|
||||||
|
|
||||||
### Enhancements
|
|
||||||
* Allow to install Resolvconf.
|
|
||||||
* Manage Resolvconf base configuration file.
|
|
||||||
* Restart Resolvconf service if any modification on configuration file.
|
|
||||||
* Resolvconf default configuration is set from ansible facts.
|
|
||||||
|
|
||||||
## v1.0.3
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
* Ensure to disable management of files by Proxmox only one time.
|
|
||||||
|
|
||||||
## v1.0.2
|
|
||||||
|
|
||||||
### Enhancements
|
|
||||||
* Disable the management of /etc/hosts by Proxmox.
|
|
||||||
|
|
||||||
## v1.0.1
|
## v1.0.1
|
||||||
|
|
||||||
### Enhancements
|
## Enhancements
|
||||||
* Add example playbook.
|
* Add example playbook.
|
||||||
* localhost line sould not contain hostname information (see https://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_hostname_resolution).
|
* localhost line sould not contain hostname information (see https://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_hostname_resolution).
|
||||||
* Purge /etc/hosts of multiple lines that contains $HOSTNAME without the default ipv4 ip address.
|
* Purge /etc/hosts of multiple lines that contains $HOSTNAME without the default ipv4 ip address.
|
||||||
* Purge conditions of /etc/hosts are the same as permanent ip address (ipv4).
|
* Purge conditions of /etc/hosts are the same as permanent ip address (ipv4).
|
||||||
|
|
||||||
## v1.0.0
|
## v1.0
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
* Manage localhost line in /etc/hosts.
|
* Manage localhost line in /etc/hosts.
|
||||||
|
|
26
README.md
26
README.md
|
@ -1,11 +1,5 @@
|
||||||
# Basics
|
# Basics
|
||||||
|
|
||||||
This content is mainly deprecated and i start using [Debops Netbase role][debops netbase role]
|
|
||||||
which comes with most of this configuration (more and better).
|
|
||||||
The [Debops Ifupdown role][debops ifupdown role] can manage the DNS search and nameservers,
|
|
||||||
[see the documentation][debops ifupdown dns] for more informations and the
|
|
||||||
[Debops Resolvconf role][debops resolvconf role] can also give more possibilities.
|
|
||||||
|
|
||||||
1. [Overview](#overview)
|
1. [Overview](#overview)
|
||||||
2. [Role Variables](#role-variables)
|
2. [Role Variables](#role-variables)
|
||||||
3. [Example Playbook](#example-playbook)
|
3. [Example Playbook](#example-playbook)
|
||||||
|
@ -26,12 +20,6 @@ Manage some basics configuration for IPR's servers.
|
||||||
* **basics__hosts_localhost_content** : Content of the localhost (127.0.0.1) line [default : `localhost.localdomain localhost`].
|
* **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_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__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
|
## Example Playbook
|
||||||
|
|
||||||
|
@ -53,7 +41,7 @@ Manage some basics configuration for IPR's servers.
|
||||||
- role: ipr-cnrs.basics
|
- role: ipr-cnrs.basics
|
||||||
basics__domain: 'mydomain.org'
|
basics__domain: 'mydomain.org'
|
||||||
basics__hosts_ipv4_manage: true
|
basics__hosts_ipv4_manage: true
|
||||||
```
|
````
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
|
@ -65,14 +53,6 @@ Ensure to have the correct fqdn and hostname in /etc/hosts :
|
||||||
- You can choose to define the permanent ip (ipv4) 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.
|
- 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][wiki proxmox 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
|
## 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…
|
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…
|
||||||
|
@ -96,7 +76,3 @@ Jérémy Gardais
|
||||||
[basics github]: https://github.com/ipr-cnrs/basics
|
[basics github]: https://github.com/ipr-cnrs/basics
|
||||||
[wtfpl website]: http://www.wtfpl.net/about/
|
[wtfpl website]: http://www.wtfpl.net/about/
|
||||||
[ipr website]: https://ipr.univ-rennes1.fr/
|
[ipr website]: https://ipr.univ-rennes1.fr/
|
||||||
[wiki proxmox lxc]: https://pve.proxmox.com/wiki/Linux_Container#_guest_operating_system_configuration
|
|
||||||
[debops netbase role]: https://docs.debops.org/en/master/ansible/roles/debops.netbase/index.html
|
|
||||||
[debops ifupdown role]: https://docs.debops.org/en/master/ansible/roles/debops.ifupdown/index.html
|
|
||||||
[debops resolvconf role]: https://docs.debops.org/en/master/ansible/roles/debops.resolvconf/index.html
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
---
|
---
|
||||||
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
|
# defaults file for basics
|
||||||
#
|
|
||||||
# ipr-cnrs.basics default variables [[[
|
|
||||||
# =====================================
|
|
||||||
|
|
||||||
# Domain
|
# Domain
|
||||||
basics__domain: "{{ ansible_domain }}"
|
basics__domain: "{{ ansible_domain }}"
|
||||||
|
@ -13,50 +10,3 @@ basics__hosts_localhost_content: "localhost.localdomain localhost"
|
||||||
basics__hosts_ipv4_manage: false
|
basics__hosts_ipv4_manage: false
|
||||||
basics__hosts_ipv4_content: "{{ ansible_hostname }}.{{ basics__domain }} {{ ansible_hostname }}"
|
basics__hosts_ipv4_content: "{{ ansible_hostname }}.{{ basics__domain }} {{ ansible_hostname }}"
|
||||||
|
|
||||||
# Proxmox
|
|
||||||
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
|
|
||||||
|
|
||||||
# ]]]
|
|
||||||
# .. envvar:: basics__resolvconf_domains [[[
|
|
||||||
#
|
|
||||||
# List of domains used as search suffixes when resolving host names.
|
|
||||||
#
|
|
||||||
basics__resolvconf_domains:
|
|
||||||
- '{{ 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 [[[
|
|
||||||
#
|
|
||||||
# The Resolvconf service name to manage.
|
|
||||||
basics__resolvconf_service_name: 'resolvconf'
|
|
||||||
|
|
||||||
# ]]]
|
|
||||||
|
|
||||||
# ]]]
|
|
||||||
|
|
|
@ -1,7 +1,2 @@
|
||||||
---
|
---
|
||||||
# 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 }}'
|
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
---
|
|
||||||
|
|
||||||
dependencies: []
|
|
||||||
|
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
author: "Jérémy Gardais"
|
author: "Jérémy Gardais"
|
||||||
description: "Manage some basics configurations for IPR's servers."
|
description: "Manage some basics configurations for IPR's servers."
|
||||||
|
@ -13,6 +9,14 @@ galaxy_info:
|
||||||
- name: Debian
|
- name: Debian
|
||||||
versions:
|
versions:
|
||||||
- stretch
|
- stretch
|
||||||
|
#- name: opensuse
|
||||||
|
# versions:
|
||||||
|
# - all
|
||||||
|
# - 12.1
|
||||||
|
# - 12.2
|
||||||
|
# - 12.3
|
||||||
|
# - 13.1
|
||||||
|
# - 13.2
|
||||||
galaxy_tags:
|
galaxy_tags:
|
||||||
- system
|
- system
|
||||||
- debian
|
- debian
|
||||||
|
|
|
@ -1,16 +1,14 @@
|
||||||
---
|
---
|
||||||
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
|
|
||||||
#
|
|
||||||
# tasks file for basics
|
# tasks file for basics
|
||||||
|
|
||||||
## Modify /etc/hosts {{{
|
## Modify /etc/hosts
|
||||||
|
|
||||||
- name: Config host - Set 127.0.0.1 line in hosts file
|
- name: Config host - Set 127.0.0.1 line in hosts file
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/hosts
|
dest: /etc/hosts
|
||||||
state: present
|
state: present
|
||||||
regexp: "^{{ ansible_lo.ipv4.address }}"
|
regexp: "^{{ ansible_lo.ipv4.address }}"
|
||||||
line: "{{ ansible_lo.ipv4.address }} {{ basics__hosts_localhost_content }}"
|
line: "{{ ansible_lo.ipv4.address }} {{ basics__hosts_localhost_content }}"
|
||||||
backup: yes
|
backup: yes
|
||||||
when: (basics__hosts_localhost_manage and
|
when: (basics__hosts_localhost_manage and
|
||||||
ansible_lo.ipv4.address is defined)
|
ansible_lo.ipv4.address is defined)
|
||||||
|
@ -20,7 +18,7 @@
|
||||||
dest: /etc/hosts
|
dest: /etc/hosts
|
||||||
state: present
|
state: present
|
||||||
regexp: "^{{ ansible_default_ipv4.address }}"
|
regexp: "^{{ ansible_default_ipv4.address }}"
|
||||||
line: "{{ ansible_default_ipv4.address }} {{ basics__hosts_ipv4_content }}"
|
line: "{{ ansible_default_ipv4.address }} {{ basics__hosts_ipv4_content }}"
|
||||||
backup: yes
|
backup: yes
|
||||||
when: (basics__hosts_ipv4_manage and
|
when: (basics__hosts_ipv4_manage and
|
||||||
ansible_default_ipv4.address is defined)
|
ansible_default_ipv4.address is defined)
|
||||||
|
@ -35,36 +33,3 @@
|
||||||
ansible_default_ipv4.address is defined)
|
ansible_default_ipv4.address is defined)
|
||||||
|
|
||||||
## }}}
|
## }}}
|
||||||
|
|
||||||
# Proxmox [[[1
|
|
||||||
- name: Disable modification of files by Proxmox
|
|
||||||
copy:
|
|
||||||
content: ""
|
|
||||||
dest: '{{ (item.path | dirname) + "/.pve-ignore." + (item.path | basename) }}'
|
|
||||||
with_flattened:
|
|
||||||
- '{{ basics__proxmox_disable }}'
|
|
||||||
- '{{ basics__proxmox_group_disable }}'
|
|
||||||
- '{{ 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 | to_nice_json }}'
|
|
||||||
register: resolv_pkg_result
|
|
||||||
until: resolv_pkg_result is success
|
|
||||||
when: basics__resolvconf_enabled|bool
|
|
||||||
|
|
||||||
- name: Configure Resolvconf with domains
|
|
||||||
template:
|
|
||||||
src: '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
|
|
||||||
notify: ['restart resolvconf service']
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
# This file is managed remotely, all changes will be lost
|
|
||||||
{% for server in basics__resolvconf_nameservers %}
|
|
||||||
nameserver {{ server }}
|
|
||||||
{% endfor %}
|
|
||||||
{% for domain in basics__resolvconf_domains %}
|
|
||||||
domain {{ domain }}
|
|
||||||
search {{ domain }}
|
|
||||||
{% endfor %}
|
|
Reference in New Issue