summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/ControlHeir.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Property/ControlHeir.hs')
-rw-r--r--src/Propellor/Property/ControlHeir.hs19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/Propellor/Property/ControlHeir.hs b/src/Propellor/Property/ControlHeir.hs
index c51c9b52..9fd2ce43 100644
--- a/src/Propellor/Property/ControlHeir.hs
+++ b/src/Propellor/Property/ControlHeir.hs
@@ -8,7 +8,8 @@ module Propellor.Property.ControlHeir (
) where
import Propellor.Base
-import Propellor.Spin (spin, SpinMode(..))
+import Propellor.Spin (spin')
+import Propellor.PrivData.Paths
import Propellor.Types.Info
import qualified Propellor.Property.Ssh as Ssh
@@ -170,13 +171,6 @@ controllerFor h = infoProperty desc go (mkControllingInfo h <> privinfo) []
where
desc = cdesc (hostName h)
- go = do
- liftIO $ spin ControllingSpin (hostName h) h
- -- Don't know if the spin made a change to
- -- the remote host or not, but in any case,
- -- the local host was not changed.
- noChange
-
-- Make the controlling host have all the remote host's
-- PrivData, so it can send it on to the remote host
-- when spinning it.
@@ -184,6 +178,15 @@ controllerFor h = infoProperty desc go (mkControllingInfo h <> privinfo) []
forceHostContext (hostName h) $
getInfo (hostInfo h)
+ go = do
+ pm <- liftIO $ filterPrivData h . readPrivData
+ <$> readFileStrictAnyEncoding privDataLocal
+ liftIO $ spin' (Just pm) Nothing (hostName h) h
+ -- Don't know if the spin made a change to
+ -- the remote host or not, but in any case,
+ -- the local host was not changed.
+ noChange
+
-- | Use this property to let the specified controller Host ssh in
-- and run propellor.
controlledBy :: Host -> Property NoInfo