Statically IP a host in Wicked, but in a dynamic way

Within our HPC cluster, we do not use DHCP. But neither do we manually configure the addresses for thousands of nodes. In SLES 11, we used a bit of bash in /etc/sysconfig/network/ifcfg-eth0 to grep the IP out of /etc/hosts:

HOSTNAME=$(hostname -s)
BOOTPROTO=‘static’
BROADCAST=’’
ETHTOOL_OPTIONS=’’
IPADDR=$(egrep “\<${HOSTNAME}.prv.cube\>” /etc/hosts | awk ‘{print $1"/16"}’)
MTU=‘1500’
STARTMODE=‘auto’
USERCONTROL=‘no’

However, this no longer works in SLES 12 because of wicked.

So I’m hoping someone on here can point to a way to implement a similar functionality, but using wicked instead.

Cheers,

Jonathan Mills
NASA Goddard Space Flight Center

Hi Jonathan,

my guess is that you have some automatism to configure /etc/hosts - how about extending that to configure the IP address info in the compat files (/etc/sysconfig/network/ifcfg-*) as well?

Regards,
J