Skip to content

Latest commit

 

History

History

part27-change-hostname

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Change hostname and update /etc/hosts file

Before everything first update inventory file.

Then update your desired hostnames:

  • add <host_name>.yml file for each of your hosts in /host_vars directory

  • add this line to every <host_name>.yml file:

    hostname: <desired_hostname>

Execute playbook

ansible-playbook tasks/main.yml