This roles purpose is to configure the /etc/hosts
files.
All included in ansible-base package.
Variable | Required | Default | Choices | Comments |
---|---|---|---|---|
hostsfile.localhost_as_localhost | no | N/A | true, false | when true, 127.0.0.1 is 'hostsfile.fqdn hostsfile.hostname' in /etc/hosts file, else it is 'localhost' |
hostsfile.static_hosts | no | N/A | array of name/ip values | static host records to be added to /etc/hosts |
hostsfile:
fqdn: {{ long_hostname }}
hostname: {{ short_hostname }}
localhost_as_localhost: true
static_hosts:
- ip: 10.100.0.1
name: somehost1.domain.tld somehost1
- ip: 10.100.0.2
name: somehost2.domain.tld somehost2
- ip: 10.100.0.3
name: somehost3.domain.tld somehost3
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: all
roles:
- neoloc.hostsfile
See license.md