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

Safe Haskell | Safe-Inferred
Language | Haskell2010

Propellor.Types.Dns

Synopsis

- type Domain = String
- data IPAddr
  - = IPv4 String
  - | IPv6 String
- newtype AliasesInfo = AliasesInfo (Set HostName)
- toAliasesInfo :: [HostName] -> AliasesInfo
- fromAliasesInfo :: AliasesInfo -> [HostName]
- newtype DnsInfoPropagated = DnsInfoPropagated {
  - fromDnsInfoPropagated :: Set Record
  }
- toDnsInfoPropagated :: Set Record -> DnsInfoPropagated
- newtype DnsInfoUnpropagated = DnsInfoUnpropagated {
  - fromDnsInfoUnpropagated :: Set Record
  }
- toDnsInfoUnpropagated :: Set Record -> DnsInfoUnpropagated
- getDnsInfo :: Info -> Set Record
- data NamedConf = NamedConf {
  - confDomain :: Domain
  - confDnsServerType :: DnsServerType
  - confFile :: FilePath
  - confMasters :: [IPAddr]
  - confAllowTransfer :: [IPAddr]
  - confLines :: [String]
  }
- data DnsServerType
  - = Master
  - | Secondary
- data Zone = Zone {
  - zDomain :: Domain
  - zSOA :: SOA
  - zHosts :: [(BindDomain, Record)]
  }
- data SOA = SOA {
  - sDomain :: BindDomain
  - sSerial :: SerialNumber
  - sRefresh :: Integer
  - sRetry :: Integer
  - sExpire :: Integer
  - sNegativeCacheTTL :: Integer
  }
- data Record
  - = Address IPAddr
  - | CNAME BindDomain
  - | MX Int BindDomain
  - | NS BindDomain
  - | TXT String
  - | SRV Word16 Word16 Word16 BindDomain
  - | SSHFP Int Int String
  - | INCLUDE FilePath
  - | PTR ReverseIP
- type ReverseIP = String
- reverseIP :: IPAddr -> ReverseIP
- canonicalIP :: IPAddr -> IPAddr
- getIPAddr :: Record -> Maybe IPAddr
- getCNAME :: Record -> Maybe BindDomain
- getNS :: Record -> Maybe BindDomain
- type SerialNumber = Word32
- data BindDomain
  - = RelDomain Domain
  - | AbsDomain Domain
  - | RootDomain
- domainHostName :: BindDomain -> Maybe HostName
- newtype NamedConfMap = NamedConfMap (Map Domain NamedConf)
- fromNamedConfMap :: NamedConfMap -> Map Domain NamedConf

# Documentation

type Domain = String Source #

data IPAddr Source #

Constructors

IPv4 String |
IPv6 String |

#### Instances

Instances details

Read IPAddr Source # |
Instance details Defined in Propellor.Types.Dns Methods readsPrec :: Int -> ReadS IPAddr readList :: ReadS [IPAddr] readPrec :: ReadPrec IPAddr readListPrec :: ReadPrec [IPAddr]
Show IPAddr Source # |
Instance details Defined in Propellor.Types.Dns Methods showsPrec :: Int -> IPAddr -> ShowS show :: IPAddr -> String showList :: [IPAddr] -> ShowS
Eq IPAddr Source # |
Instance details Defined in Propellor.Types.Dns Methods (==) :: IPAddr -> IPAddr -> Bool (/=) :: IPAddr -> IPAddr -> Bool
Ord IPAddr Source # |
Instance details Defined in Propellor.Types.Dns Methods compare :: IPAddr -> IPAddr -> Ordering (<) :: IPAddr -> IPAddr -> Bool (<=) :: IPAddr -> IPAddr -> Bool (>) :: IPAddr -> IPAddr -> Bool (>=) :: IPAddr -> IPAddr -> Bool max :: IPAddr -> IPAddr -> IPAddr min :: IPAddr -> IPAddr -> IPAddr
ConfigurableValue IPAddr Source # |
Instance details Defined in Propellor.Types.Dns Methods val :: IPAddr -> String Source #

newtype AliasesInfo Source #

Constructors

AliasesInfo (Set HostName) |

#### Instances

Instances details

