From fd3335e40e3c938f1fbf53287e37aaf76b8c69df Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 22 Nov 2014 12:57:07 -0400 Subject: --via implemented --- debian/changelog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index a44d72af..4d264f4d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,9 @@ propellor (1.0.1) UNRELEASED; urgency=medium * propellor --spin can now deploy propellor to hosts that do not have git, ghc, or apt-get. This is accomplished by uploading a fairly portable precompiled tarball of propellor. - * --spin host --via host causes propellor to bounce through an intermediate - host, which handles any necessary provisioning of the host being spun. + * --spin target --via relay causes propellor to bounce through an + intermediate relay host, which handles any necessary provisioning + of the target host. -- Joey Hess Sat, 22 Nov 2014 00:12:35 -0400 -- cgit v1.2.3 From d413818647d4d4c6117260f936f3df4515af94b2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 22 Nov 2014 16:26:03 -0400 Subject: clarify --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 4d264f4d..f82270e2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,8 @@ propellor (1.0.1) UNRELEASED; urgency=medium git, ghc, or apt-get. This is accomplished by uploading a fairly portable precompiled tarball of propellor. * --spin target --via relay causes propellor to bounce through an - intermediate relay host, which handles any necessary provisioning - of the target host. + intermediate relay host, which handles any necessary uploads + when provisioning the target host. -- Joey Hess Sat, 22 Nov 2014 00:12:35 -0400 -- cgit v1.2.3 From 9a8fcf80bb026c390ad56da9b70d153fd978d6cf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 22 Nov 2014 19:58:35 -0400 Subject: Hostname parameters not containing dots are looked up in the DNS to find the full hostname. --- debian/changelog | 2 ++ src/Propellor/CmdLine.hs | 16 ++++++++++++---- src/Propellor/Types/OS.hs | 15 +++++++++++++-- 3 files changed, 27 insertions(+), 6 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index f82270e2..32b504fd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ propellor (1.0.1) UNRELEASED; urgency=medium * --spin target --via relay causes propellor to bounce through an intermediate relay host, which handles any necessary uploads when provisioning the target host. + * Hostname parameters not containing dots are looked up in the DNS to + find the full hostname. -- Joey Hess Sat, 22 Nov 2014 00:12:35 -0400 diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index 11193ab3..e808395b 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -7,6 +7,7 @@ import System.Environment (getArgs) import Data.List import System.Exit import System.PosixCompat +import qualified Network.BSD import Propellor import Propellor.Protocol @@ -40,9 +41,8 @@ usageError ps = do processCmdLine :: IO CmdLine processCmdLine = go =<< getArgs where - go ("--run":h:[]) = return $ Run h - go ("--spin":h:[]) = return $ Spin h Nothing - go ("--spin":h:"--via":r:[]) = return $ Spin h (Just r) + go ("--spin":h:[]) = Spin <$> hostname h <*> pure Nothing + go ("--spin":h:"--via":r:[]) = Spin <$> hostname h <*> pure (Just r) go ("--add-key":k:[]) = return $ AddKey k go ("--set":f:c:[]) = withprivfield f c Set go ("--dump":f:c:[]) = withprivfield f c Dump @@ -56,9 +56,10 @@ processCmdLine = go =<< getArgs go ("--serialized":s:[]) = serialized Serialized s go ("--continue":s:[]) = serialized Continue s go ("--gitpush":fin:fout:_) = return $ GitPush (Prelude.read fin) (Prelude.read fout) + go ("--run":h:[]) = go [h] go (h:[]) | "--" `isPrefixOf` h = usageError [h] - | otherwise = return $ Run h + | otherwise = Run <$> hostname h go [] = do s <- takeWhile (/= '\n') <$> readProcess "hostname" ["-f"] if null s @@ -210,3 +211,10 @@ spin target relay hst = do cmd = if viarelay then "--serialized " ++ shellEscape (show (Spin target (Just target))) else "--continue " ++ shellEscape (show (SimpleRun target)) + +hostname :: String -> IO HostName +hostname s + | "." `isInfixOf` s = pure s + | otherwise = do + h <- Network.BSD.getHostByName s + return (Network.BSD.hostName h) diff --git a/src/Propellor/Types/OS.hs b/src/Propellor/Types/OS.hs index 2529e7d8..72e3d764 100644 --- a/src/Propellor/Types/OS.hs +++ b/src/Propellor/Types/OS.hs @@ -1,6 +1,17 @@ -module Propellor.Types.OS where +module Propellor.Types.OS ( + HostName, + UserName, + GroupName, + System(..), + Distribution(..), + DebianSuite(..), + isStable, + Release, + Architecture, +) where + +import Network.BSD (HostName) -type HostName = String type UserName = String type GroupName = String -- cgit v1.2.3 From e8a07b184014e307919be8921ee3029bae809048 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 23 Nov 2014 14:38:31 -0400 Subject: changelog --- debian/changelog | 1 + 1 file changed, 1 insertion(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 32b504fd..6bbf153a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ propellor (1.0.1) UNRELEASED; urgency=medium when provisioning the target host. * Hostname parameters not containing dots are looked up in the DNS to find the full hostname. + * Added group-related properties. Thanks, Thanks, Félix Sipma. -- Joey Hess Sat, 22 Nov 2014 00:12:35 -0400 -- cgit v1.2.3 From dea5c2068ee40a8d843eb39f5dd1a71360cfe157 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 23 Nov 2014 14:39:19 -0400 Subject: changelog --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 6bbf153a..2c3baf81 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,7 +8,8 @@ propellor (1.0.1) UNRELEASED; urgency=medium when provisioning the target host. * Hostname parameters not containing dots are looked up in the DNS to find the full hostname. - * Added group-related properties. Thanks, Thanks, Félix Sipma. + * Added group-related properties. Thanks, Félix Sipma. + * Added Git.barerepo. Thanks, Félix Sipma. -- Joey Hess Sat, 22 Nov 2014 00:12:35 -0400 -- cgit v1.2.3