insspb.hostname
Ansible Role: Hostname
Master Branch | Developer Branch |
---|---|
Master Branch: |
Developer Branch: |
Description
This role sets the hostname on any target host. By default, the hostname is the same as inventory_hostname
, but it can be changed using variables. It also updates the hosts file.
Requirements
No special requirements, but note:
- CentOS 5 needs the python-simplejson package for general Ansible tasks.
- Ubuntu 16.04 doesn’t have the python package by default, which is needed for Ansible to work.
Role Variables
Variable | Default | Explanation |
---|---|---|
hostname_hosts_file_location | "/etc/hosts" | Location of the hosts file. |
hostname_hosts_backup | False | Set to True to create a backup of the hosts file before changes. |
hostname_fqdn_full | inventory_hostname | This role uses inventory_hostname by default for the hostname, but you can change this by setting hostname_fqdn_full and hostname_fqdn_short. |
hostname_fqdn_short | inventory_hostname_short |
Dependencies
This role works independently.
Example Playbook
- hosts: localhost
roles:
- { role: insspb.hostname }
Development Information
This role is developed with input from the community. The development process follows these guidelines:
- You can submit pull requests to the develop branch. All requests will be reviewed promptly.
- If you want to contribute but don’t know how to start, check the issues.
- The master branch gets updated after major changes in the develop branch.
- Please include documentation for new features.
- Use variables for configuration.
- Set defaults for your variables.
- Try to maintain backward compatibility whenever possible.
- Use package installation as the default method for software installation. Source installation should be optional.
- Use official software developer repositories instead of generic Debian/Ubuntu/Centos for the main applications.
- Keep this role independent from other roles, so users can choose which roles to use.
License
MIT
Author Information
This role is contributed to and maintained by Andrey Shpak. I am open for hire.
Informazioni sul progetto
This role will set hostname on any target host. By default hostname is same as inventory_hostname, but can be set as different by using vars. Updates hosts file too.
Installa
ansible-galaxy install insspb.hostname
Licenza
mit
Download
1.6k
Proprietario
DevOps, Python developer, Sailor.