Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anxs/hostname
Ansible role to set/update the hostname
https://github.com/anxs/hostname
Last synced: about 1 month ago
JSON representation
Ansible role to set/update the hostname
- Host: GitHub
- URL: https://github.com/anxs/hostname
- Owner: ANXS
- License: mit
- Created: 2014-03-11T04:37:55.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2022-02-06T19:31:05.000Z (almost 3 years ago)
- Last Synced: 2024-03-27T11:22:46.259Z (9 months ago)
- Homepage:
- Size: 26.4 KB
- Stars: 31
- Watchers: 9
- Forks: 25
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## ANXS - hostname [![Build Status](https://travis-ci.com/ANXS/hostname.png)](https://travis-ci.com/ANXS/hostname)
Ansible role that sets the hostname and FQDN of the node.
#### Variables
This depends on your ansible hosts inventory.
Add the hosts to your inventory with their FQDN (e.g. foo.bar.com), and the role will take care of setting your hostname accordingly (hostname: foo, FQDN: foo.bar.com).
If you just name it with the hostname in the inventory, it will similarly work (hostname set, but no FQDN attached to it).
```yaml
hostname_avahi: no # You may optionall install avahi-mdns and libnss-mdns. This is useful in vagrant.
```#### Example
Your inventory file should look like this:
```yaml
foo.bar.com ansible_ssh_host=xxx.xxx.xxx.xxx ansible_ssh_port=22
baz.bar.com ansible_ssh_host=xxx.xxx.xxx.xxx ansible_ssh_port=22
```And the structure of the files in your host_vars folders should match accordingly:
```
- host_vars
|- foo.bar.com
|- baz.bar.com
```#### Testing
This project comes with a VagrantFile, this is a fast and easy way to test changes to the role, fire it up with `vagrant up`See [vagrant docs](https://docs.vagrantup.com/v2/) for getting setup with vagrant
#### License
Licensed under the MIT License. See the LICENSE file for details.
#### Feedback, bug-reports, requests, ...
Are [welcome](https://github.com/ANXS/hostname/issues)!