I don't see a variable to get the current bundle name, maybe I missed it?

I have a pattern that I am using for managing interface configuration
files on redhat. I use a seperate bundle for each node that I want to do
this on and I have to change the global reference for the array storing
the config each time i add a new node.

Here is an example, note how I have to replace "node_specific_bundlename".

bundle agent node_specific_bundlename {

vars:
    interfaces slist => { "eth0" },
        comment => "These are the interfaces we want to manage";

    "eth0[DEVICE]"      string => "eth0";
    "eth0[BOOTPROTO]"   string  => "none"
    "eth0[ONBOOT]"      string  => "yes";
    "eth0[IPADDR]"      string  => "192.168.35.11";
    "eth0[NETMASK]"     string  => "255.255.255.0";

    "eth1[DEVICE]"      string  => "eth1";
    "eth1[BOOTPROTO]"   string  => "none";
    "eth1[ONBOOT]"      string  => "yes";
    "eth1[IPADDR]"      string  => "172.16.210.65";
    "eth1[NETMASK]"     string  => "255.255.255.192";

files:


    "/etc/sysconfig/network-scripts/ifcfg-$(interfaces)"
        comment         => "Configure interface for persistance"
        edit_defaults   => no_backup,
        create          => "true",
        perms           => mog("644", "root", "root"),
        edit_line       => set_variable_values2("$(this.promiser)",
"node_specific_bundlename.$(interfaces)"),
        classes         => if_repaired("ifupdown_$(interfaces)");

}
-- 
Nick Anderson <n...@cmdln.org>
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to