Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions contrib/cf-doc/example_cf-doc.cf
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#!/var/cfengine/bin/cf-agent -f-
bundle agent example_cf_doc
{
meta:
"inventory" string => "Example: This bundle does Inventory";
"config" string => "Example: This bundle configures /tmp/example.txt";
meta:
"inventory" string => "Example: This bundle does Inventory";
"config" string => "Example: This bundle configures /tmp/example.txt";

vars:
"h"
string => "$(sys.fqhost)",
meta => { "docinv=Fully Qualified Hostname according to CFEngine" };
vars:
"h"
string => "$(sys.fqhost)",
meta => { "docinv=Fully Qualified Hostname according to CFEngine" };

files:
"/tmp/example.txt"
create => 'true',
meta => { "docconfig=Make sure the important file /tmp/example.txt exists" };
files:
"/tmp/example.txt"
create => 'true',
meta => {
"docconfig=Make sure the important file /tmp/example.txt exists"
};
}
21 changes: 12 additions & 9 deletions contrib/cf-profile/tests/lib/namespace/ns1.cf
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
body file control {
namespace => "ns1";
inputs => { "$(ns1:d.dir)/ns2.cf" };
body file control
{
namespace => "ns1";
inputs => { "$(ns1:d.dir)/ns2.cf" };
}

bundle common d {
vars:
"dir" string => "$(this.promise_dirname)";
bundle common d
{
vars:
"dir" string => "$(this.promise_dirname)";
}

bundle agent ns1 {
methods:
"c" usebundle => ns2:ns2;
bundle agent ns1
{
methods:
"c" usebundle => ns2:ns2;
}
13 changes: 8 additions & 5 deletions contrib/cf-profile/tests/lib/namespace/ns2.cf
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
body file control {
namespace => "ns2";
body file control
{
namespace => "ns2";
}
bundle agent ns2 {
commands:
"/bin/sleep 2";

bundle agent ns2
{
commands:
"/bin/sleep 2";
}
30 changes: 17 additions & 13 deletions contrib/cf-profile/tests/namespace.cf
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
body common control {
bundlesequence => { "main" };
inputs => { "$(d.dir)/lib/namespace/ns1.cf" };
body common control
{
bundlesequence => { "main" };
inputs => { "$(d.dir)/lib/namespace/ns1.cf" };
}

bundle common d {
vars:
"dir" string => "$(this.promise_dirname)";
bundle common d
{
vars:
"dir" string => "$(this.promise_dirname)";
}

bundle agent main {
methods:
"a" usebundle => ns1:ns1;
"b" usebundle => ns1;
bundle agent main
{
methods:
"a" usebundle => ns1:ns1;
"b" usebundle => ns1;
}

bundle agent ns1 {
commands:
"/bin/sleep 3";
bundle agent ns1
{
commands:
"/bin/sleep 3";
}
54 changes: 31 additions & 23 deletions contrib/cf-profile/tests/promises.cf
Original file line number Diff line number Diff line change
@@ -1,33 +1,41 @@
body common control {
bundlesequence => { "main1", "main2" };
body common control
{
bundlesequence => { "main1", "main2" };
}

bundle agent main1 {
bundle agent main1
{
commands:
"/bin/sleep 1";

commands:
"/bin/sleep 1";

methods:
"a" usebundle => a("arg1 somevalue", "arg2 somevalue", "arg3 somevalue");
"b" usebundle => b("arg4 somevalue", "arg5 somevalue", "arg6 somevalue");
methods:
"a" usebundle => a("arg1 somevalue", "arg2 somevalue", "arg3 somevalue");
"b" usebundle => b("arg4 somevalue", "arg5 somevalue", "arg6 somevalue");
}

bundle agent a (a1, a2, a3) {
commands:
"/bin/echo $(this.bundle):$(a1),$(a2),$(a3)";
bundle agent a(a1, a2, a3)
{
commands:
"/bin/echo $(this.bundle):$(a1),$(a2),$(a3)";
}
bundle agent b (a1, a2, a3) {
methods:
"c" usebundle => c("arg7 somevalue", "arg8 somevalue", "arg9 somevalue");
commands:
"/bin/echo $(this.bundle):$(a1),$(a2),$(a3)";

bundle agent b(a1, a2, a3)
{
methods:
"c" usebundle => c("arg7 somevalue", "arg8 somevalue", "arg9 somevalue");

commands:
"/bin/echo $(this.bundle):$(a1),$(a2),$(a3)";
}
bundle agent c (a1, a2, a3) {
commands:
"/bin/echo $(this.bundle):$(a1),$(a2),$(a3)";

bundle agent c(a1, a2, a3)
{
commands:
"/bin/echo $(this.bundle):$(a1),$(a2),$(a3)";
}

bundle agent main2 {
commands:
"/bin/sleep 2";
bundle agent main2
{
commands:
"/bin/sleep 2";
}
Loading
Loading