hostname

ansible hostname

Build Status

Change Hostname and localhost entrie in /etc/hosts

It will only Change if you set a hostname Variable - {{ host_name }}

Best way is to set host_name Var in your inventory File.

[hosts]
192.0.0.1 host_name=MyServerName
192.0.0.2 host_name=example

Example Playbook

- hosts: all
  roles:
    - role: ypsman.hostname
About

Change Hostname and entries in /etc/hosts

Install
ansible-galaxy install ypsman/ansible-hostname
GitHub repository
License
Unknown
Downloads
8395
Owner