Commit f14c5e0a authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis Committed by Christos Stavrakakis
Browse files

Enforce nodes the given hostnames



This means that hostnames are not important in nodes.conf and
should not reflect to existing infra.
Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
parent 9857f62a
......@@ -283,6 +283,11 @@ def setup_hosts():
try_run("echo StrictHostKeyChecking no >> /etc/ssh/ssh_config")
cmd = " sed -i 's/^127.*/127.0.0.1 localhost/g' /etc/hosts "
try_run(cmd)
host_info = env.env.ips_info[env.host]
cmd = "hostname %s" % host_info.hostname
try_run(cmd)
cmd = "echo %s > /etc/hostname" % host_info.hostname
try_run(cmd)
def try_run(cmd, abort=False):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment