summaryrefslogtreecommitdiff
path: root/src/Propellor/Spin.hs
AgeCommit message (Collapse)Author
2019-04-03rename Propellor.Property.{PropellorRepo -> Localdir}Sean Whitton
This is to accommodate a new property in that module which is about /usr/local/propellor, but not only about the git repo there. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
2019-04-01Added Utility.FileMode to the modules exported by Propellor.UtilitiesJoey Hess
Since File.mode uses FileMode, it seems it ought to be exported by propellor somewhere. I don't want to make propellor Property modules themselves export core data types though, so this is a compromise of dubious utility.
2017-10-04override deploy url with PropellorRepo.hasOriginUrl infoJoey Hess
* Made the PropellorRepo.hasOriginUrl property override the repository url that --spin passes to a host. * PropellorRepo.hasOriginUrl type changed to include HasInfo. (API change) This commit was sponsored by Jake Vosloo on Patreon.
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-07-13finally really fixed HEAD problemJoey Hess
My first try with a pipe was the right approach, and was almost right, except I forgot to close the write end of the pipe, and so it was inherited by the forked process, leading to deadlock.
2017-07-13trying the pipe trick againJoey Hess
With some small changes, and debugging.
2017-07-13Revert "disable buffering earlier"Joey Hess
This reverts commit 632137836b39462883483a621f9dd696ce1d73cc. Still failing :( Seems that disabling buffering is not the solution.
2017-07-13disable buffering earlierJoey Hess
The "fatal: Couldn't find remote ref HEAD" persists, and is intermittent so hard to be sure but it seemed that disabling buffering earlier avoided it. Now done first thing on start. I was not able to find anything that reads from stdin other than getMarked, but perhaps there is something..
2017-07-12add bootstrapWith property to support stack and moreJoey Hess
* Hosts can be configured to build propellor using stack, by adding a property: & bootstrapWith (Robustly Stack) * Hosts can be configured to build propellor using cabal, but using only packages installed from the operating system. This will work on eg Debian: & bootstrapWith OSOnly propellor build its config using stack. (This does not affect how propellor is bootstrapped on a host by "propellor --spin host".) This has not yet been tested at all! But should probably work fine. This is based on earlier work by Arnaud Bailly, who made Propellor.Bootstrap use stack without parameterization. In Arnaud's patch, stack was installed using wget, but that only worked on linux-x86_64 and was insecure. I instead chose to use the distribution packages of stack, like is done for cabal. Debian stack has haskell-stack now, and it's getting into many distributions. This commit was sponsored by Francois Marier on Patreon.
2017-06-18my pipe trick didn't work; fallback to NoBufferingJoey Hess
Not sure what the problem was, but it hung. Also though, I noticed that stdin was still open when git fetch was run, so if git fetch itself decided to read from stdin, it would mess up the protocol forwarding. While git fetch should never read from stdin, that was reason enough to fall back to plan B.
2017-06-18Fix bug that sometimes made --spin fail with "fatal: Couldn't find remote ↵Joey Hess
ref HEAD" Tricky stdin buffering problem. An easier fix would have been: hSetBuffering stdin NoBuffering But that approach is less robust; even with NoBuffering, anything that uses hLookAhead causes 1 byte of buffering. And, any reads from stdin before hSetBuffering would still cause the problem. Instead, I used a bigger hammer that will always work. It involves a bit more CPU work, but this is data that is already being fed through ssh; copying it one more time won't cause a measurable performance impact. This commit was sponsored by Jack Hill on Patreon.
2017-06-18remove unnecessary binary mode settingJoey Hess
This is using ByteString, so the handle IO discipline is irrelevant.
2017-04-09avoid call stackJoey Hess
2017-02-26convert fromIPAddr to valJoey Hess
2016-03-30indentJoey Hess
2016-03-26ported propagateContainerJoey Hess
Renamed several utility functions along the way.
2016-03-08fix reversion in bootstrap spin of system with no declared OSJoey Hess
The freebsd changes caused a bootstrap of a system with no declared OS to not work, where before it was assumed to be some debian-like system where apt can be used. Brought back this assumption.
2016-03-07make Cron.runPropellor pass System to bootstrapPropellorCommandJoey Hess
Rather than having the property fail when the Host has no OS defined, I made bootstrapPropellorCommand not install deps in this situation. The cron job will (probably) still work, unless a system upgrade causes deps to be removed.
2016-03-07Merge remote-tracking branch 'remotes/misandrist/FreeBSD' into wipJoey Hess
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-03-06Force ssh, scp, and git commands to be run in the foreground.Joey Hess
Before, they could run in the background if another process was running, and so their output wouldn't immediately be visible. With this change, the concurrent-output layer is not used for these interactive commands.
2016-03-06propellor spinJoey Hess
2016-03-06propellor spinJoey Hess
2016-03-06propellor spinJoey Hess
2016-03-06stop using --continue SimpleRun for spinJoey Hess
When spinning a remote host, we do want to rebuild propellor on it, and this use of --continue that did a rebuild was different from all the other uses of --continue that avoided a rebuild. This fixes a build loop involving that special case. When --continue SimpleRun ran a rebuild, it re-execed propellor with --continue SimpleRun, and so would rebuild again, and re-exec again if the binary kept changing. Backwards compatability should be ok; old versions of propellor, when run with --serialized SimpleRun by the new version, do a buildFirst, followed by another (redundant) buildFirst, and then run. The one redundant buildFirst is not a problem in the upgrade scenario. (Unfortunately, I can't rename SimpleRun to something nicer despite only spin using it; backwards compatability does prevent that.)
2016-01-03refactor into smaller modules to untangle git and gpg modulesJoey Hess
2015-12-08tweak wrong spin branch error messageSean Whitton
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name> (cherry picked from commit 9d44dcd39bb88408ed4cfc94a7b4dfa34a1b5591)
2015-12-08implement two pre-spin safety checksSean Whitton
- check that we're on the branch specified in git config value propellor.spin-branch - check that there are no uncommitted changes if git config value propellor.forbid-dirty-spin is true Signed-off-by: Sean Whitton <spwhitton@spwhitton.name> (cherry picked from commit 8f374d73ae5b2bb53f82835c6d6b5c0194590006)
2015-11-01run editor processes in foregroundJoey Hess
2015-11-01a few tweaks for concurrent outputJoey Hess
Force console mode when --spin calls SimpleRun
2015-11-01Revert "propellor spin"Joey Hess
This reverts commit 2891006d9f18b9f50b7d8dfc6d32e326499913f0.
2015-11-01propellor spinJoey Hess
2015-10-28propellor spinJoey Hess
2015-10-28use outputConcurrent interfaceJoey Hess
This interface will fix the current deadlock when a process is running and the thread that ran it wants to output to the console. The locking and buffering is not implemented yet.
2015-10-28remove debugJoey Hess
Found problem.. actionMessage is blocking.
2015-10-28propellor spinJoey Hess
2015-10-28propellor spinJoey Hess
2015-10-28propellor spinJoey Hess
2015-10-20refactorJoey Hess
2015-10-20simplify privdata propigation to spin from controllerJoey Hess
2015-10-20privdata propigation for Spin.controllerJoey Hess
Controlling host inherits the privdata for the host it spins, and sends it along to that host.
2015-10-17use Info to detect controller loopsJoey Hess
Much less invasive than the other implementation.
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-10-10propellor spinJoey Hess
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-07-30Work around broken git pull option parser in git 2.5.0, which broke use of ↵Joey Hess
--upload-pack to send a git push when running propellor --spin.
2015-05-30revert testJoey Hess
2015-05-30propellor spinJoey Hess
2015-05-30--spin now works when given a short hostname that only resolves to an ipv6 ↵Joey Hess
address.