# Role: etc_hosts

## Description

Installs /etc/hosts file including the hosts provided in vars.

https://www.man7.org/linux/man-pages/man5/hosts.5.html

## Usage

Using in a playbook:

```yaml
- name: Play
  hosts:
    - all
  roles:
    - samuliy.ansible.etc_hosts
  vars:
    ...
```

### Vars

`etc_hosts_config`:

Config as string or list of lines to install into the hosts file.

`etc_hosts_default_config`:

Default config to include in the hosts file.

`etc_hosts_config_blocks`:

Configs as blocks to install into the hosts file via blockinfile.

List items can contain fields:

- 'marker'
- 'config'

`etc_hosts_path`:

Path of the hosts file.

`etc_hosts_hostname_var`:

Variable to take the current hostname from.

`etc_hosts_reset`:

Remove the /etc/hosts before installing it.
