Forum: Cfengine Help
Subject: Re: Parsing fstab
Author: neilhwatson
Link to topic: https://cfengine.com/forum/read.php?3,20565,20575#msg-20575
I did an abbreviated test and it seems to work.
$ cf-promises -V
This comprises cf-promises core community version 3.1.4 - Copyright Copyright
(C) Cfengine AS 2008,2010-
$ cf-promises -f ./greptest.cf
$ cat greptest.cf
body common control
{
bundlesequence => { "test" };
}
bundle agent test
{
vars:
"list1"
slist => { "nfs$(const.n)", "nfs1", "anfs", "anfs1", "xxx nfs
xxx" };
"list2"
slist => { "/dev/vg02/lvol3 /var/opt/applmgr vxfs
rw,suid,largefiles,delaylog,nodatainlog 0 2",
"adama:/var/opt/applmgr/PRISTINE
/var/opt/applmgr/PRISTINE nfs rw,suid,soft 0 0"
};
"grep1"
slist => grep(".*nfs.*","list1");
"grep2"
slist => grep(".*nfs.*","list2");
reports:
linux|hpux::
"------------ grep test 1 ----------";
"$(grep1)";
"------------ grep test 2 ----------";
"$(grep2)";
"----------- reglist test -----------";
}
$ cf-agent -IKf ./greptest.cf
R: ------------ grep test 1 ----------
R: nfs1
R: anfs
R: anfs1
R: xxx nfs xxx
R: ------------ grep test 2 ----------
R: adama:/var/opt/applmgr/PRISTINE /var/opt/applmgr/PRISTINE nfs rw,suid,soft 0 0
R: ----------- reglist test -----------
Are those the results you are expecting? If you run this test on your host do
you get the same results as mine?
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine