Jira (PUP-11514) Extract elements from resource collector

6 views
Skip to first unread message

Pat Riehecky (Jira)

unread,
Apr 20, 2022, 3:04:03 PM4/20/22
to puppe...@googlegroups.com
Pat Riehecky created an issue
 
Puppet / New Feature PUP-11514
Extract elements from resource collector
Issue Type: New Feature New Feature
Affects Versions: PUP 7.15.0
Assignee: Unassigned
Created: 2022/04/20 12:03 PM
Priority: Normal Normal
Reporter: Pat Riehecky

For some applications getting data back out of collected resources would be very helpful.

For example, the `sssd` service requires you to define a list of active domains and have configuration section detailing how that domain should operate.

Today if I generate a custom type (for example `sssd::domain`) and collect that type (`Sssd::Domain<| |>`), I don't have a great way of extracting the domain name so I don't need to repeat it.

Propose sort of thingy `$titles = Sssd::Domain<| |>.title` would return some sort of Array containing the title attributes from the collected Sssd::Domain types.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Josh Cooper (Jira)

unread,
Apr 26, 2022, 5:51:01 PM4/26/22
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Apr 26, 2022, 5:51:03 PM4/26/22
to puppe...@googlegroups.com
Josh Cooper commented on New Feature PUP-11514
 
Re: Extract elements from resource collector

Per hlindberg's comment in https://tickets.puppetlabs.com/browse/PUP-6712?focusedCommentId=348572&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-348572, "[collectors do] not produce a value that can be used in the language", so I don't believe we'd want to try to do that.

Can you use puppetdb_query (or another function) to retrieve/filter/iterate on resources?

It's also possible to iterate resources in the catalog directly, provided you know their names:

$ bx puppet apply -e 'notify { "a": } notify { "b": } ["a", "b"].each |$n| { notice(Notify[$n]) }'
Notice: Scope(Class[main]): Notify['a']
Notice: Scope(Class[main]): Notify['b']

We've talked about a more general "query" see https://tickets.puppetlabs.com/browse/PUP-7541?focusedCommentId=715166&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-715166

Pat Riehecky (Jira)

unread,
Apr 27, 2022, 9:37:03 AM4/27/22
to puppe...@googlegroups.com
Pat Riehecky commented on New Feature PUP-11514

The more general "query" is probably what I'd need.

The resource titles are coming out of hiera, so I don't know them in advance...

Reply all
Reply to author
Forward
0 new messages