Bundle common g

From PostgreSQL_wiki
Jump to: navigation, search

The file promises.cf contains the bundle g, among other things. It simply does not work if the bundle is placed in a separate file, because the daemons seem not to be able to handle such a situation.
Dynamic CFEngine3 requires some sort of wildcard select, this is done by using find in an execresult.

###############################################################################
#   
# Webhuis bundle common g
#
# Copyright (C) 2008 Martin Simons, Webhuis. Renkum The Netherlands
# This source code is licensed under the GNU General Public License, Version 2.
# See http://webhuis.nl/GPL-license for more details.
#
###############################################################################
bundle common g {

vars:

    "acl"                slist => { "10.*" };
    "workdir"           string => "/var/cfengine";
    "master_location"   string => "/var/cfengine/masterfiles";
    "master_roles"      string => "/var/cfengine/webhuis/roles";
    "master_templates"  string => "/var/cfengine/webhuis/templates";
    "master_domain"     string => "/var/cfengine/webhuis/domains";
    "master_host"       string => "/var/cfengine/webhuis/hosts";
    "master_components" string => "/var/cfengine/webhuis/components";
    "master_packages"   string => "/var/cfengine/webhuis/packages";
    "dir_bin"           string => "/var/cfengine/bin";
    "dir_modules"       string => "/var/cfengine/bin";
    "inputfiles"        string => "/var/cfengine/inputs";
    "policyhost"        string => "cfengine.webhuis.nl";
    "class_domain"      string => canonify("$(sys.domain)");
    "class_host"        string => canonify("$(sys.uqhost)");
    "role"              string => "${role.role}";

    "etc_exports"       string => "/etc/exports";
    "exports_ro"        string => "(ro,sync,root_squash,no_subtree_check)";
    "exports_rw"        string => "(rw,sync,root_squash,no_subtree_check)";
    "nfs_ro"            string => "ro,soft,intr,noatime,nodiratime 0 0";
    "nfs_rw"            string => "rw,soft,intr,noatime,nodiratime 0 0";
    "os_inputs"          slist => splitstring(execresult("/usr/bin/find ${workdir}/inputs/os/ -name '*.cf'","noshell"),"\n","99");
    "common_inputs"      slist => splitstring(execresult("/usr/bin/find ${workdir}/inputs/webhuis-common/ -name '*.cf'","noshell"),"\n","99");
    "host_inputs"        slist => splitstring(execresult("/usr/bin/find ${workdir}/inputs-webhuis/ -name '*.cf'","noshell"),"\n","99");
    "component_inputs"   slist => splitstring(execresult("/usr/bin/find ${workdir}/inputs-webhuis/components/ -name '*.cf'","noshell"),"\n","99");
    "component_master"   slist => maplist("/var/cfengine/webhuis/components/$(this)", "${role.role}.input");
    "host"              string => "${sys.uqhost}";
    "ip_address"        string => "${sys.ipv4[$(sys.interface)]}";

}

Return to: Dynamic_Cfengine3