Monoid AliasesInfo Source # |
Instance details Defined in Propellor.Types.Dns Methods mempty :: AliasesInfo # mappend :: AliasesInfo -> AliasesInfo -> AliasesInfo # mconcat :: [AliasesInfo] -> AliasesInfo #
Semigroup AliasesInfo Source # |
Instance details Defined in Propellor.Types.Dns Methods (<>) :: AliasesInfo -> AliasesInfo -> AliasesInfo # sconcat :: NonEmpty AliasesInfo -> AliasesInfo stimes :: Integral b => b -> AliasesInfo -> AliasesInfo
Show AliasesInfo Source # |
Instance details Defined in Propellor.Types.Dns Methods showsPrec :: Int -> AliasesInfo -> ShowS show :: AliasesInfo -> String showList :: [AliasesInfo] -> ShowS
Eq AliasesInfo Source # |
Instance details Defined in Propellor.Types.Dns Methods (==) :: AliasesInfo -> AliasesInfo -> Bool (/=) :: AliasesInfo -> AliasesInfo -> Bool
Ord AliasesInfo Source # |
Instance details Defined in Propellor.Types.Dns Methods compare :: AliasesInfo -> AliasesInfo -> Ordering (<) :: AliasesInfo -> AliasesInfo -> Bool (<=) :: AliasesInfo -> AliasesInfo -> Bool (>) :: AliasesInfo -> AliasesInfo -> Bool (>=) :: AliasesInfo -> AliasesInfo -> Bool max :: AliasesInfo -> AliasesInfo -> AliasesInfo min :: AliasesInfo -> AliasesInfo -> AliasesInfo
IsInfo AliasesInfo Source # |
Instance details Defined in Propellor.Types.Dns Methods propagateInfo :: AliasesInfo -> PropagateInfo Source #

toAliasesInfo :: [HostName] -> AliasesInfo Source #

fromAliasesInfo :: AliasesInfo -> [HostName] Source #

newtype DnsInfoPropagated Source #

Use this for DNS Info that should propagate from a container to a host. For example, this can be used for CNAME to make aliases of the containers in the host be reflected in the DNS.

Constructors

DnsInfoPropagated |

Fields

- fromDnsInfoPropagated :: Set Record

#### Instances

Instances details

Monoid DnsInfoPropagated Source # |
Instance details Defined in Propellor.Types.Dns Methods mempty :: DnsInfoPropagated # mappend :: DnsInfoPropagated -> DnsInfoPropagated -> DnsInfoPropagated # mconcat :: [DnsInfoPropagated] -> DnsInfoPropagated #
Semigroup DnsInfoPropagated Source # |
Instance details Defined in Propellor.Types.Dns Methods (<>) :: DnsInfoPropagated -> DnsInfoPropagated -> DnsInfoPropagated # sconcat :: NonEmpty DnsInfoPropagated -> DnsInfoPropagated stimes :: Integral b => b -> DnsInfoPropagated -> DnsInfoPropagated
Show DnsInfoPropagated Source # |
Instance details Defined in Propellor.Types.Dns Methods showsPrec :: Int -> DnsInfoPropagated -> ShowS show :: DnsInfoPropagated -> String showList :: [DnsInfoPropagated] -> ShowS
Eq DnsInfoPropagated Source # |
Instance details Defined in Propellor.Types.Dns Methods (==) :: DnsInfoPropagated -> DnsInfoPropagated -> Bool (/=) :: DnsInfoPropagated -> DnsInfoPropagated -> Bool
Ord DnsInfoPropagated Source # |

Instance details

Defined in Propellor.Types.Dns

Methods

compare :: DnsInfoPropagated -> DnsInfoPropagated -> Ordering

(<) :: DnsInfoPropagated -> DnsInfoPropagated -> Bool

(<=) :: DnsInfoPropagated -> DnsInfoPropagated -> Bool

(>) :: DnsInfoPropagated -> DnsInfoPropagated -> Bool

(>=) :: DnsInfoPropagated -> DnsInfoPropagated -> Bool

max :: DnsInfoPropagated -> DnsInfoPropagated -> DnsInfoPropagated

min :: DnsInfoPropagated -> DnsInfoPropagated -> DnsInfoPropagated

IsInfo DnsInfoPropagated Source # |
Instance details Defined in Propellor.Types.Dns Methods propagateInfo :: DnsInfoPropagated -> PropagateInfo Source #

