Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

This Ansible 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.

License

Notifications You must be signed in to change notification settings

insspb/ansible-role-hostname

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Role: Hostname

Master branch Developer branch
Master branch: Build Status Developer branch: Build Status

Description

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.

Requirements

No requiments.

  • CentOs 5 requires python-simplejson package installed for general Ansible work.
  • Ubuntu 16.04 has no python package installed by default. It is reuired for general Ansible to work.

Role Variables

Variable Default Explanation
hostname_hosts_file_location "/etc/hosts" Hosts file location.
hostname_hosts_backup False You can make backup of hosts file before changes will be made.
hostname_fqdn_full inventory_hostname By default this role use inventory_hostname from inventory file to get host hostname, but you can set hostname_fqdn_full and hostname_fqdn_short to change this behavior.
hostname_fqdn_short inventory_hostname_short

Dependencies

Independent role.

Example Playbook

- hosts: localhost
  roles:
    - { role: insspb.hostname }

Development information

This role is developed with community help. Process of development follows this rule:

  • You are free to add any pool request to develop branch. All request will be answered in timely manner.
  • If you want to made any contribution, but do not know where to start - check issues.
  • Master branch updated just after significant changes in develop.
  • Please include documentation for new features.
  • Please use variables.
  • Please do not forget to set defaults.
  • Please do your best to keep backward compatibility if possible.
  • Please use packet installation as default software installation method. Source installation must be optional anywhere if possible.
  • Please use official software developers repositories instead of general Debian/Ubuntu/Centos etc for main application.
  • Do you best to keep role independent from any other roles. User must have the way to choose what roles to use.

License

MIT

Author Information

This role is contributed and maintained by Andrey Shpak. I am always available for hire.

About

This Ansible 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.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published