summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Network.hs
diff options
context:
space:
mode:
authorJoey Hess2015-08-12 17:00:03 -0400
committerJoey Hess2015-08-12 17:00:03 -0400
commit4cab90c13713025a66c4aec7074730faa2e2b4ed (patch)
tree9a0b4bfb04ceb1d56e7f43f8252132266a098c1c /src/Propellor/Property/Network.hs
parentb64a91db5767e2afcd53f496ba303ada8e3fdcc1 (diff)
propellor spin
Diffstat (limited to 'src/Propellor/Property/Network.hs')
-rw-r--r--src/Propellor/Property/Network.hs9
1 files changed, 9 insertions, 0 deletions
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