summaryrefslogtreecommitdiff
path: root/src/Propellor/Info.hs
AgeCommit message (Collapse)Author
2019-07-16update from Stable "stretch" to Stable "buster" in some examplesJoey Hess
2019-04-08change from inChroot to granular container capabilities infoJoey Hess
* Removed inChroot, instead use hasContainerCapability FilesystemContained. (API change) * Hostname: Properties that used to not do anything in a systemd or docker container will now change the container's hostname, since it's namespaced. More container capabilities can easily be added later, to fine grain control what properties will run in different kinds of containers. This changed CmdLine's Read instance, which should be ok, because propellor inside the container is always updated at the same time as propellor outside, so when it chains into the chroot, it will know to expect the capability list. Docker was not setting InChroot before, but now sets both container capabilities, so chroot setting will also work in it. Note that, things that used to check inChroot before would not work in docker, but things that check FilesystemContained now will. It may be that some of those properties don't really work properly in docker. And, Grub.installed used to run grub-mkconfig in a docker container before, I doubt that made sense (was it even safe?); it doesn't do it now. This commit was sponsored by Trenton Cronholm on Patreon.
2017-10-25fix build warningsJoey Hess
2017-10-04avoid propagating non-alias DNS info from container to hostJoey Hess
* When the ipv4 and ipv6 properties are used with a container, avoid propagating the address out to the host. * DnsInfo has been replaced with DnsInfoPropagated and DnsInfoUnpropagated. (API change) * Code that used fromDnsInfo . fromInfo changes to use getDnsInfo. * addDNS takes an additional Bool parameter to control whether the DNS info should propagate out of containers. (API change) This commit was sponsored by Trenton Cronholm on Patreon.
2017-06-17use stretch in debian stable examplesJoey Hess
2017-02-03add types for Arch LinuxZihao Wang
Signed-off-by: Zihao Wang <dev@wzhd.org>
2016-11-11turn off redundant constraints warnings in cabal fileJoey Hess
ghc 7 does not support -fno-warn-redundant-constraints so this can't be done on a per-module basis. It would be good to revert this commit when dropping support for ghc 7.
2016-11-11Clean up build warnings about redundant constraints when built with ghc 8.0.Joey Hess
Only a couple of the constraints were really redundant. The rest are essential to propellor's tracking of Info propigation, so I silenced the warning for those. It would be better to only silence the warning for the functions with the extra constraints, but IIRC warnings can only be silenced on an entire file basis. This commit was sponsored by Andreas on Patreon.
2016-06-13improve haddockJoey Hess
(cherry picked from commit ee1f24f5cc31c3d3524b43a74b16acae1c3a4ee4)
2016-06-13add DebianKernel datatypeFélix Sipma
(cherry picked from commit 3590a1241580ddcdd153e2619a3c02ce18a8db8c but without the changes to src/Propellor/Precompiled.hs)
2016-06-13convert Architecture to a sumtypeFélix Sipma
TODO: remove ANDROID (used in GitAnnexBuilder) TODO: add other architectures TODO: rename ARMHF TODO: rename ARMEL (cherry picked from commit 6f36f6cade4e1d8b15c714565e223562c6573099)
2016-03-27improve haddocks and move code around to make them more clearJoey Hess
2016-03-26ported propagateContainerJoey Hess
Renamed several utility functions along the way.
2016-03-26remove `os` propertyJoey Hess
The new properties let the type checker know what the target OS is.
2016-03-24refactorJoey Hess
2016-03-24converted Propellor.InfoJoey Hess
2016-01-03Fix typo: indidate -> indicate.Jelmer Vernooij
2015-12-19Clean build with ghc 7.10.Joey Hess
Import Prelude after modules that cause warnings due to AMP change
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-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-13Follow some hlint suggestions.Mario Lang
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-09-02docsJoey Hess
2015-01-24GADT properties seem to work (untested)Joey Hess
* Property has been converted to a GADT, and will be Property NoInfo or Property HasInfo. This was done to make sure that ensureProperty is only used on properties that do not have Info. Transition guide: - Change all "Property" to "Property NoInfo" or "Property WithInfo" (The compiler can tell you if you got it wrong!) - To construct a RevertableProperty, it is useful to use the new (<!>) operator - Constructing a list of properties can be problimatic, since Property NoInto and Property WithInfo are different types and cannot appear in the same list. To deal with this, "props" has been added, and can built up a list of properties of different types, using the same (&) and (!) operators that are used to build up a host's properties.
2015-01-24moving to using the GADTJoey Hess
The problem this exposes has to do with requires. As implemented, requires yields either a Property HasInfo or a Property NoInfo depending on its inputs. That works. But look what happens when it's used: *Propellor.Types> let foo = IProperty "foo" (return NoChange) mempty mempty *Propellor.Types> let bar = IProperty "bar" (return NoChange) mempty mempty *Propellor.Types> foo `requires` bar <interactive>:17:5: No instance for (Requires (Property HasInfo) (Property HasInfo) r0) arising from a use of `requires' The type variable `r0' is ambiguous Possible fix: add a type signature that fixes these type variable(s) Note: there is a potential instance available: instance Requires (Property HasInfo) (Property HasInfo) (Property HasInfo) -- Defined at Propellor/Types.hs:167:10 Possible fix: add an instance declaration for (Requires (Property HasInfo) (Property HasInfo) r0) In the expression: foo `requires` bar In an equation for `it': it = foo `requires` bar This can be avoided by specifying the result type: *Propellor.Types> (foo `requires` bar) :: Property HasInfo property "foo" But then when multiple `requires` are given, the result type has to be given each time: *Propellor.Types> (foo `requires` bar `requires` bar) :: Property HasInfo <interactive>:22:6: No instance for (Requires (Property HasInfo) (Property HasInfo) x0) arising from a use of `requires' The type variable `x0' is ambiguous Possible fix: add a type signature that fixes these type variable(s) Note: there is a potential instance available: instance Requires (Property HasInfo) (Property HasInfo) (Property HasInfo) -- Defined at Propellor/Types.hs:167:10 Possible fix: add an instance declaration for (Requires (Property HasInfo) (Property HasInfo) x0) In the first argument of `requires', namely `foo `requires` bar' In the expression: (foo `requires` bar `requires` bar) :: Property HasInfo In an equation for `it': it = (foo `requires` bar `requires` bar) :: Property HasInfo <interactive>:22:21: No instance for (Requires x0 (Property HasInfo) (Property HasInfo)) arising from a use of `requires' The type variable `x0' is ambiguous Possible fix: add a type signature that fixes these type variable(s) Note: there are several potential instances: instance Requires (Property NoInfo) (Property HasInfo) (Property HasInfo) -- Defined at Propellor/Types.hs:175:10 instance Requires (Property HasInfo) (Property HasInfo) (Property HasInfo) -- Defined at Propellor/Types.hs:167:10 Possible fix: add an instance declaration for (Requires x0 (Property HasInfo) (Property HasInfo)) In the expression: (foo `requires` bar `requires` bar) :: Property HasInfo In an equation for `it': it = (foo `requires` bar `requires` bar) :: Property HasInfo *Propellor.Types> (((foo `requires` bar) :: Property HasInfo) `requires` bar) :: Property HasInfo property "foo" Yuggh!
2015-01-24added GADT to determine between a property with info and withoutJoey Hess
Not yet used
2015-01-19split out types to improve haddock for Propellor.TypesJoey Hess
2015-01-18Property treeJoey Hess
Properties now form a tree, instead of the flat list used before. This simplifies propigation of Info from the Properties used inside a container to the outer host; the Property that docks the container on the host can just have as child properties all the inner Properties, and their Info can then be gathered recursively. (Although in practice it still needs to be filtered, since not all Info should propigate out of a container.) Note that there is no change to how Properties are actually satisfied. Just because a Property lists some child properties, this does not mean they always have their propertySatisfy actions run. It's still up to the parent property to run those actions. That's necessary so that a container's properties can be satisfied inside it, not outside. It also allows property combinators to add the combined Properties to their childProperties list, even if, like onChange, they don't always run the child properties at all. Testing: I tested that the exact same Info is calculated before and after this change, for every Host in my config file.
2015-01-04DNS records for hosts with known ssh public keys now automatically include ↵Joey Hess
SSHFP records.
2015-01-04sshPubKey is renamed to Ssh.pubKeyJoey Hess
2015-01-04add $INCLUDE of pubkeys before zone file is written, to avoid pogoingJoey Hess
2015-01-04propellor spinJoey Hess
2015-01-04DNS WIPJoey Hess
2015-01-01update docsJoey Hess
2014-11-20fix docker container provisioningJoey Hess
Since the containers are no longer on the host list, they were not found while provisioning, oops. To fix, had to add to a host's info a map of the containers docked to it. Unfortunately, that required Propellor.Types.Info be glommed into Propellor.Types, since it needed to refer to Host.
2014-10-23Fix loop when a docker host that does not exist was docked.Joey Hess
The problem is it fell back to looking for an alias for the bad hostname, but to get the aliases, it needs to know which hosts are docked where, so looped.
2014-07-23propellor spinJoey Hess
2014-07-23propellor spinJoey Hess
2014-06-09Attr is renamed to Info.Joey Hess