ideascube / ansiblecube

Ansible playbook to quickly deploy an ideascube server and much more !
MIT License
5 stars 9 forks source link

dhclient should not use gethostname() but a hardcoded (templated) value #136

Closed letompouce closed 7 years ago

letompouce commented 7 years ago

It happens that the local router/DHCPd doesn't provide a domain-name value.

$ hostname -f
hostname: Name or service not known

The /etc/dhcp/dhclient.conf configuration uses gethostname(), which wants to return a FQDN, which fails (because there isn't any).

This is why we don't always have a client-hostname in tincmaster's DHCP leases.

We don't have control over the local DHCPd, so our only solution is to hardcode send host-name in /etc/dhcp/dhclient.conf, templating it using {{ idc_uniq_device_name |replace("_", "-") }} . This has to be handled by the rename_device role and friends.

letompouce commented 7 years ago

Some devices still won't get a hostname in the DHCPd leases.

Closing this issue for now, the DHCPd related ticket handled internaly.