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

Safe Haskell | None
Language | Haskell98

Propellor.Property.Hostname

Synopsis

- sane :: Property UnixLike
- sane' :: ExtractDomain -> Property UnixLike
- setTo :: HostName -> Property UnixLike
- setTo' :: ExtractDomain -> HostName -> Property UnixLike
- searchDomain :: Property UnixLike
- searchDomain' :: ExtractDomain -> Property UnixLike
- mailname :: Property UnixLike
- mailname' :: ExtractDomain -> Property UnixLike
- type ExtractDomain = HostName -> String
- extractDomain :: ExtractDomain

# 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.

sane' :: ExtractDomain -> Property UnixLike Source #

setTo :: HostName -> Property UnixLike Source #

setTo' :: ExtractDomain -> HostName -> Property UnixLike Source #

searchDomain :: Property UnixLike Source #

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

searchDomain' :: ExtractDomain -> Property UnixLike Source #

mailname :: Property UnixLike Source #

mailname' :: ExtractDomain -> Property UnixLike Source #

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.