All, I'm having some issues expanding global variables defined in my site.cf within a command.
Site.cf extract:- bundle common g { vars: # Managed user account names "user_name" slist => {"test1", "test2", "test3", "test4", "test5", "test6"}; I've tried to reference these as follows:- commands: aix.!vios:: run_mksecldap:: "/usr/sbin/mksecldap -c -h $(oid_servers) -a $(ldap_bind_account) -p $(ldap_bind_pass) -d $(bind_dn) -n 636 -k $(ldap_keydb) -w $(key_store_pass) -A ldap_auth", classes => if_ok("restart_secldapclntd"); "/usr/sbin/restart-secldapclntd", ifvarclass => canonify("restart_secldapclntd"); "/usr/bin/chsec -f /etc/security/user -s $(g.user_name) -a \"SYSTEM=LDAP or files\"", ifvarclass => canonify("restart_secldapclntd"); "/usr/bin/chsec -f /etc/security/user -s $(g.user_name) -a \"registry=LDAP\"", ifvarclass => canonify("restart_secldapclntd"); When I run the bundle the var doesn't get expanded and the shell command errors. community> -> Executing '/usr/bin/chsec -f /etc/security/user -s @(g.user_name) -a "SYSTEM=LDAP or files"' ...(timeout=-678,owner=-1,group=-1) community> -> (Setting umask to 77) community> !! Finished command related to promiser "/usr/bin/chsec -f /etc/security/user -s @(g.user_name) -a "SYSTEM=LDAP or files"" -- an error occurred (returned 1) community> Q: ".../bin/chsec -f /": 3004-725 Invalid stanza name "@(g.user_name)". community> I: Last 1 quoted lines were generated by promiser "/usr/bin/chsec -f /etc/security/user -s @(g.user_name) -a "SYSTEM=LDAP or files"" community> -> Completed execution of /usr/bin/chsec -f /etc/security/user -s @(g.user_name) -a "SYSTEM=LDAP or files" community> -> Promiser string contains a valid executable (/usr/bin/chsec) - ok community> If I define the vars within that bundle it works fine? Any suggestions? Cheers
_______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine