Jim-
You're right, splitstring does not split on every character (and maybe it
should if you specify a null pattern). And you missed on "." (because that
makes every character a separator, and then there are no characters to
separate) and on "[.]" (because a '.' in a [character class] is just a d
Niek-
Only one set of promises is ever run. By default that comes from promises.cf,
but you can specify an alternative set with -f. Those promises can consist
of many other files, which you list in the inputs. Regardless of which files
are included, the agent only runs the promises listed in th
In the latest version, look at regextract() - I think that'll help get the
field you want, so you can do your insert...
-Dan
> No responses? Ok, let me restate the problem more simply.
>
> Given a file whose lines have three space-delimited fields, and given a
> string variable that contains a s
Save yourself two shell commands - if you invoke cal with no arguments, it
gives you this month's calendar. So skip the first two calls to date :-)
-Dan
> okay, I got it. Kinda hacky with all the pipes:
>
> vars:
> "year" string => execresult("/usr/bin/date +%Y","noshell");
> "mont
The quick answer is "you don't".
The longer answer is: an slist (or ilist or rlist) can only be iterated over
in it's entirety by referencing the list as a scalar (and then cfengine
iterates over the whole list automagically). You can index an array (which
is what 'foo' is in your example), but a
Because it is a declarative promise language - which is somewhat different
than the usual imperative programming language model. A fine point, but
different nontheless. Declarative languages are hard to get your head around
if you think in purely imperative terms. Once you "let go" and allow
you
Which version of Cfengine? This was a recently reported bug, but I don't know
if it is in the patchset yet...
-Dan
> --_002_2BF070A7A2375D46BA1B6087F8D5DCB678AFEF7C48seldmbx01corp_
> Content-Type: text/plain; charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
>
> Hi,
>
> Is there
Yep, you're definitely going to see the bug, then. The report was against
3.0.3, and I *think* it is fixed in 3.0.4
-Dan
> Ok, great :-) I'm running 3.0.3patch1.
>
>
> Best regards,
> Emil Assarsson emil.assars...@sonyericsson.com
> Phone: +46 (0)10 8017422
>
>
>
>
> -Original Message-
Seva-
What you probably want to do is package everything into a method. So,
something like this (I haven't checked it for syntax, I am just typing
to give you an idea). Note that you'll be saving space sometimes and
wasting sometimes depending on how many times you need to re-do a task,
so my ex
The issue is that Cfengine does a fair amount of compile-time checking and
optimization, and if you want to think of it this way, tweaking the
bundlesequence with "ignore_missing_bundles" is a pre-processor tweak (where
you can say "continue somiling if this bundle is missing"), whereas methods
pro
FWIW, I see a possibly related bug in $(sys.interface). However, I still
need to upgrade to the latest versions, so please submit a bugreport based
on your version.
To answer your question, you can use getindices to find out all the interface
names that are active (i.e., have an IP address).
bod
You have a problem here:
groupX::
"extra_line"string => "57 10 * * * root nice -n -1
$(path)/$(id)-$(extra).sh";
The problem is that $(extra) is an slist, so you are iterating over it, and
that redefines the "extra_line" variable. It's as if you said:
groupX::
Look at the readstringlist and readstringarray builtin functions. Also, see
http://www.cfengine.org/manuals/cf3-reference.html#Introduction-to-functions
which is a handy guide to which functions return what (once you've perused
the whole list to get familiar with them, of course :-)
-Dan
> I hav
If you leave off the "select_end", it will match from the select_start to the
end of file. If you have both a select_start and a select_end, then it will
match between those - and in a recent patch, it will also allow EOF to match
the end. You'll need the newer code, though...
-Dan
> Hi,
>
> D
Kinda-sorta :-)
Classes that are defined in a "common" bundle are global. Classes that are
defined in any other kind of bundle are local to that bundle. See section
1.6 of the manual.
Likewise, classes are cached with an expiration time, but they do go away.
Although they can be set with a test
You probably want to to a classmatch() against the hostname to determine
which machine you are on - and take it from there...
-Dan
> --===0023485862==
> Content-Type: multipart/alternative;
> boundary="=_Part_150839_55279.1272591905086"
>
> --=_Part_150839_55279.127259
To further clarify what Seva said (which is 100% correct :-), you don't need
to say "any.!foo" - if you say "!foo" it means "not foo" which includes
"anything else" :-)
-Dan
> bundle common c
> {
> classes:
> "sf_group" expression => classmatch("sf_.*");
> }
>
> body common control
> {
>
This is the root of the problem:
file_select implies a search - and the only way you can have a search is
either with depth_search or a wildcard in the filename
I believe this is also a bug, in that Cfengine should tell you when you have
a promise that cannot be satisfied, and requires a componen
You can work around the '*' restriction if you like, but wildcard matching on
inputs is a security risk. The reason is as follows:
1) Assume there is a inputs => { "xxx/*.cf" }; in your promises.cf
2) You do testing in a different directory other than /var/cfengine/inputs
(this is a good idea
I agree with Seva, and also point out that by trying a list append, you are
still thinking procedurally and not declaratively...
Procedural programming (and thinking) says "do X, then Y, then Z"
Declarative programming (which is what Cfengine is) says "make sure that X, Y
and Z are all satisfied"
I will be updating the documentation :-)
> This is exactly what I was hoping for :-)
> The documentation could use an update on this.
>
> --
> Emil
>
> -Original Message-
> From: help-cfengine-boun...@cfengine.org [mailto:help-cfengine-boun...@cfengi
> ne.org] On Behalf Of no-re...@cfeng
21 matches
Mail list logo