On Tue, 22 Feb 2005, Knut Auvor Grythe wrote:

On Wed, Feb 16, 2005 at 01:24:40PM +0100, Knut Auvor Grythe wrote:
What we would like to see, is an option in copy for using a custom parser,
like so:

copy:
    all::
        /path/to/sshd_config.m4
            dest=/etc/ssh/sshd_config
            parsecmd=/local/admin/bin/m4wrap

If we implemented this and submitted a patch, would it be accepted? We would really like this feature, but we do not wish to become dependent on local patches.



Chiming in late (and a newbie so everything I say could be wrong :)

Could you not move much of the "if newer, then build" logic into a
Makefile which then would call m4 as needed as the component parts are
updated?

If so then I think basically having a copy: section to fetch the m4 and
config bits from a central place to a configroot, then a shellcommand: to
run "make" in the directory which should regen all your files, and then
another copy: to copy from the configroot to live locations might do it.

I think the snippet would look something like this (again, newbie, so
please don't try this on something that matters :)

control:
        actionsequence = ( copy.fromrepo shellcommands copy shellcommands )

copy:
        fromrepo::
                $(remoteconfigroot)     dest=$(localconfigroot)
                                        server=$(server)
                                        define=genconf
                                        #blah
        tolive::
                /etc/somefile           dest=$(localconfigroot)
                                        define=restartServiceX
                # yaddah

# The docs are sparse on how define= works in a shellcommand, I'm assuming
# here that it means define if shellcommand returns 0 and that
# $(makewrapper) runs make in the right place and returns the right values :)
shellcommands:
        genconf::
                "$(makewrapper)" define=tolive
        restartServiceX::
                "$(initbase)/serviceX restart"

I theory, I think this will achive what you want with less klutz in the
conf file...

HTH (and if this is totally out of wack, somone please tell me!)

-n

--
-------------------------------------------
nathan hruby <[EMAIL PROTECTED]>
uga enterprise information technology services
production systems support
metaphysically wrinkle-free
-------------------------------------------


_______________________________________________ Help-cfengine mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-cfengine

Reply via email to