amtega.etc_hosts

Ansible etc_hosts Role

This is an Ansible role used to manage entries in the /etc/hosts file.

Requirements

You need dnspython 1.15.0+ installed on the control machine.

Role Variables

You can find all the default variables for this role in defaults/main.yml.

Example Playbook

Here is an example playbook:

---

- hosts: all
  roles:
    - amtega.etc_hosts
  vars:    
    etc_hosts:
      - address: 192.168.13.12
        state: present
        hostnames:
          - acme1
          - acme2
      - address: 192.168.13.13
        state: present
        hostnames:
          - acme3
          - acme4
      - hostnames:
          - www.google.com
          - www.centos.org
        state: present                    

Testing

Tests use molecule with Vagrant virtual machines.

cd amtega.etc_hosts

molecule test --all

License

Copyright (C) 2022 AMTEGA - Xunta de Galicia

This role is free software: you can share and/or change it under the terms of:

GNU General Public License version 3, or (if you prefer) any later version; or the European Union Public License, either Version 1.2 or – as soon as they are approved by the European Commission – later versions of the EUPL.

This role is shared with the hope it will be useful, but WITHOUT ANY WARRANTY; not even the implied warranty of MARKETABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License or the European Union Public License for more details.

Author Information

  • Juan Antonio Valiño García.
Informazioni sul progetto

Manage /etc/hosts entries

Installa
ansible-galaxy install amtega.etc_hosts
Licenza
gpl-3.0
Download
7.3k
Proprietario
Agency for Technological Modernization of Galicia