toDnsInfoPropagated :: Set Record -> DnsInfoPropagated Source #

newtype DnsInfoUnpropagated Source #

Use this for DNS Info that should not propagate from a container to a host. For example, an IP address of a container should not influence the host.

Constructors

DnsInfoUnpropagated |

Fields

- fromDnsInfoUnpropagated :: Set Record

#### Instances

Instances details

Monoid DnsInfoUnpropagated Source # |
Instance details Defined in Propellor.Types.Dns Methods mempty :: DnsInfoUnpropagated # mappend :: DnsInfoUnpropagated -> DnsInfoUnpropagated -> DnsInfoUnpropagated # mconcat :: [DnsInfoUnpropagated] -> DnsInfoUnpropagated #
Semigroup DnsInfoUnpropagated Source # |
Instance details Defined in Propellor.Types.Dns Methods (<>) :: DnsInfoUnpropagated -> DnsInfoUnpropagated -> DnsInfoUnpropagated # sconcat :: NonEmpty DnsInfoUnpropagated -> DnsInfoUnpropagated stimes :: Integral b => b -> DnsInfoUnpropagated -> DnsInfoUnpropagated
Show DnsInfoUnpropagated Source # |
Instance details Defined in Propellor.Types.Dns Methods showsPrec :: Int -> DnsInfoUnpropagated -> ShowS show :: DnsInfoUnpropagated -> String showList :: [DnsInfoUnpropagated] -> ShowS
Eq DnsInfoUnpropagated Source # |
Instance details Defined in Propellor.Types.Dns Methods (==) :: DnsInfoUnpropagated -> DnsInfoUnpropagated -> Bool (/=) :: DnsInfoUnpropagated -> DnsInfoUnpropagated -> Bool
Ord DnsInfoUnpropagated Source # |

Instance details

Defined in Propellor.Types.Dns

Methods

compare :: DnsInfoUnpropagated -> DnsInfoUnpropagated -> Ordering

(<) :: DnsInfoUnpropagated -> DnsInfoUnpropagated -> Bool

(<=) :: DnsInfoUnpropagated -> DnsInfoUnpropagated -> Bool

(>) :: DnsInfoUnpropagated -> DnsInfoUnpropagated -> Bool

(>=) :: DnsInfoUnpropagated -> DnsInfoUnpropagated -> Bool

max :: DnsInfoUnpropagated -> DnsInfoUnpropagated -> DnsInfoUnpropagated

min :: DnsInfoUnpropagated -> DnsInfoUnpropagated -> DnsInfoUnpropagated

IsInfo DnsInfoUnpropagated Source # |
Instance details Defined in Propellor.Types.Dns Methods propagateInfo :: DnsInfoUnpropagated -> PropagateInfo Source #

toDnsInfoUnpropagated :: Set Record -> DnsInfoUnpropagated Source #

getDnsInfo :: Info -> Set Record Source #

Get all DNS Info.

data NamedConf Source #

Represents a bind 9 named.conf file.

Constructors

NamedConf |

Fields

- confDomain :: Domain
- confDnsServerType :: DnsServerType
- confFile :: FilePath
- confMasters :: [IPAddr]
- confAllowTransfer :: [IPAddr]
- confLines :: [String]

#### Instances

Instances details

Show NamedConf Source # |
Instance details Defined in Propellor.Types.Dns Methods showsPrec :: Int -> NamedConf -> ShowS show :: NamedConf -> String showList :: [NamedConf] -> ShowS
Eq NamedConf Source # |
Instance details Defined in Propellor.Types.Dns Methods (==) :: NamedConf -> NamedConf -> Bool (/=) :: NamedConf -> NamedConf -> Bool
Ord NamedConf Source # |
Instance details Defined in Propellor.Types.Dns Methods compare :: NamedConf -> NamedConf -> Ordering (<) :: NamedConf -> NamedConf -> Bool (<=) :: NamedConf -> NamedConf -> Bool (>) :: NamedConf -> NamedConf -> Bool (>=) :: NamedConf -> NamedConf -> Bool max :: NamedConf -> NamedConf -> NamedConf min :: NamedConf -> NamedConf -> NamedConf

data DnsServerType Source #

Constructors

Master |
Secondary |

#### Instances

Instances details

