Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type Interface = String
- type InterfaceOptions = [(String, String)]
- type InterfaceStanza = ([String], InterfaceOptions)
- ifUp :: Interface -> Property DebianLike
- cleanInterfacesFile :: Property DebianLike
- dhcp :: Interface -> Property DebianLike
- dhcp' :: Interface -> InterfaceOptions -> Property DebianLike
- newtype Gateway = Gateway IPAddr
- static :: Interface -> IPAddr -> Maybe Gateway -> Property DebianLike
- static' :: Interface -> IPAddr -> Maybe Gateway -> InterfaceOptions -> Property DebianLike
- static'' :: Interface -> [(IPAddr, Maybe Gateway, InterfaceOptions)] -> Property DebianLike
- preserveStatic :: Interface -> Property DebianLike
- ipv6to4 :: Property DebianLike
- interfacesFile :: FilePath
- interfaceDFile :: Interface -> FilePath
- escapeInterfaceDName :: Interface -> FilePath
- interfacesDEnabled :: Property DebianLike
- interfaceFileContains :: FilePath -> [String] -> InterfaceOptions -> Property DebianLike
- interfaceFileContains' :: FilePath -> [InterfaceStanza] -> Property DebianLike
Documentation
type InterfaceOptions = [(String, String)] Source #
Options to put in a stanza of an ifupdown interfaces file.
type InterfaceStanza = ([String], InterfaceOptions) Source #
Stanza of an ifupdown interfaces file, with header lines and options.
cleanInterfacesFile :: Property DebianLike Source #
Resets etcnetwork/interfaces to a clean and empty state, containing just the standard loopback interface, and with interfacesD enabled.
This can be used as a starting point to defining other interfaces.
No interfaces are brought up or down by this property.
dhcp :: Interface -> Property DebianLike Source #
Configures an interface to get its address via dhcp.
dhcp' :: Interface -> InterfaceOptions -> Property DebianLike Source #
static :: Interface -> IPAddr -> Maybe Gateway -> Property DebianLike Source #
Configures an interface with a static address and gateway.
static' :: Interface -> IPAddr -> Maybe Gateway -> InterfaceOptions -> Property DebianLike Source #
static'' :: Interface -> [(IPAddr, Maybe Gateway, InterfaceOptions)] -> Property DebianLike Source #
Configures an interface with several stanzas (IPv4 and IPv6 for example).
preserveStatic :: Interface -> Property DebianLike Source #
Writes a static interface file for the specified interface to preserve its current configuration.
The interface has to be up already. It could have been brought up by DHCP, or by other means. The current ipv4 addresses and routing configuration of the interface are written into the file.
If the interface file already exists, this property does nothing, no matter its content.
(ipv6 addresses are not included because it's assumed they come up automatically in most situations.)
ipv6to4 :: Property DebianLike Source #
6to4 ipv6 connection, should work anywhere
interfaceDFile :: Interface -> FilePath Source #
A file in the interfaces.d directory.
escapeInterfaceDName :: Interface -> FilePath Source #
etcnetworkinterfaces.d files have to match -- ^[a-zA-Z0-9_-]+$ see "man 5 interfaces"
interfacesDEnabled :: Property DebianLike Source #
Ensures that files in the the interfaces.d directory are used. interfacesDEnabled :: Property DebianLike
interfaceFileContains :: FilePath -> [String] -> InterfaceOptions -> Property DebianLike Source #