speechmatics.hostname

Ansible Role: Hostname

Description

This role sets the hostname on any target host. By default, the hostname is the same as inventory_hostname, but you can change it using variables. It also updates the hosts file.

Requirements

No specific requirements.

  • CentOS 5 needs the python-simplejson package for general Ansible operations.
  • Ubuntu 16.04 doesn't come with the python package by default, which is needed for Ansible to work.

Role Variables

Variable Default Explanation
hostname_hosts_file_location "/etc/hosts" The location of the hosts file.
hostname_hosts_backup False Choose to back up the hosts file before making changes.
hostname_fqdn_full inventory_hostname This is by default set to inventory_hostname. You can define hostname_fqdn_full and hostname_fqdn_short to change this.
hostname_fqdn_short inventory_hostname_short
hostname_hosts_ipv4_enabled true If true, adds an IPv4 entry to /etc/hosts.
hostname_hosts_ipv6_enabled true If true, adds an IPv6 entry to /etc/hosts.

Dependencies

This role is independent.

Example Playbook

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

Development Information

This role is developed with help from the community.

Development rules:

  • You can add any pull request to the master branch.
  • If you want to contribute but don’t know how to start, check the issues.
  • Include documentation for new features.
  • Use variables.
  • Set default values.
  • Aim to maintain backward compatibility.
  • Use package installation as the default method; source installation should be optional.
  • Use official software repositories instead of generic ones for main applications.
  • Keep the role independent from others, allowing users to choose which roles to use.

Note:

  • CI uses ansible-lint version 4.x.

License

MIT

Author Information

This role is a fork from https://github.com/insspb/ansible-role-hostname.

Release Procedure

  1. Merge your code into the master branch.
  2. Add a Git tag according to Semantic Versioning rules and push it.
  3. Create a release on Github.com.

NOTE

Tagging a feature branch triggers a release, but it may not work as expected.

Instead of the tagged code, the latest on the master branch will be published to Galaxy.

For more details, see https://github.com/speechmatics/ansible-role-hostname/pull/2

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. This is a fork of original role by Andrey Shpak (https://github.com/insspb/ansible-role-h

Installa
ansible-galaxy install speechmatics.hostname
Licenza
mit
Download
13.1k
Proprietario