Show DnsServerType Source # |
Instance details Defined in Propellor.Types.Dns Methods showsPrec :: Int -> DnsServerType -> ShowS show :: DnsServerType -> String showList :: [DnsServerType] -> ShowS
Eq DnsServerType Source # |
Instance details Defined in Propellor.Types.Dns Methods (==) :: DnsServerType -> DnsServerType -> Bool (/=) :: DnsServerType -> DnsServerType -> Bool
Ord DnsServerType Source # |

Instance details

Defined in Propellor.Types.Dns

Methods

compare :: DnsServerType -> DnsServerType -> Ordering

(<) :: DnsServerType -> DnsServerType -> Bool

(<=) :: DnsServerType -> DnsServerType -> Bool

(>) :: DnsServerType -> DnsServerType -> Bool

(>=) :: DnsServerType -> DnsServerType -> Bool

max :: DnsServerType -> DnsServerType -> DnsServerType

min :: DnsServerType -> DnsServerType -> DnsServerType

data Zone Source #

Represents a bind 9 zone file.

Constructors

Zone |

Fields

- zDomain :: Domain
- zSOA :: SOA
- zHosts :: [(BindDomain, Record)]

#### Instances

Instances details

Read Zone Source # |
Instance details Defined in Propellor.Types.Dns Methods readsPrec :: Int -> ReadS Zone readList :: ReadS [Zone] readPrec :: ReadPrec Zone readListPrec :: ReadPrec [Zone]
Show Zone Source # |
Instance details Defined in Propellor.Types.Dns Methods showsPrec :: Int -> Zone -> ShowS show :: Zone -> String showList :: [Zone] -> ShowS
Eq Zone Source # |
Instance details Defined in Propellor.Types.Dns Methods (==) :: Zone -> Zone -> Bool (/=) :: Zone -> Zone -> Bool

data SOA Source #

Every domain has a SOA record, which is big and complicated.

Constructors

SOA |

Fields

- sDomain :: BindDomain

  Typically ns1.your.domain

- sSerial :: SerialNumber

  The most important parameter is the serial number, which must increase after each change.

- sRefresh :: Integer
- sRetry :: Integer
- sExpire :: Integer
- sNegativeCacheTTL :: Integer

#### Instances

Instances details

Read SOA Source # |
Instance details Defined in Propellor.Types.Dns Methods readsPrec :: Int -> ReadS SOA readList :: ReadS [SOA] readPrec :: ReadPrec SOA readListPrec :: ReadPrec [SOA]
Show SOA Source # |
Instance details Defined in Propellor.Types.Dns Methods showsPrec :: Int -> SOA -> ShowS show :: SOA -> String showList :: [SOA] -> ShowS
Eq SOA Source # |
Instance details Defined in Propellor.Types.Dns Methods (==) :: SOA -> SOA -> Bool (/=) :: SOA -> SOA -> Bool

data Record Source #

Types of DNS records.

This is not a complete list, more can be added.

Constructors

Address IPAddr |
CNAME BindDomain |
MX Int BindDomain |
NS BindDomain |
TXT String |
SRV Word16 Word16 Word16 BindDomain |
SSHFP Int Int String |
INCLUDE FilePath |
PTR ReverseIP |

#### Instances

Instances details

Read Record Source # |
Instance details Defined in Propellor.Types.Dns Methods readsPrec :: Int -> ReadS Record readList :: ReadS [Record] readPrec :: ReadPrec Record readListPrec :: ReadPrec [Record]
Show Record Source # |
Instance details Defined in Propellor.Types.Dns Methods showsPrec :: Int -> Record -> ShowS show :: Record -> String showList :: [Record] -> ShowS
Eq Record Source # |
Instance details Defined in Propellor.Types.Dns Methods (==) :: Record -> Record -> Bool (/=) :: Record -> Record -> Bool
Ord Record Source # |
Instance details Defined in Propellor.Types.Dns Methods compare :: Record -> Record -> Ordering (<) :: Record -> Record -> Bool (<=) :: Record -> Record -> Bool (>) :: Record -> Record -> Bool (>=) :: Record -> Record -> Bool max :: Record -> Record -> Record min :: Record -> Record -> Record

type ReverseIP = String Source #

An in-addr.arpa record corresponding to an IPAddr.

reverseIP :: IPAddr -> ReverseIP Source #

