Merge branch 'joeyconfig'
This commit is contained in:
commit
9d06d2f835
|
@ -90,7 +90,7 @@ stdSourcesListFor suite = stdSourcesList' suite []
|
||||||
-- | Adds additional sources.list generators.
|
-- | Adds additional sources.list generators.
|
||||||
--
|
--
|
||||||
-- Note that if a Property needs to enable an apt source, it's better
|
-- Note that if a Property needs to enable an apt source, it's better
|
||||||
-- to do so via a separate file in /etc/apt/sources.list.d/
|
-- to do so via a separate file in </etc/apt/sources.list.d/>
|
||||||
stdSourcesList' :: DebianSuite -> [SourcesGenerator] -> Property
|
stdSourcesList' :: DebianSuite -> [SourcesGenerator] -> Property
|
||||||
stdSourcesList' suite more = setSourcesList
|
stdSourcesList' suite more = setSourcesList
|
||||||
(concatMap (\gen -> gen suite) generators)
|
(concatMap (\gen -> gen suite) generators)
|
||||||
|
|
|
@ -233,7 +233,7 @@ makeWrapperScript dir = do
|
||||||
]
|
]
|
||||||
modifyFileMode wrapperScript (addModes $ readModes ++ executeModes)
|
modifyFileMode wrapperScript (addModes $ readModes ++ executeModes)
|
||||||
|
|
||||||
-- Work around for http://bugs.debian.org/770217
|
-- Work around for <http://bugs.debian.org/770217>
|
||||||
makeDevicesTarball :: IO ()
|
makeDevicesTarball :: IO ()
|
||||||
makeDevicesTarball = do
|
makeDevicesTarball = do
|
||||||
-- TODO append to tarball; avoid writing to /dev
|
-- TODO append to tarball; avoid writing to /dev
|
||||||
|
|
|
@ -176,7 +176,7 @@ garbageCollected = propertyList "docker garbage collected"
|
||||||
-- | Tweaks a container to work well with docker.
|
-- | Tweaks a container to work well with docker.
|
||||||
--
|
--
|
||||||
-- Currently, this consists of making pam_loginuid lines optional in
|
-- Currently, this consists of making pam_loginuid lines optional in
|
||||||
-- the pam config, to work around https://github.com/docker/docker/issues/5663
|
-- the pam config, to work around <https://github.com/docker/docker/issues/5663>
|
||||||
-- which affects docker 1.2.0.
|
-- which affects docker 1.2.0.
|
||||||
tweaked :: Property
|
tweaked :: Property
|
||||||
tweaked = trivial $
|
tweaked = trivial $
|
||||||
|
@ -529,7 +529,7 @@ dockerInfo :: DockerInfo Host -> Info
|
||||||
dockerInfo i = mempty { _dockerinfo = i }
|
dockerInfo i = mempty { _dockerinfo = i }
|
||||||
|
|
||||||
-- | The ContainerIdent of a container is written to
|
-- | The ContainerIdent of a container is written to
|
||||||
-- /.propellor-ident inside it. This can be checked to see if
|
-- </.propellor-ident> inside it. This can be checked to see if
|
||||||
-- the container has the same ident later.
|
-- the container has the same ident later.
|
||||||
propellorIdent :: FilePath
|
propellorIdent :: FilePath
|
||||||
propellorIdent = "/.propellor-ident"
|
propellorIdent = "/.propellor-ident"
|
||||||
|
|
|
@ -4,10 +4,10 @@ import Propellor
|
||||||
import qualified Propellor.Property.File as File
|
import qualified Propellor.Property.File as File
|
||||||
import qualified Propellor.Property.Apt as Apt
|
import qualified Propellor.Property.Apt as Apt
|
||||||
|
|
||||||
-- | Eg, hd0,0 or xen/xvda1
|
-- | Eg, "hd0,0" or "xen/xvda1"
|
||||||
type GrubDevice = String
|
type GrubDevice = String
|
||||||
|
|
||||||
-- | Eg, /dev/sda
|
-- | Eg, "/dev/sda"
|
||||||
type OSDevice = String
|
type OSDevice = String
|
||||||
|
|
||||||
type TimeoutSecs = Int
|
type TimeoutSecs = Int
|
||||||
|
@ -51,7 +51,7 @@ boots dev = cmdProperty "grub-install" [dev]
|
||||||
--
|
--
|
||||||
-- Useful when the VPS's pv-grub is too old to boot a modern kernel image.
|
-- Useful when the VPS's pv-grub is too old to boot a modern kernel image.
|
||||||
--
|
--
|
||||||
-- http://notes.pault.ag/linode-pv-grub-chainning/
|
-- <http://notes.pault.ag/linode-pv-grub-chainning/>
|
||||||
--
|
--
|
||||||
-- The rootdev should be in the form "hd0", while the bootdev is in the form
|
-- The rootdev should be in the form "hd0", while the bootdev is in the form
|
||||||
-- "xen/xvda".
|
-- "xen/xvda".
|
||||||
|
|
|
@ -7,14 +7,14 @@ import Data.List
|
||||||
|
|
||||||
-- | Ensures that the hostname is set using best practices.
|
-- | Ensures that the hostname is set using best practices.
|
||||||
--
|
--
|
||||||
-- Configures `/etc/hostname` and the current hostname.
|
-- Configures </etc/hostname> and the current hostname.
|
||||||
--
|
--
|
||||||
-- Configures `/etc/mailname` with the domain part of the hostname.
|
-- Configures </etc/mailname> with the domain part of the hostname.
|
||||||
--
|
--
|
||||||
-- `/etc/hosts` is also configured, with an entry for 127.0.1.1, which is
|
-- </etc/hosts> is also configured, with an entry for 127.0.1.1, which is
|
||||||
-- standard at least on Debian to set the FDQN.
|
-- standard at least on Debian to set the FDQN.
|
||||||
--
|
--
|
||||||
-- Also, the `/etc/hosts` 127.0.0.1 line is set to localhost. Putting any
|
-- Also, the </etc/hosts> 127.0.0.1 line is set to localhost. Putting any
|
||||||
-- other hostnames there is not best practices and can lead to annoying
|
-- other hostnames there is not best practices and can lead to annoying
|
||||||
-- messages from eg, apache.
|
-- messages from eg, apache.
|
||||||
sane :: Property
|
sane :: Property
|
||||||
|
@ -44,7 +44,7 @@ setTo hn = combineProperties desc go
|
||||||
(ip ++ "\t" ++ (unwords names)) : filter (not . hasip ip) ls
|
(ip ++ "\t" ++ (unwords names)) : filter (not . hasip ip) ls
|
||||||
hasip ip l = headMaybe (words l) == Just ip
|
hasip ip l = headMaybe (words l) == Just ip
|
||||||
|
|
||||||
-- | Makes `/etc/resolv.conf` contain search and domain lines for
|
-- | Makes </etc/resolv.conf> contain search and domain lines for
|
||||||
-- the domain that the hostname is in.
|
-- the domain that the hostname is in.
|
||||||
searchDomain :: Property
|
searchDomain :: Property
|
||||||
searchDomain = property desc (ensureProperty . go =<< asks hostName)
|
searchDomain = property desc (ensureProperty . go =<< asks hostName)
|
||||||
|
|
|
@ -33,10 +33,10 @@ import Control.Exception (throw)
|
||||||
-- the property to.
|
-- the property to.
|
||||||
--
|
--
|
||||||
-- This property only runs once. The cleanly installed system will have
|
-- This property only runs once. The cleanly installed system will have
|
||||||
-- a file /etc/propellor-cleaninstall, which indicates it was cleanly
|
-- a file </etc/propellor-cleaninstall>, which indicates it was cleanly
|
||||||
-- installed.
|
-- installed.
|
||||||
--
|
--
|
||||||
-- The files from the old os will be left in /old-os
|
-- The files from the old os will be left in </old-os>
|
||||||
--
|
--
|
||||||
-- After the OS is installed, and if all properties of the host have
|
-- After the OS is installed, and if all properties of the host have
|
||||||
-- been successfully satisfied, the host will be rebooted to properly load
|
-- been successfully satisfied, the host will be rebooted to properly load
|
||||||
|
@ -188,13 +188,13 @@ confirmed desc (Confirmed c) = property desc $ do
|
||||||
return FailedChange
|
return FailedChange
|
||||||
else return NoChange
|
else return NoChange
|
||||||
|
|
||||||
-- | /etc/network/interfaces is configured to bring up the network
|
-- | </etc/network/interfaces> is configured to bring up the network
|
||||||
-- interface that currently has a default route configured, using
|
-- interface that currently has a default route configured, using
|
||||||
-- the same (static) IP address.
|
-- the same (static) IP address.
|
||||||
preserveNetwork :: Property
|
preserveNetwork :: Property
|
||||||
preserveNetwork = undefined -- TODO
|
preserveNetwork = undefined -- TODO
|
||||||
|
|
||||||
-- | /etc/resolv.conf is copied the from the old OS
|
-- | </etc/resolv.conf> is copied from the old OS
|
||||||
preserveResolvConf :: Property
|
preserveResolvConf :: Property
|
||||||
preserveResolvConf = check (fileExist oldloc) $
|
preserveResolvConf = check (fileExist oldloc) $
|
||||||
property (newloc ++ " copied from old OS") $ do
|
property (newloc ++ " copied from old OS") $ do
|
||||||
|
@ -204,7 +204,7 @@ preserveResolvConf = check (fileExist oldloc) $
|
||||||
newloc = "/etc/resolv.conf"
|
newloc = "/etc/resolv.conf"
|
||||||
oldloc = oldOSDir ++ newloc
|
oldloc = oldOSDir ++ newloc
|
||||||
|
|
||||||
-- | Root's .ssh/authorized_keys has added to it any ssh keys that
|
-- | </root/.ssh/authorized_keys> has added to it any ssh keys that
|
||||||
-- were authorized in the old OS. Any other contents of the file are
|
-- were authorized in the old OS. Any other contents of the file are
|
||||||
-- retained.
|
-- retained.
|
||||||
preserveRootSshAuthorized :: Property
|
preserveRootSshAuthorized :: Property
|
||||||
|
@ -216,7 +216,7 @@ preserveRootSshAuthorized = check (fileExist oldloc) $
|
||||||
newloc = "/root/.ssh/authorized_keys"
|
newloc = "/root/.ssh/authorized_keys"
|
||||||
oldloc = oldOSDir ++ newloc
|
oldloc = oldOSDir ++ newloc
|
||||||
|
|
||||||
-- Removes the old OS's backup from /old-os
|
-- Removes the old OS's backup from </old-os>
|
||||||
oldOSRemoved :: Confirmation -> Property
|
oldOSRemoved :: Confirmation -> Property
|
||||||
oldOSRemoved confirmation = check (doesDirectoryExist oldOSDir) $
|
oldOSRemoved confirmation = check (doesDirectoryExist oldOSDir) $
|
||||||
go `requires` confirmed "old OS backup removal confirmed" confirmation
|
go `requires` confirmed "old OS backup removal confirmed" confirmation
|
||||||
|
|
|
@ -50,7 +50,7 @@ mappedFile f setup = setup f
|
||||||
`onChange` cmdProperty "postmap" [f]
|
`onChange` cmdProperty "postmap" [f]
|
||||||
|
|
||||||
-- | Run newaliases command, which should be done after changing
|
-- | Run newaliases command, which should be done after changing
|
||||||
-- /etc/aliases.
|
-- </etc/aliases>.
|
||||||
newaliases :: Property
|
newaliases :: Property
|
||||||
newaliases = trivial $ cmdProperty "newaliases" []
|
newaliases = trivial $ cmdProperty "newaliases" []
|
||||||
|
|
||||||
|
|
|
@ -227,7 +227,7 @@ containerCfg p = RevertableProperty (mk True) (mk False)
|
||||||
('-':_) -> p
|
('-':_) -> p
|
||||||
_ -> "--" ++ p
|
_ -> "--" ++ p
|
||||||
|
|
||||||
-- | Bind mounts /etc/resolv.conf from the host into the container.
|
-- | Bind mounts </etc/resolv.conf> from the host into the container.
|
||||||
--
|
--
|
||||||
-- This property is enabled by default. Revert it to disable it.
|
-- This property is enabled by default. Revert it to disable it.
|
||||||
resolvConfed :: RevertableProperty
|
resolvConfed :: RevertableProperty
|
||||||
|
|
Loading…
Reference in New Issue