summaryrefslogtreecommitdiff
path: root/src/Propellor/Types
AgeCommit message (Collapse)Author
2016-03-17wipJoey Hess
2016-03-17commentsJoey Hess
2016-03-17add OuterTargetJoey Hess
Separate data type to guarantee that ensureProperty is passed the actual outer target, and not some other Targeting value from eg, unixLike.
2016-03-17let's not try to get outertarget from monadJoey Hess
To get outertarget from the Propellor monad, the monad would have to be parameteriszed with an outertarget type, since there's no single type. For example: newtype Propellor target p = Propellor { runWithHost :: RWST target () () IO p } deriving (Monad, Applicative, Functor) But then mkProperty becomes a problem, since the Propellor action passed to it needs to already be of UnixLike type: mkProperty :: Propellor UnixLike () -> Property UnixLike mkProperty a = Property unixLike a Could maybe live with that, but then `target` type check fails: Expected type: Propellor (Targeting combinedtarget) () Actual type: Propellor (Targeting oldtarget) () Problem being that it's reusing the `a` which is a Propellor target () target newtarget (Property oldtarget a) = Property (intersectTarget oldtarget newtarget) a And, the new Property has a different target, so it can't use the old `a`. So, I'd need a way to cast one Propellor target () to a different target. Maybe: target newtarget (Property oldtarget (Propellor a)) = let combinedtarget = intersectTarget oldtarget newtarget in Property combinedtarget (Propellor (unsafeCoerce a)) But is that safe?? Even if it is, I can't see how to make ensureProperty get the outertarget type. It returns Propellor (Targeting outertarget) (), which can read the target from the RWST monad, but how to use that where the type of the function is defined? Rather than all that complication, it doesn't seem too bad to require outertarget be passed to ensureProperty.
2016-03-16wipJoey Hess
2016-03-16wipJoey Hess
2016-03-11fix ensureProperty superset checkingJoey Hess
2016-03-09note bugJoey Hess
2016-03-09improveJoey Hess
2016-03-09rename to TargetJoey Hess
2016-03-09added protype of ensureProperty that prevents running properties in the wrong OSJoey Hess
2016-03-08backported to ghc 7.6.3Joey Hess
Works on debian stable!
2016-03-08simplifyJoey Hess
2016-03-08make it a type error to intersect two OS lists if the result is emptyJoey Hess
2016-03-08fixed it!Joey Hess
2016-03-08simplfyJoey Hess
2016-03-08initial type-level OS listJoey Hess
2016-03-07Merge remote-tracking branch 'remotes/misandrist/FreeBSD' into wipJoey Hess
2016-03-07add fromPort functionFélix Sipma
(cherry picked from commit c3a23f89092d1ef8367c37ab8993ea7031124f4b)
2016-03-07FreeBSD Support including:Evan Cofsky
- Propellor bootstrapping - Basic pkg - Basic ZFS datasets and properties - Simple Poudriere configuration (regular and ZFS) - Poudriere jail creation FIXME: - Cron.hs: runPropellor needs the System, but hasn't yet gotten it. Reorganizing: - Remove FreeBSD.Process - Move ZFS up to Property - Add Info for Pkg.update/Pkg.upgrade - Move FreeBSD.md to doc so it'll show up automatically. - Merge the FreeBSD config with the other sample config. - Use Info to check Pkg updated/upgraded and Poudriere configured. - Warnings clean-up, move ZFS types to Propellor.Types. - Maintainer and license statements.
2016-02-25FooBuntu -> BuntishJoey Hess
Seems that Canonical have trademarked numerous words ending in "buntu", and would like to trademark anything ending in that to the extent their lawyers can make that happen.
2016-02-19trademark nonsenseJoey Hess
Removed references to *buntu from code and documentation because of an unfortunate trademark use policy. http://joeyh.name/blog/entry/trademark_nonsense/ That included changing a data constructor to "FooBuntu", an API change.
2016-02-02Fix (->-) signature in Propellor.Types.ContainerLeonardo Taglialegne
2015-12-19Clean build with ghc 7.10.Joey Hess
Import Prelude after modules that cause warnings due to AMP change
2015-12-06allow using `check` on a UncheckedProperty, which yields a PropertyJoey Hess
2015-12-05typoJoey Hess
2015-12-05remove trivialJoey Hess
2015-12-05UncheckedProperty for cmdProperty et alJoey Hess
* Properties that run an arbitrary command, such as cmdProperty and scriptProperty are converted to use UncheckedProperty, since they cannot tell on their own if the command truely made a change or not. (API Change) Transition guide: - When GHC complains about an UncheckedProperty, add: `assume` MadeChange - Since these properties used to always return MadeChange, that change is always safe to make. - Or, if you know that the command should modifiy a file, use: `changesFile` filename * A few properties have had their Result improved, for example Apt.buldDep and Apt.autoRemove now check if a change was made or not.
2015-12-05Added UncheckedProperty type, along with unchecked to indicate a Property ↵Joey Hess
needs its result checked, and checkResult and changesFile to check for changes.
2015-10-19simplify using type safe castJoey Hess
2015-10-19improve Info type using GADT, at nomeata's suggestionJoey Hess
This makes Show Info work, and simplifies the implementation.
2015-10-18fix typo: propigate → propagateFelix Gruber
2015-10-17use Info to detect controller loopsJoey Hess
Much less invasive than the other implementation.
2015-10-17newtype info allows deriving monoidJoey Hess
2015-10-16Added --unset-unusedJoey Hess
2015-10-16improve ssh user key propertiesJoey Hess
* Ssh.keyImported is replaced with Ssh.userKeys. (API change) The new property only gets the private key from the privdata; the public key is provided as a parameter, and so is available as Info that other properties can use. * Ssh.keyImported' is renamed to Ssh.userKeyAt, and also changed to only import the private key from the privdata. (API change) * While Ssh.keyImported and Ssh.keyImported' avoided updating existing keys, the new Ssh.userKeys and Ssh.userKeyAt properties will always update out of date key files. * Ssh.pubKey renamed to Ssh.hostPubKey. (API change) This makes eg, setting up ssh for spin controllers work better.
2015-10-16Added Propellor.Property.Spin, which can be used to make a host be a ↵Joey Hess
controller of other hosts. The hard part of this is avoiding loops of controllers. To make that work, a ControllerChain is passed to the host that's spun, and is added to the Info of the host being spun, where the controller property can check it to detect an avoid a loop. That needed an expansion of the CmdLine data type. I made the new ControlledRun only be used when there is a ControllerChain provided. This avoids breaking backwards compatability with old propellor deployments, as --spin still uses SimpleRun. Note: Making an old propellor deployment be controlled by a controller won't work until it's been updated to this commit, so it knows about the ControlledRun parameter. (Untested)
2015-09-30change HostContext for containersJoey Hess
Privdata that uses HostContext inside a container will now have the name of the container as its context, rather than the name of the host(s) where the container is used. This allows eg, having different passwords for a user in different containers. Note that previously, propellor would prompt using the container name as the context, but not actually use privdata using that context; so this is a bug fix. I don't entirely like the implementation; I had to put the code to change the context in PropAccum, and it's not generalized past PrivInfo.
2015-09-23Added --rm-key.Joey Hess
2015-09-16Types.Dns: simplify canonicalGroupFélix Sipma
Signed-off-by: Félix Sipma <felix.sipma@no-log.org>
2015-09-15documentationJoey Hess
2015-09-15add PTR record type to Propellor.Types.DNS.RecordFélix Sipma
- add canonicalIP and reverseIP to Propellor.Types.Dns - remove corresponding canonical and revIP from Propellor.Property.Unbound - Propellor.Property.Dns: convert rValue, rField and genRecord to return Maybe String Signed-off-by: Félix Sipma <felix.sipma@no-log.org>
2015-09-14Allow storing arbitrary ByteStrings in PrivData, extracted using ↵Joey Hess
privDataByteString.
2015-09-14clean up privdata excess/lacking newline issueJoey Hess
* PrivData converted to newtype (API change). * Stopped stripping trailing newlines when setting PrivData; this was previously done to avoid mistakes when pasting eg passwords with an unwanted newline. Instead, PrivData consumers should use either privDataLines or privDataVal, to extract respectively lines or a value (without internal newlines) from PrivData.
2015-09-13Follow some hlint suggestions.Mario Lang
2015-09-08better Show for InfoJoey Hess
2015-09-06Added Propellor.Property.Rsync. WIP; untestedJoey Hess
Convert Info to use Data.Dynamic, so properties can export and consume info of any type that is Typeable and a Monoid, including data types private to a module. (API change) Thanks to Joachim Breitner for the idea.
2015-06-29Added --unset to delete a privdata field.Joey Hess
2015-06-01add BoundJoey Hess
2015-06-01reorganize Port type for systemd can use itJoey Hess