HEP-Puppet / puppet-grid_pool_accounts

0 stars 4 forks source link

pool_group fails if account has multiple groups #12

Open milliams opened 9 years ago

milliams commented 9 years ago

At Birmingham we have a set of users in our users.conf like:

7000:lhb000:7000:lhcb:lhcb::
7001:lhb001:7000:lhcb:lhcb::
...
7098:lhb098:7000:lhcb:lhcb::
7099:lhb099:7000:lhcb:lhcb::
8201:pillhb01:7003,7000:lhcbpil,lhcb:lhcb:pil:
8202:pillhb02:7003,7000:lhcbpil,lhcb:lhcb:pil:
...
8219:pillhb19:7003,7000:lhcbpil,lhcb:lhcb:pil:
8220:pillhb20:7003,7000:lhcbpil,lhcb:lhcb:pil:
8001:prdlhb01:7001,7000:lhcbprd,lhcb:lhcb:prd:
8002:prdlhb02:7001,7000:lhcbprd,lhcb:lhcb:prd:
...
8019:prdlhb19:7001,7000:lhcbprd,lhcb:lhcb:prd:
8020:prdlhb20:7001,7000:lhcbprd,lhcb:lhcb:prd:
8101:sgmlhb01:7002,7000:lhcbsgm,lhcb:lhcb:sgm:
8102:sgmlhb02:7002,7000:lhcbsgm,lhcb:lhcb:sgm:
...
8119:sgmlhb19:7002,7000:lhcbsgm,lhcb:lhcb:sgm:
8120:sgmlhb20:7002,7000:lhcbsgm,lhcb:lhcb:sgm:

When I call grid_pool_accounts { 'lhcb':} I get the error:

Error: Failed to apply catalog: Parameter gid failed on Group[lhcbsgm,lhcb]: Invalid GID 7002,7000 at /etc/puppet/environments/production/modules/grid_pool_accounts/manifests/pool_group.pp:10

This is because the function get_pool_gid() returns the last group id that matches 'lhcb' which gives 7002,7000 which is passed directly to a Puppet group definition in pool_group.pp which is an invalid GID.

I can't see where the secondary groups are created either. Is this functionality missing?

kashif74 commented 9 years ago

Hi Matt I know about this issues so I took the easy way out by using yaim for pool creation. Feel free to change it.