propellor-5.12: property-based host configuration management in haskell

Safe HaskellNone
LanguageHaskell98

Propellor.Property.Hostname

Synopsis

Documentation

sane :: Property UnixLike Source #

Ensures that the hostname is set using best practices, to whatever name the Host has.

Configures both /etc/hostname and the current hostname. (However, when used inside a chroot, avoids setting the current hostname as that would impact the system outside the chroot.)

/etc/hosts is also configured, with an entry for 127.0.1.1, which is standard at least on Debian to set the FDQN.

Also, the /etc/hosts 127.0.0.1 line is set to localhost. Putting any other hostnames there is not best practices and can lead to annoying messages from eg, apache.

searchDomain :: Property UnixLike Source #

Makes /etc/resolv.conf contain search and domain lines for the domain that the hostname is in.

type ExtractDomain = HostName -> String Source #

Function to extract the domain name from a HostName.

extractDomain :: ExtractDomain Source #

hostname of foo.example.com has a domain of example.com. But, when the hostname is example.com, the domain is example.com too.

This doesn't work for eg, foo.co.uk, or when foo.sci.uni.edu is in a sci.uni.edu subdomain. If you are in such a network, provide your own ExtractDomain function to the properties above.