Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set a static hostname #177

Open
martbhell opened this issue Jan 19, 2017 · 2 comments
Open

set a static hostname #177

martbhell opened this issue Jan 19, 2017 · 2 comments

Comments

@martbhell
Copy link
Contributor

Maybe we should set a static hostname?
What is the preferred/recommended method from RedHat?

On test system compute nodes:

$ cat /etc/hostname
localhost.localdomain


$ hostnamectl
   Static hostname: localhost.localdomain
Transient hostname: io4.int.fgci.csc.fi
         Icon name: computer-server
           Chassis: server
        Machine ID: 0DHERE
           Boot ID: cDHERE
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-514.2.2.el7.x86_64
      Architecture: x86-64
@martbhell
Copy link
Contributor Author

Setting a good one in "static" means that the server has a good hostname before DHCP.
This can be observed by running "journalctl -b 0" (journal of the last boot).

Without dhcp probably the network init script sets it while getting the info from "ipcalc --silent --hostname $IPADDR" during bootup.

before:

# hostnamectl status
   Static hostname: localhost.localdomain
Transient hostname: io2.int.fgci.csc.fi

command:

hostnamectl set-hostname --static io2.int.fgci.csc.fi

after:

# hostnamectl status
   Static hostname: io2.int.fgci.csc.fi

and after a reboot:

# hostnamectl 
   Static hostname: io2.int.fgci.csc.fi
         Icon name: computer-server
           Chassis: server

There is an ansible hostname module 1 which seems 2 to run hostnamectl --pretty --static and --transient .
Should probably use that.
Which role to add this to though?

@martbhell
Copy link
Contributor Author

A benefit of setting a static hostname: "ibnetdiscover" has the hostname of the node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant