You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
Hello! I spent the last couple of days trying to find a good way to search facts specific to some node based on ragex. For example, in my puppet manifest i need a way to check if there are facts whose names (not values) match a specific regex. Is there anyone who had this problem before? I know that it might be done using inline ruby code, but i wonder if there is no other solution.
Henrik Lindberg
unread,
Feb 27, 2015, 9:08:46 AM2/27/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
Then using the standard lib function keys() on $facts to get an array of
the keys. You can then use the in operator to search.
Alternatively use the standard lib function has_key($facts).
If you are using parser=future you can also iterate over the hash's keys
and values directly.