Ansible role that dynamically creates the hosts file.
ansible-galaxy install arillso.hostsNone
Path to the host file on the target system.
hosts_file: /etc/hostsBackup the hosts file before changing it.
hosts_backup: falseGroup owner of hosts file.
hosts_group: rootOwner of hosts file.
hosts_owner: rootAccess permission hosts file.
hosts_mode: 0644Settings for SElinux.
hosts_serole: object_r
hosts_setype: net_conf_t
hosts_seuser: system_u
hosts_selevel: s0Creates a 127.0.0.1 entry for the server name.
hosts_hostname_loopback: trueInserts all hosts in the Ansible Inventory file into the Hosts file.
hosts_inventory_to_hosts: falseOptionally, hosts_aliases can be set in the host_vars, then it generates aliases for the hosts.
If this option and the hosts_inventory_to_hosts is enabled it writes all private ip addresses from the inventory into the hosts
hosts_all_private: trueIf this option and the hosts_inventory_to_hosts is enabled it writes all public ip addresses from the inventory into the hosts.
hosts_all_public: falseIpv6 localhost entries are set automatically. Setting false it can be prevented.
hosts_ipv6: trueAddress that you would like to use as IPv4 address. This could be overriden by what you want.
hosts_ipv4_address: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"List of network cards that should not be added to the hosts file.
hosts_exludes_interfaces:
- 'vet*'
- 'docker'None
- hosts: all
roles:
- arillso.hostsThis project is under the MIT License. See the LICENSE file for the full license text.
(c) 2020, Arillso