Still a little confused.....
Can someone please point me in the right direction here, I"m not sure why
the linux tasks don't get executed.
##############################################################################
#
# promises.cf
#
##############################################################################
body common control
{
bundlesequence => {
"update",
"g"
};
inputs => {
"update.cf",
"cfengine_stdlib.cf",
"site.cf"
};
}
##############################################################################
#
# site.cf
#
##############################################################################
bundle common g
{
vars:
linux::
"bundlesequence_linux"
comment => "bundlesequence for linux hosts",
slist =>
{
"linux_tasks"
};
"linux_tasks"
comment => "tasks for linux hosts",
slist =>
{
"linux.cf"
};
}
##############################################################################
#
# linux.cf
#
##############################################################################
body common control
{
bundlesequence => { "hello_linux" };
}
bundle agent hello_linux
{
reports:
any::
"$(sys.date),Hello linux host"
report_to_file => "/tmp/linux.cf.out";
}
On Mon, Jan 17, 2011 at 1:06 AM, Brad Huntington <[email protected]>wrote:
> Thank you, this helps a lot.
>
>
> On Sun, Jan 16, 2011 at 9:13 PM, <[email protected]> wrote:
>
>> Forum: Cfengine Help
>> Subject: Re: importing tasks based on host group
>> Author: bbomgardner
>> Link to topic:
>> https://cfengine.com/forum/read.php?3,20138,20144#msg-20144
>>
>> One way to do this is to use methods. Here is some info from the reference
>> guide:
>> http://www.cfengine.org/manuals/cf3-reference.html#promises_002ecf
>>
>> http://www.cfengine.org/manuals/cf3-reference.html#methods-in-agent-promises
>>
>> Also, here is a good thread discussing this:
>> https://cfengine.com/forum/read.php?3,19120,19130
>>
>> I've found that Dan Klien's, er, method works well for me. =)
>> A practice example:
>>
>> body common control
>> {
>> bundlesequence => {
>> "blackout",
>> "global",
>> "cf_executor",
>> "cf_server",
>> "root_crontab",
>> "cf_tidy",
>> "resolv",
>> "machine_specific"
>> };
>>
>> inputs => {
>> "cf-execd.cf",
>> "cf-serverd.cf",
>> "cf-agent.cf",
>> "cf-monitord.cf",
>> "cf-report.cf",
>> "cfengine_stdlib.cf",
>> "library.cf",
>> "root_crontab.cf",
>> "isp.cf",
>> "resolv.cf",
>> "oracle.cf",
>> "dist_ftp.cf"
>> };
>>
>> }
>> #######################################################
>>
>> bundle agent machine_specific
>> {
>> vars:
>>
>> "isp_seq" slist => {
>> "isp_global",
>> "isp_jdk",
>> "isp_tomcat",
>> "isp_envs",
>> "isp_templates",
>> "isp_services"
>> };
>>
>> "dist_ftp_seq" slist => {
>> "dist_ftp_pkgs",
>> "dist_ftp_conf"
>> };
>>
>> methods:
>>
>> isp02|isp03::
>> "any" usebundle => "$(isp_seq)";
>>
>> ftp01::
>> "any" usebundle => "$(dist_ftp_seq)";
>>
>> oracle_servers::
>> "any" usebundle => "tnsnames";
>> }
>>
>> #######################################################
>>
>>
>>
>> Each policy file is imported on every host but not every bundle is
>> executed. The 'machine_specific' bundle listed in the bundlesequence is run
>> with the specific purpose of executing additional bundles as needed.
>>
>> Its certainly a little less straightforward than using import in v2, but
>> it works! I hope this helps you.
>>
>> _______________________________________________
>> Help-cfengine mailing list
>> [email protected]
>> https://cfengine.org/mailman/listinfo/help-cfengine
>>
>
>
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine