templates and virtual resources query

23 views
Skip to first unread message

Jason Ball

unread,
Aug 8, 2014, 2:03:21 AM8/8/14
to puppet...@googlegroups.com
Hi all,

I have a user collection via a custom virtual resource, this allows me to realize users based on their group memberships:

  Accounts <| unixgroups=="foo" |>

this works nicely as centralised authentication is not an option for this particular deployment. 

I now need to develop a template that controls access via an xml config file, the contents would depend on enumerating users in a given group similar to the 'realize' option, conceptually something like the following:

   <% @users.each do |user| -%>
      <authorize username="<%= @user.name -%>" password="<%= @user.password -%>">
          [... add conditional permissions ...]
      </authorize>
   <% end -%>

While I'm aware I could explicitly list the users, being able to generate a value based off the 'realize' would be beneficial as it would allow for a single source of truth in my manifests.

Ideally I'm looking for:

   $users = Accounts <| unixgroups="foo" |>

or similar to pass to the template.


desert kun

unread,
Nov 24, 2017, 4:30:20 PM11/24/17
to Puppet Users
Hi Jason!

Came into exactly this issue. I know 3 years have passed, but have you solved the issue the way you intended to?
Reply all
Reply to author
Forward
0 new messages