Issue #20758 has been updated by Rob Nelson.

Status changed from Unreviewed to Needs Decision

In spite of how awesome this feature may be, it still needs a decision from the 
product owner.

----------------------------------------
Feature #20758: Accessing arguments in exported resource collection override 
for override.
https://projects.puppetlabs.com/issues/20758#change-98390

* Author: James Shubin
* Status: Needs Decision
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 
* Keywords: awesome,feature,idea
* Branch: 
----------------------------------------
Sorry I don't know how to name the subject any better...

I came up with something which would be particularly useful for advanced puppet 
users, which I don't think exists at the moment. If it does, please let me 
know, if not, then consider this a feature request!

Given:

<pre>
@@foo::bar { 'some_name':
    value => 'hello',
    thing => 'world',
    tag => 'mytag',
}
</pre>

and (on a different machine):

I'd like to be able to access the properties of the element being created, for 
use in it's override block...
Here is a very contrived example, I've made up a fake syntax of round brackets: 
$(thing) to show where i am using a variable from the object. This could be 
sort of like regexp conditional _capture_ variables, but named...

<pre>
Foo::Bar <<| tag == 'mytag' |>> {
    value => "override",
    thing => $(value) ? {                 # $(value) should be one of the 
arguments
        'world' => 'Earth',
        'baz' => "$(name)",               # here we're using the name this 
define has...
        'yeah' => "$(tag)",               # or maybe we want a property like tag
        default => "$(thing)-whatever",   # here's another example, but this 
time with $thing
    },
}
</pre>

Please note that the syntax of $(foo) that I made up is probably the wrong 
thing... It can't be ${foo} because of course you always want to be able to 
still access the main scope variables named as such, so perhaps something 
special is needed. Maybe $:var (single colon?) or 
$::special_namespace_identifier::foo, such as $::__override::foo, or 
Foo::Bar::Variable ?

Cheers,
James



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

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

Reply via email to