https://github.com/rolehippie/hosts
Ansible role to manipulate the local hosts configuration
https://github.com/rolehippie/hosts
ansible ansible-role hacktoberfest role
Last synced: 6 months ago
JSON representation
Ansible role to manipulate the local hosts configuration
- Host: GitHub
- URL: https://github.com/rolehippie/hosts
- Owner: rolehippie
- License: apache-2.0
- Created: 2018-08-21T12:12:50.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2026-01-12T09:59:58.000Z (6 months ago)
- Last Synced: 2026-01-12T18:02:11.106Z (6 months ago)
- Topics: ansible, ansible-role, hacktoberfest, role
- Language: Nix
- Size: 269 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# hosts
[](https://github.com/rolehippie/hosts)
[](https://github.com/rolehippie/hosts/actions/workflows/general.yml)
[](https://github.com/rolehippie/hosts/actions/workflows/docs.yml)
[](https://github.com/rolehippie/hosts/actions/workflows/galaxy.yml)
[](https://github.com/rolehippie/hosts/blob/master/LICENSE)
[](https://galaxy.ansible.com/rolehippie/hosts)
Ansible role to manipulate the local hosts configuration.
## Sponsor
Building and improving this Ansible role have been sponsored by my current and previous employers like **[Cloudpunks GmbH](https://cloudpunks.de)** and **[Proact Deutschland GmbH](https://www.proact.eu)**.
## Table of contents
- [Requirements](#requirements)
- [Default Variables](#default-variables)
- [fqdn](#fqdn)
- [hostname](#hostname)
- [hosts_additions](#hosts_additions)
- [hosts_enforce_hostname](#hosts_enforce_hostname)
- [hosts_ipv4_address](#hosts_ipv4_address)
- [hosts_ipv6_address](#hosts_ipv6_address)
- [hosts_reload_services](#hosts_reload_services)
- [Discovered Tags](#discovered-tags)
- [Dependencies](#dependencies)
- [License](#license)
- [Author](#author)
---
## Requirements
- Minimum Ansible version: `2.10`
## Default Variables
### fqdn
Fully qualified domain name for this host
#### Default value
```YAML
fqdn: '{{ ansible_fqdn }}'
```
### hostname
Hostname for this host
#### Default value
```YAML
hostname: '{{ inventory_hostname }}'
```
### hosts_additions
Additional entries for hosts config
#### Default value
```YAML
hosts_additions: []
```
#### Example usage
```YAML
hosts_additions:
- 192.168.1.10 host1
- 192.168.1.20 host2
- 192.168.1.30 host3
```
### hosts_enforce_hostname
Enforce the update of the hostname
#### Default value
```YAML
hosts_enforce_hostname: true
```
### hosts_ipv4_address
IPv4 address of this host
#### Default value
```YAML
hosts_ipv4_address: "{{ (ansible_eth0.ipv4.address) if ansible_eth0 is defined else
(ansible_all_ipv4_addresses | first | default('')) }}"
```
### hosts_ipv6_address
IPv6 address of this host
#### Default value
```YAML
hosts_ipv6_address: "{{ (ansible_eth0.ipv6 | map(attribute='address') | first | default(''))
if ansible_eth0 is defined and ansible_eth0.ipv6 is defined else (ansible_all_ipv6_addresses
| first | default('')) }}"
```
### hosts_reload_services
List of services to reload on hosts change
#### Default value
```YAML
hosts_reload_services: []
```
## Discovered Tags
**_hosts_**
## Dependencies
- None
## License
Apache-2.0
## Author
[Thomas Boerger](https://github.com/tboerger)