On Fri, May 6, 2011 at 1:24 PM, Jerome Baum <jer...@jeromebaum.com> wrote:
> I am still worried whether cfengine is the right tool for this. It's not
> that I want to keep bringing the system into the "database has exactly
> <dump> as its content" state -- I just initially want to get it there. So, I
> am trying to converge to any of a set of states, and the dump would bring us
> to one of those. From that viewpoint, is cfengine "right" for the job? So I
> am thinking:
> states: A, B1, B2, B3, ...
> Initially I am in state A. I want to get into any Bx state. I know a
> transition A --> B9, and I will apply it whenever in state A. But when in
> state Bx where x != 9, I will not apply it.
> Does that make sense?

I'd split this into the following issues:

1.  How to ascertain current state X
2.  How to ascertain desired state Y
3.  How to get from state X to state Y, for some set of (X,Y) options
4.  How to pick an appropriate option from #3
5.  How to deploy the code for #1, #2, #3, #4
6.  How to invoke the code for #1, #2, #3, #4

cfengine offers answers for #5 and #6;

You'll almost certainly need something pretty customized to your
environment for #1-#4.

Whether you use cfengine or something else for #5 or #6 changes very
little about how you'd handle #1-#4.

Does that seem like an appropriate separation of concerns?  I think it
does, and I think this decomposition allows you to keep the
complexities in your outside-of-cfengine analysis of (1-4), and then
just use cfengine to deploy and run the code that happens to do the
work.

It would be *conceivable* to put "smarts" into cfengine as to what
version of a schema is in place, and have the transformation rules
directly encoded inside cfengine, but it is by no means obvious that
this is the best way to do things, particularly if there are extra
semantics surrounding the conversion.  (e.g. - suppose there are data
transformations that require planning a system outage.)

It's still perfectly reasonable to use cfengine to push the code into
place, but it might well be that it's the "helper" that merely puts
things in convenient spots so that a human can then come in and have
the environment pre-prepared to efficiently do some "human
activities."

I've done that with database version upgrades, for instance.  We'd put
binaries for a new version of Postgres onto a "golden server," a
couple days before the upgrade, and the binaries would get copied into
place, but be unused.  During an outage, a database administrator
would log in, change symlinks (using cfengine, as it happens :-)), and
induce the upgrade manually, at the appointed time. The admins only
needed to do a pretty minimal amount of "human work."
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to