- From: James Light <
>
- To:
- Subject: [chef] Re: Re: Re: Nested Databags
- Date: Wed, 12 Sep 2012 14:19:35 -0400
If you have a list of IP addresses per user, you may want to have a
data bag for users, which you'll already have if you're using the
users cookbook, and just add a JSON field for the list of IP addresses
for that user, then use that in your recipe. The IP addresses per user
aren't going to change depending on the role of the server are they?
Unless I misunderstand the question, it seems like the users have a
list of IP addresses associated with them that doesn't change too
often once it has been set and then it seems to lend itself to being
non-role specific, no?
-JL
On Wed, Sep 12, 2012 at 11:29 AM, jfotop
<
>
wrote:
>
>
>
Thanks for your answer.
>
Actually, my ldap server doesn't have IP's assigned to users and it's not an
>
option (that's what the ldap admins told me).
>
Your first idea could actually be what I need, but I would have to create
>
the
>
databag when I create each node. Each node name is unknown up until the
>
moment
>
it's created, when the users/ips of each group are already known, so I'll
>
look
>
into it and see if it works for us.
>
Another solution that came to mind is that, since all of these nodes will be
>
using the same role, I will set a few role attributes for all groups like:
>
set['access_groups']['group1']['user11']="ip11"
>
set['access_groups']['group1']['user12']="ip12"
>
set['access_groups']['group2']['user21']="ip21"
>
set['access_groups']['group2']['user22']="ip22"
>
set['access_groups']['group3']['user31']="ip31" and so on.
>
>
upon node creation, an attribute would be set (for example: node.ldap_group)
>
and any recipe would itterate over
>
node.access_groups.#{node.ldap_group}.each
>
(haven't tried it yet, so I don't know if it will work.) and get either the
>
users (key) either their IP.
>
>
Any other ideas?
Archive powered by MHonArc 2.6.16.