Recent Changes - Search:

Softwares

.

Example-CFEngine-policy-server-and-client

Main.Example-CFEngine-policy-server-and-client History

Hide minor edits - Show changes to output

July 28, 2012, at 05:56 AM by 15.219.201.70 -
Changed lines 25-32 from:
bundle agent test
{
files:
"/tmp/cf_test_file"
comment => "Promise the the file exists and with stated permission
",
perm => mog("644","root","sys"),
create =>
true;
}
to:
bundle agent test
{
files:
"/tmp/cf_test_file"
comment => "Promise that a plain file exists with stated permissions",
perms => mog("644", "root", "sys"),
create => "
true";
}
July 28, 2012, at 05:49 AM by 15.219.201.70 -
Changed line 77 from:
!!!The ‘-K’ switch will bypass any locks and the ‘-v’ switch will allow you to see the actual output.
to:
'''The ‘-K’ switch will bypass any locks and the ‘-v’ switch will allow you to see the actual output. By default, cf-agent will only execute a policy at minimum once a minute. When we specify the -K flag on the command line at the 3rd execution, the -K instructs cf-agent to ignore this "one minute rule" '''.
July 28, 2012, at 05:45 AM by 15.219.201.70 -
Changed lines 4-5 from:
!!Task :
to:
!!!Task :
Changed lines 20-21 from:
Create cftest1.cf
to:
!!!Create cftest1.cf
Changed line 33 from:
to:
#===
Added line 36:
Changed line 39 from:
!!Now Modify promises.cf and add the details for cftest.cf
to:
!!!Now Modify promises.cf and add the details for cftest.cf
July 28, 2012, at 05:44 AM by 15.219.201.70 -
Changed lines 4-9 from:
check that a file named cf_test_file exists on both the CFEngine policy server and client. If it does not exists, we are instructing CFEngine to create it.

Additionally, we are directing CFEngine to ensure that the permissions are set to 644; that it is owned by root; and the group ownership is the ‘sys’ group.

!! Create cftest1.cf under /var/cfengine/masterfiles/
to:
!!Task :

*Check
that a file named cf_test_file exists on both the CFEngine policy server and client.
*
If it does not exists, we are instructing CFEngine to create it.
*Additionally, we are directing CFEngine to ensure that the permissions are set to 644; that it is owned by root; and the group ownership is the ‘sys’ group.

!!! Create cftest1.cf under /var/cfengine/masterfiles/
Changed lines 65-66 from:
!!Save the /var/cfengine/masterfiles/promises.cf file.
to:
!!!Save the /var/cfengine/masterfiles/promises.cf file.
Changed line 76 from:
!!The ‘-K’ switch will bypass any locks and the ‘-v’ switch will allow you to see the actual output.
to:
!!!The ‘-K’ switch will bypass any locks and the ‘-v’ switch will allow you to see the actual output.
July 28, 2012, at 05:42 AM by 15.219.201.70 -
Added lines 1-74:
(:Google1:)
(:Googletxt:)
----
check that a file named cf_test_file exists on both the CFEngine policy server and client. If it does not exists, we are instructing CFEngine to create it.

Additionally, we are directing CFEngine to ensure that the permissions are set to 644; that it is owned by root; and the group ownership is the ‘sys’ group.

!! Create cftest1.cf under /var/cfengine/masterfiles/

(:table border=1 width=50% bgcolor=yellow cellspacing=0 :)
(:cellnr:)

[@
[root@mail.zimbra.lab ~]# cd /var/cfengine/masterfiles/
[root@mail.zimbra.lab masterfiles]# ls
0010_Basic_Examples._Create_a_file.cf cfengine_stdlib.cf cf_promises_validated failsafe.cf promises.cf

Create cftest1.cf

[root@mail.zimbra.lab masterfiles]# vi cftest1.cf

#====
bundle agent test
{
files:
"/tmp/cf_test_file"
comment => "Promise the the file exists and with stated permission",
perm => mog("644","root","sys"),
create => true;
}

@]
(:tableend:)
(:Googlemm:)

!!Now Modify promises.cf and add the details for cftest.cf

(:table border=1 width=50% bgcolor=yellow cellspacing=0 :)
(:cellnr:)
[@
root@mail.zimbra.lab masterfiles]# vi /var/cfengine/masterfiles/promises.cf

###############################################################################
#
# promises.cf - Basic Policy for Community
#
###############################################################################

body common control
{
bundlesequence => { "main","test" };

inputs => {
"cfengine_stdlib.cf",
"cftest.cf",
};

version => "Community Promises.cf 1.0.0";
}
@]
(:tableend:)

!!Save the /var/cfengine/masterfiles/promises.cf file.

Return to cfhost and manually start the agent by running: ‘

(:table border=1 width=50% bgcolor=yellow cellspacing=0 :)
(:cellnr:)
[@
/var/cfengine/bin/cf-agent -Kv
@]
(:tableend:)

!!The ‘-K’ switch will bypass any locks and the ‘-v’ switch will allow you to see the actual output.
Edit - History - Print - Recent Changes - Search
Page last modified on July 28, 2012, at 05:56 AM