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

Safe Haskell | None
Language | Haskell98

Propellor.Property.Network

Synopsis

- type Interface = String
- type InterfaceOptions = [(String, String)]
- 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
- preserveStatic :: Interface -> Property DebianLike
- ipv6to4 :: Property DebianLike
- interfacesFile :: FilePath
- interfaceDFile :: Interface -> FilePath
- escapeInterfaceDName :: Interface -> FilePath
- interfacesDEnabled :: Property DebianLike
- interfaceFileContains :: FilePath -> [String] -> InterfaceOptions -> Property DebianLike

# Documentation

type Interface = String Source #

type InterfaceOptions = [(String, String)] Source #

Options to put in a stanza of an ifupdown interfaces file.

ifUp :: Interface -> Property DebianLike Source #

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 #

newtype Gateway Source #

Constructors

Gateway IPAddr |

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 #

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

interfacesFile :: FilePath Source #

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 #