diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-10-20 23:33:19 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-10-20 23:33:19 -0400 |
| commit | 745f42c1499749345c32736342959584587c9b57 (patch) | |
| tree | 09c703415a309369796a8e394163010901b809cd /src/Propellor/Property/ControlHeir.hs | |
| parent | 2f9c0bf950e9e879ca374ab8fc523c5486f156bd (diff) | |
simplify privdata propigation to spin from controller
Diffstat (limited to 'src/Propellor/Property/ControlHeir.hs')
| -rw-r--r-- | src/Propellor/Property/ControlHeir.hs | 19 |
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 |
