Todd Erwin <toddw...@gmail.com> writes:
> Is there a way in CFEngine to Dynamically assign a NEW promises.cf across
> your compute farm say over 8 Hours? IF I open up a window for a host to
> get the NEW file, once that window has closed they will go back and get the
> OLD file and thus revert back the version of VAS. Hopefully what im asking
> for is clear if not please feel free to ask further questions.
Hi Todd,
It sounds to me like you are describing dynamic inputs. I would probably look to use body file control to achieve it. Note you can use body file control inside any policy file, so you can include one policy file from another without touching promises.cf itself.
bundle common vas_classification
{
vars:
any::
"version" string => "1.0"; # the default version of policy to use
host001.Afternoon::
"version" string => "2.0"; # host 1 uses version 2 during the afternoon.
host002.Morning::
"version" string => "3.0"; # Host 2 uses version 3 during the Morning
any::
"inputs" slist => { "/var/cfengine/packages/$(version)/vas.cf" };
}
body file control
{
inputs => { @(vas_classification.inputs) };
}
bundle agent main
{
methods:
"Vas Classification"
usebundle => vas_classification;
"VAS"
usebundle => vas( "vas", $(vas_classification.version) );
}
You explicitly mentioned a NEW promises.cf for different subsets of
infrastructure. For that you can configure `execcommand` in body executor
control. The default MPF uses different exec<sub>commands</sub> for different platforms
but you could use it with your own classes. Note your custom classes would have
be be derived very early in order to be able to use them to effect the behaviour
of execd.
body executor control
{
host001.Afternoon::
execcommand => "$(sys.workdir/bin/cf-agent -f update.cf; $(sys.workdir)/bin/cf-agent -f /var/cfengine/differnt-inputs/promises.cf";
}
Does that make sense?
–
Nick Anderson
Doer of things, CFEngine
--
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to help-cfengine+unsubscribe@googlegroups.com.
To post to this group, send email to help-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/help-cfengine.
For more options, visit https://groups.google.com/d/optout.
So My problem with this is what happens to host002 that Evening when it's no longer assigned to host002.afternoon? It reverts back to the 1.0 version File control copies in the 1.0 version and im back to having that machine at version 1.0?