https://github.com/petemcw/ansible-role-hostname
Hostname Role for Ansible
https://github.com/petemcw/ansible-role-hostname
ansible ansible-role hostname
Last synced: about 2 months ago
JSON representation
Hostname Role for Ansible
- Host: GitHub
- URL: https://github.com/petemcw/ansible-role-hostname
- Owner: petemcw
- License: mit
- Created: 2017-01-26T17:13:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-26T17:48:14.000Z (over 9 years ago)
- Last Synced: 2025-10-25T10:34:17.183Z (7 months ago)
- Topics: ansible, ansible-role, hostname
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hostname Role for Ansible
[](https://travis-ci.org/petemcw/ansible-role-hostname)
This role manages the hostname.
## Requirements
* Ansible 1.9+
## Role Variables
The variables that can be passed to this role and a brief description about
them are as follows:
```yaml
# Enable/Disable hostname tasks
hostname_enabled: true
# Default hostname
hostname_name: "{{ inventory_hostname }}"
```
## Examples
1. Configure the hostname with the defaults:
```yaml
---
# This playbook configures hostname
- name: Configure hostname on all nodes
hosts: all
roles:
- hostname
```
2. Configure a non-default hostname:
```yaml
---
# This playbook configures hostname
- name: Configure hostname on all nodes
hosts: all
roles:
- { role: hostname, hostname_name: "psc-doc-ansible01.augustash.com" }
```
## Dependencies
None.
## License
MIT