summaryrefslogtreecommitdiff
path: root/Propellor/Property/Hostname.hs
blob: f5aa5da7a2829038c2d62e736df52ef7c75bff3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
module Propellor.Property.Hostname where

import Propellor
import qualified Propellor.Property.File as File

-- | Sets the hostname. Should be provided with a FQDN, and will configure
-- both /etc/hostname (with the base hostname) and /etc/hosts (with the
-- full hostname). Also sets the current hostname.
set :: HostName -> Property
set hostname = "/etc/hostname" `File.hasContent` [hostname]
	`onChange` cmdProperty "hostname" [hostname]
	`describe` ("hostname " ++ hostname)