| Age | Commit message (Collapse) | Author |
|
|
|
|
|
When provisioning a container, output was buffered until the whole process
was done; now output will be displayed immediately.
I know this didn't used to be a problem. I belive it was introduced by
accident when propellor started using concurrent-output. I know I've seen
it for a while and never was bothered enough to get to the bottom of it;
apparently "a while" was longer than I thought.
Also refactored code to do with chain provisioning to all be in
Propellor.Engine and avoided some duplication.
This commit was sponsored by Anthony DeRobertis on Patreon.
|
|
* Property types changed to use a Maybe (Propellor Result). (API change)
* When Nothing needs to be done to ensure a property, propellor
will avoid displaying its description at all. The doNothing property
is an example of such a property.
This is mostly in preparation for Monoid instances for Property types, but
is's also nice that anything that uses doNothing will avoid printing out
any message at all. At least, I think it probably is. It might potentially
be confusing for something that sometimes takes an action and sometimes
resolves to doNothing and in either case has a description set to not
always show the description. If this did turn out to be confusing, the
change to doNothing could be reverted.
This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.
|
|
It's now exporting a conflicting isSymbolicLink
https://github.com/haskell/directory/issues/52
Only a few places in propellor use isSymbolicLink, but to prevent future
problems, made as much of it as possible import Utility.Directory, which
re-exports System.Directory without the conflicting symbol.
(Utility.Tmp and System.Console.Concurrent.Internal cannot import
Utility.Directory due to cycles, and don't use isSymbolicLink anyway.)
|
|
|
|
and note that it's not meant to be used by regular users
|
|
|
|
I wanted to keep propertyList [foo, bar] working, but had some difficulty
making the type class approach work. Anyway, that's unlikely to be useful,
since foo and bar probably have different types, or could easiy have their
types updated breaking it.
|
|
|
|
|
|
Import Prelude after modules that cause warnings due to AMP change
|
|
Not yet handled: Output from concurrent programs.
|
|
|
|
|
|
Much less invasive than the other implementation.
|
|
* 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.
|
|
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)
|
|
|
|
|
|
* 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.
|
|
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!
|
|
Not yet used
|
|
|
|
|
|
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.
|
|
|
|
where Info is correctly propigated. Better approach needed.
|
|
|
|
and is so prevented from propigating it.
Would much rather a type-based fixed, but this is all I have for now.
|
|
|
|
|
|
successfully run on a host.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Lock a lock file while provisioning inside, otherwise propellor could be
running to init the container when the system has just booted, or the
container was just started from being stopped, and at the same time,
propellor run outside the container chains into it to provision.
Previously, simplesh prevented this in a different way.
|
|
|
|
|
|
|
|
|
|
|
|
The SetAttr hack used to be needed because the hostname was part of the
Attr, and was required to be present. Now that it's moved to Host, let's
get rid of that, since it tended to waste CPU.
|
|
|
|
|
|
Now that Host includes _hostName, it's redundant to also keep it in Attr.
This requires changing the reader monad to operate on the whole Host.
|