From 4cab90c13713025a66c4aec7074730faa2e2b4ed Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 12 Aug 2015 17:00:03 -0400 Subject: propellor spin --- src/Propellor/Property/Network.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Propellor/Property/Network.hs') diff --git a/src/Propellor/Property/Network.hs b/src/Propellor/Property/Network.hs index 4d7ccffb..e01edb62 100644 --- a/src/Propellor/Property/Network.hs +++ b/src/Propellor/Property/Network.hs @@ -27,6 +27,15 @@ cleanInterfacesFile = hasContent interfacesFile ] `describe` ("clean " ++ interfacesFile) +-- | Configures an interface to get its address via dhcp. +dhcp :: Interface -> Property NoInfo +dhcp iface = hasContent (interfaceDFile iface) + [ "auto " ++ iface + , "iface " ++ iface ++ " inet dhcp" + ] + `describe` ("dhcp " ++ iface) + `requires` interfacesDEnabled + -- | Writes a static interface file for the specified interface. -- -- The interface has to be up already. It could have been brought up by -- cgit v1.2.3