tcharl.ansible_hostname

hostname

This guide shows you how to install the necessary dependencies and set up your system's hostname.

GitHub GitLab Quality Downloads Version
github gitlab quality downloads Version

Example Playbook

Here's a simple example you can find in molecule/default/converge.yml. It's tested every time there's a push, pull request, or new release.

---
- name: converge
  hosts: all
  become: yes
  gather_facts: yes

  roles:
    - role: robertdebock.hostname

Before running, the machine needs to be ready. In Continuous Integration (CI), this is done using molecule/default/prepare.yml:

---
- name: prepare
  hosts: all
  become: yes
  gather_facts: no

  roles:
    - role: robertdebock.bootstrap

For more details, check the full explanation and example on using these roles.

Role Variables

Default values for variables are set in defaults/main.yml:

---
# defaults file for hostname

# The hostname to set. By default, it uses what’s in the inventory.
hostname: "{{ inventory_hostname_short }}"

# Should the machine reboot when the hostname changes?
hostname_reboot: yes

Requirements

You will need the pip packages listed in requirements.txt.

Status of Used Roles

The following roles help prepare the system. You can choose a different method for preparation.

Requirement GitHub GitLab
robertdebock.bootstrap Build Status GitHub Build Status GitLab

Context

This role is part of many compatible roles. You can find more information in the documentation of these roles.

Here’s a visual overview of related roles: dependencies

Compatibility

This role has been tested with these container images:

container tags
alpine all
amazon Candidate
el 8
debian all
fedora all
opensuse all
ubuntu all

You need at least version 2.10 of Ansible. Tests were conducted for:

  • The last version.
  • The current version.
  • The development version.

If you find any issues, please report them in GitHub.

License

Apache-2.0

Contributors

Thank you to everyone who has contributed to this repository. Your support makes me better, improves the code, and is a joy to collaborate.

Author Information

Robert de Bock

If you’d like to support me, please consider sponsoring me.

Informazioni sul progetto

Install dependencies and configure the hostname on your system.

Installa
ansible-galaxy install tcharl.ansible_hostname
Licenza
apache-2.0
Download
4k
Proprietario
Osgiliath frameworks and all stuff from the Osgiliath corp!