Jira (BOLT-1405) Allow users to set {{$environment}} for apply blocks

0 views
Skip to first unread message

Alex Dreyer (JIRA)

unread,
Jun 18, 2019, 10:59:03 AM6/18/19
to puppe...@googlegroups.com
Alex Dreyer created an issue
 
Puppet Task Runner / New Feature BOLT-1405
Allow users to set {{$environment}} for apply blocks
Issue Type: New Feature New Feature
Assignee: Unassigned
Created: 2019/06/18 7:58 AM
Priority: Normal Normal
Reporter: Alex Dreyer

Users should be able to set `$environment` for apply blocks so they can use existing hierarchies that reference environment.

Interface 1:
apply($nodes, environment => 'foo')
interface 2:
noformat
$environment = 'foo'
apply($nodes)
noformat

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
Jun 18, 2019, 3:32:03 PM6/18/19
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
Change By: Henrik Lindberg
Users should be able to set `$environment` for apply blocks so they can use existing hierarchies that reference environment.

Interface 1:
{{apply($nodes, environment => 'foo')}}
interface 2:
{
{ noformat} }
$environment = 'foo'
apply($nodes)
{
{ noformat} }
Add Comment Add Comment
 

Henrik Lindberg (JIRA)

unread,
Jun 18, 2019, 3:34:03 PM6/18/19
to puppe...@googlegroups.com
Henrik Lindberg commented on New Feature BOLT-1405
 
Re: Allow users to set {{$environment}} for apply blocks

Please don't go for "interface2" as that requires fiddling with variable values in scopes - nothing good can come out of that.

Alex Dreyer (JIRA)

unread,
Jun 18, 2019, 3:34:03 PM6/18/19
to puppe...@googlegroups.com
Alex Dreyer updated an issue
 
Change By: Alex Dreyer
Users should be able to set `$environment` for apply blocks so they can use existing hierarchies that reference environment.

Possible implementations:
Interface 1:
{{
noformat}}
apply($nodes, environment => 'foo')

{{noformat
}}

interface 2:
{noformat}
$environment = 'foo'
apply($nodes)
{noformat}

Alex Dreyer (JIRA)

unread,
Jun 18, 2019, 3:37:03 PM6/18/19
to puppe...@googlegroups.com

Alex Dreyer (JIRA)

unread,
Jun 18, 2019, 3:40:03 PM6/18/19
to puppe...@googlegroups.com
Alex Dreyer commented on New Feature BOLT-1405
 
Re: Allow users to set {{$environment}} for apply blocks

I don't think thats the case. We'd just have to check for a $environment variable when we're deserializing the plan scope for catalog compilation and name the environment after it when creating the temporary environment.
It seems like expected behavior for plans where puppet environments are not really a thing.

Henrik Lindberg (JIRA)

unread,
Jun 18, 2019, 4:46:03 PM6/18/19
to puppe...@googlegroups.com

So, you never expect to be able to change the environment between two applies in the same plan? (At least not with that interface)
And isn't there a global {{$environment }} that it would pick up if not setting it? Is that the intent - hide global with local?

What if one plan calls another? That setting of $environment is local to the calling plan, and will not be visible to the called plan unless it "fiddles around with calling scope"...

Alex Dreyer (JIRA)

unread,
Jun 18, 2019, 5:03:02 PM6/18/19
to puppe...@googlegroups.com
Alex Dreyer commented on New Feature BOLT-1405

I think we generally don't want people to treat $environment specially in plans. So most of the behavior you described(except perhaps always being set) makes sense. I don't think plans should inherit environment just like they don't inherit other scope(anymore).

Reply all
Reply to author
Forward
0 new messages