group_secondary attribute

16 views
Skip to first unread message

Kobus

unread,
Aug 24, 2016, 5:56:02 AM8/24/16
to help-cfengine
Hi

I have a requirement from the oracle guys to add users to a list of oracle based groups. So I setup the following:

bundle agent config_oracle
{
vars:
   linux.app_oracle.app_oracle_RoleSep::
      "oracle_deps"   slist   => {"libXtst", "bc", "compat-libcap1", "xorg-x11-xauth", "xterm", "xorg-x11-fonts*", "kmod-oracleasm", "binutils", "compat-libstdc++-33", "elfutils-libelf", "gcc", "gcc-c++", "glibc", "glibc-common", "glibc-devel", "glibc-headers", "ksh", "libaio", "libaio-devel", "libgomp", "libgcc", "libstdc++", "libstdc++-devel", "make", "sysstat", "unixODBC", "unixODBC-devel", "numactl-devel"};
      "skel" string => "/etc/skel";

packages:
   linux.app_oracle.app_oracle_RoleSep::
      "$(oracle_deps)"
         package_policy => "add",
         package_method => yum;

files:
   linux.app_oracle.app_oracle_RoleSep::
      "/etc/cron.allow"
         create => "true",
         edit_line => add_oracle_user;

users:
   linux.app_oracle_RoleSep::
      "oracle"
         policy => "present",
         uid => "201",
         description => "Service Account - oracle User",
         home_bundle => home_skel(oracle, $(skel)),
         home_dir => "/home/oracle",
         group_primary => "oinstall",
         group_secondary => { "dba", "oper", "backupdba", "dgdba", "kmdba", "asmdba" },
         shell => "/bin/bash";
}

bundle agent home_skel(user, skel)
{
  files:
    "/home/$(user)/."
      create => "true",
      copy_from => seed_cp($(skel)),
      depth_search => recurse("inf");
}


I am running cf-promises -V
CFEngine Core 3.7.1
CFEngine Enterprise 3.7.1

and I get the following error:
cf-promises -cf /var/cfengine/inputs/promises.cf
/var/cfengine/inputs/env_dev/config_oracle.cf:66:24: error: Unknown attribute 'group_secondary' for promise type 'users' in bundle with type 'agent'
         group_secondary => { "dba", "oper", "backupdba", "dgdba", "kmdba", "asmdba" },
                       ^
   error: There are syntax errors in policy files

I looked at https://docs.cfengine.com/lts/reference-promise-types-users.html and it seems that the promise should work. Can anybody shed some light on why it is not working please.

THanks

Kobus

Kobus

unread,
Aug 24, 2016, 6:02:40 AM8/24/16
to help-cfengine
Its ok, I found my own stupid mitsake.

Richard Jones

unread,
Aug 24, 2016, 6:04:25 AM8/24/16
to Kobus, help-cfengine
Hi Kobus,

It should be “groups_secondary”

Thanks,

Richard

On Wed 24 Aug 2016 at 10:56:02 BST, Kobus wrote
> I am running cf-promises -V
> CFEngine Core 3.7.1
> CFEngine Enterprise 3.7.1
>
> and I get the following error:
> cf-promises -cf /var/cfengine/inputs/promises.cf
> /var/cfengine/inputs/env_dev/config_oracle.cf:66:24: error: Unknown
> attribute 'group_secondary' for promise type 'users' in bundle with type
> 'agent'
> group_secondary => { "dba", "oper", "backupdba", "dgdba", "kmdba",
> "asmdba" },
> ^
> error: There are syntax errors in policy files

--
jonze.com/privacy.html
Reply all
Reply to author
Forward
0 new messages