Forgive me for combining questions, but I'm looking at two options for 
solving a problem and I'm not sure which one is best, or the exact syntax 
for either one.

First, I'm wondering if it's possible to set tags for resources create with 
hiera and create_resources.  The first stab I took at syntax looked 
something like this:

-- hieradata/common.yaml
   users:
      myuser:
         tag:
            - admin
            - backups

-- users/manifests/init.pp
   $all_users = hiera_hash('users')
   create_resources(@user, $all_users)
   
-- users/manifests/admin.pp
   User <| tag == 'admin' |>

This is complicated a bit by bug #20972 and the fact that I'm actually 
using a custom defined type and a wrapper around it in place of @user, but 
the above should illustrate what I'm trying to do.  Once I know if it's 
possible and how to make it happen, I can sort out the complications of a 
wrapper type around the final resource.

Failing that, I'm looking at passing a list of users to a resource 
collector like so:

-- hieradata/common.yaml
   adminusers:
      - bob
      - joe

-- users/manifests/admin.pp
   $admin_users = hiera_array('adminusers')
   User <| title == $admin_users |>

I also tried 'title in $admin_users' but that didn't work either.

Is there a way to accomplish either of these approaches?


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to