I'm curious to know if the cfengine_stdlib.cf name for getindices was
changed or comes from some other include?  I did some searching around
but I didn't find anything obvious when I checked.

I'm trying to set up cf3 from scratch to do some basic tasks.  I just
need to manage some config files and local accounts for a start.  I've
noticed a problem with using the example for changing a root password
from the cf3 tutorial, paragraph 3.3 together with a version of
cfengine_stdlib.cf downloaded a few days ago from:

 http://www.cfengine.org/manuals/cfengine_stdlib.cf

I have to admit that I'm new to cf3 in particular and setting up
cfengine in general.  I have done some task writing in cf2, though it
has been a while.  It's entirely possible that I'm just missing
something silly.  I'm using the community version, cfengine-3.0.3
compiled from source on CentOS 5.4 (gcc 4.1.2).

These are the errors that get thrown by cf-agent less the -v:

[r...@policy-client ~]# /usr/local/sbin/cf-agent
Function getindices was promised an array in scope "addpasswd" but this
was not
found
Function getindices was promised an array in scope "addpasswd" but this
was not
found
 !! Class identifier contains illegal characters
Promise (version not specified) belongs to bundle
'append_users_starting' in fil
e '/var/cfengine/inputs/cfengine_stdlib.cf' near line 151
Function getindices was promised an array in scope "addpasswd" but this
was not
found
Function getindices was promised an array in scope "addpasswd" but this
was not
found
 !! Class identifier contains illegal characters
Promise (version not specified) belongs to bundle
'append_users_starting' in fil
e '/var/cfengine/inputs/cfengine_stdlib.cf' near line 151
Function getindices was promised an array in scope "addpasswd" but this
was not
found
Function getindices was promised an array in scope "addpasswd" but this
was not
found
 !! Class identifier contains illegal characters
Promise (version not specified) belongs to bundle
'append_users_starting' in fil
e '/var/cfengine/inputs/cfengine_stdlib.cf' near line 151
List parameter not found while constructing "append_user_field" - use
@(scope.va
riable) in calling reference
[r...@policy-client ~]#

This is what's around line 151, the trouble seeming to start with the
call to getindices on line 147: 

bundle edit_line append_users_starting(v)

 # For adding to /etc/passwd or etc/shadow, needs
 # an array v[username] string => "line..."

{
vars:

  "index"        slist => getindices("$(v)"); # Line 147

classes:

  "add_$(index)" not => userexists("$(index)"); # Line 151

insert_lines:

  "$($(v)[$(index)])",

      ifvarclass => "add_$(index)";
}

Here is the bundle sequence from my promises.cf:

        bundlesequence  => {
                   "update",
                   "garbage_collection",
                   "server",
                   "site_local_accounts",
                   "site_root_password"
        };

And my inputs:

inputs          => {
                        "update.cf",
                        "site.cf",
                        "cfengine_stdlib.cf"
                   };

Here is the bundle agent definition:

bundle agent site_root_password {
files:
        policy_client::
                "/tmp/shadow"
                comment => "Set the root password",
                edit_line => set_user_field("root",2,"somehash");
}

Any suggestions?

Thanks in advance,

                        --Bruce


_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to