Hello,

I'm happy to see that we can use included vars since svn 990[1], one
thing remains, this is sensible to inputs ordering, the following
example will not work and should be documented.

I looked at docs/cf3-Reference.texinfo and docs/cf3-reference.html but
they are not up to date with the on line version (no note for "inputs in
common"[2], nothing about "ignore_missing_inputs in common"[3]) so no
patch possible.

## promises.cf
body common control
{
    bundlesequence => { "base", @(test.bundles) };
    inputs => {@(test.inputs), "test.cf" };
}

bundle agent base
{
reports:

    debian::
        "In base";

}

## test.cf
bundle common test
{
vars:

    any::
        "bundles" slist => { "test", @(test2.bundles) };
        "inputs" slist => { "test2.cf", @(test2.inputs) };
}

bundle agent test
{
reports:

    debian::
        "In test";

}

## test2.cf
bundle common test2
{
vars:

    any::
        "bundles" slist => { "test2" };
        "inputs" slist => {};
}

bundle agent test2
{

reports:

    debian::
        "In test2";

}

I'm asking for comments about "generalising" inputs and bundlesequence:
making them "localised" to bundles.

If a team is responsible for an area of the configuration, they provide
an entry point into their configuration and document the "activation"
classes. they completely manage their tree and their inputs and
bundlesequences.

For example:

A team is responsible of web applications, they manage the web server
configuration and the applications, their tree is under
inputs/services/web-apps/.

If the team, responsible of managing a site, wants to enable dokuwiki on
the host wiki.site1.example.com, they just need to define the dokuwiki
class, provided by the web-apps team, for this particular host.

This class may be used in inputs/services/web-apps/applications.cf,
itself included by inputs/services/web-apps/main.cf which is the
web-apps entry point.

This applications.cf can do what ever it wants to fulfil the promise of
installing and managing dokuwiki.

So, the team responsible of services, delegate the responsibility of web
applications to another one, the services team provides a
inputs/services/main.cf as an entry point to the rest of the world
(like sites teams).

Now, with the commit 990, the services team need to define 2 variables
like:
- "bundles" slist => {"whatever", @(web-apps.bundles};
- "inputs" slist => {"services/web-apps/main.cf", @(web-apps.inputs)};

The core team, obviously, needs to define something like:
- bundlesequence => {"update", "main", @(services.bundles);
- inputs => {"update.cf", "main.cf", "library.cf", "services/main.cf", 
@(services.inputs)};

This works, but seems more fragile to me.

What do you this about this idea?

Regards.

Footnotes: 
[1]  https://cfengine.com/bugtracker/view.php?id=135

[2]  http://www.cfengine.org/manuals/cf3-3.0.4.html#inputs-in-common

[3]  
http://www.cfengine.org/manuals/cf3-3.0.4.html#ignore_005fmissing_005finputs-in-common

-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1

Attachment: pgpvuoviU5feC.pgp
Description: PGP signature

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to