From f674c56119bd9b1bb9af53d5063c57275be77827 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 19 Jun 2014 14:56:50 -0400 Subject: Add --list-fields to list a host's currently set privdata fields. --- src/Propellor/PrivData.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Propellor/PrivData.hs') diff --git a/src/Propellor/PrivData.hs b/src/Propellor/PrivData.hs index fec6acc3..c2af4284 100644 --- a/src/Propellor/PrivData.hs +++ b/src/Propellor/PrivData.hs @@ -68,6 +68,13 @@ editPrivData host field = do readFile f setPrivDataTo host field v' +listPrivDataFields :: HostName -> IO () +listPrivDataFields host = do + putStrLn (host ++ "'s currently set privdata fields:") + mapM_ list . M.keys =<< decryptPrivData host + where + list = putStrLn . ("\t" ++) . shellEscape . show + setPrivDataTo :: HostName -> PrivDataField -> String -> IO () setPrivDataTo host field value = do makePrivDataDir -- cgit v1.2.3