canonicalIP :: IPAddr -> IPAddr Source #

Converts an IP address (particularly IPv6) to canonical, fully expanded form.

getIPAddr :: Record -> Maybe IPAddr Source #

getCNAME :: Record -> Maybe BindDomain Source #

getNS :: Record -> Maybe BindDomain Source #

type SerialNumber = Word32 Source #

Bind serial numbers are unsigned, 32 bit integers.

data BindDomain Source #

Domains in the zone file must end with a period if they are absolute.

Let's use a type to keep absolute domains straight from relative domains.

The RootDomain refers to the top level of the domain, so can be used to add nameservers, MX's, etc to a domain.

Constructors

RelDomain Domain |
AbsDomain Domain |
RootDomain |

#### Instances

Instances details

Read BindDomain Source # |
Instance details Defined in Propellor.Types.Dns Methods readsPrec :: Int -> ReadS BindDomain readList :: ReadS [BindDomain] readPrec :: ReadPrec BindDomain readListPrec :: ReadPrec [BindDomain]
Show BindDomain Source # |
Instance details Defined in Propellor.Types.Dns Methods showsPrec :: Int -> BindDomain -> ShowS show :: BindDomain -> String showList :: [BindDomain] -> ShowS
Eq BindDomain Source # |
Instance details Defined in Propellor.Types.Dns Methods (==) :: BindDomain -> BindDomain -> Bool (/=) :: BindDomain -> BindDomain -> Bool
Ord BindDomain Source # |
Instance details Defined in Propellor.Types.Dns Methods compare :: BindDomain -> BindDomain -> Ordering (<) :: BindDomain -> BindDomain -> Bool (<=) :: BindDomain -> BindDomain -> Bool (>) :: BindDomain -> BindDomain -> Bool (>=) :: BindDomain -> BindDomain -> Bool max :: BindDomain -> BindDomain -> BindDomain min :: BindDomain -> BindDomain -> BindDomain

domainHostName :: BindDomain -> Maybe HostName Source #

newtype NamedConfMap Source #

Constructors

NamedConfMap (Map Domain NamedConf) |

#### Instances

Instances details

Monoid NamedConfMap Source # |
Instance details Defined in Propellor.Types.Dns Methods mempty :: NamedConfMap # mappend :: NamedConfMap -> NamedConfMap -> NamedConfMap # mconcat :: [NamedConfMap] -> NamedConfMap #
Semigroup NamedConfMap Source # | Adding a Master NamedConf stanza for a particular domain always overrides an existing Secondary stanza for that domain, while a Secondary stanza is only added when there is no existing Master stanza.
Instance details Defined in Propellor.Types.Dns Methods (<>) :: NamedConfMap -> NamedConfMap -> NamedConfMap # sconcat :: NonEmpty NamedConfMap -> NamedConfMap stimes :: Integral b => b -> NamedConfMap -> NamedConfMap
Show NamedConfMap Source # |
Instance details Defined in Propellor.Types.Dns Methods showsPrec :: Int -> NamedConfMap -> ShowS show :: NamedConfMap -> String showList :: [NamedConfMap] -> ShowS
Eq NamedConfMap Source # |
Instance details Defined in Propellor.Types.Dns Methods (==) :: NamedConfMap -> NamedConfMap -> Bool (/=) :: NamedConfMap -> NamedConfMap -> Bool
Ord NamedConfMap Source # |
Instance details Defined in Propellor.Types.Dns Methods compare :: NamedConfMap -> NamedConfMap -> Ordering (<) :: NamedConfMap -> NamedConfMap -> Bool (<=) :: NamedConfMap -> NamedConfMap -> Bool (>) :: NamedConfMap -> NamedConfMap -> Bool (>=) :: NamedConfMap -> NamedConfMap -> Bool max :: NamedConfMap -> NamedConfMap -> NamedConfMap min :: NamedConfMap -> NamedConfMap -> NamedConfMap
Empty NamedConfMap Source # |
Instance details Defined in Propellor.Types.Dns Methods isEmpty :: NamedConfMap -> Bool Source #
IsInfo NamedConfMap Source # |
Instance details Defined in Propellor.Types.Dns Methods propagateInfo :: NamedConfMap -> PropagateInfo Source #

fromNamedConfMap :: NamedConfMap -> Map Domain NamedConf Source #