Jira (PUP-8443) Hiera3 Lookups fail when agent 5.3.4 is installed

2018-02-10 Thread Matthew Gyurgyik (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Matthew Gyurgyik commented on  PUP-8443  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Hiera3 Lookups fail when agent 5.3.4 is installed   
 

  
 
 
 
 

 
 To give a little more context, we are using an external node classifier (written in ruby) that was essentially doing this  
 
 
 
 
 node = Puppet::Node.new(request.key)  
 
 
 node.environment = request.environment  
 
 
 node.classes = ["nodepatterns"]  
 
 
 node.parameters = variablesnode.fact_mergenode
  
 
 
 
  Per Jacob Helwig's explanation above, setting node.parameters last was wiping out node.parameters['environment']. This was never a problem prior because node.fact_merge would set node.parameters['environment']. That behavior changed in 5.3.4. Moving node.environment line after node.parameters, fixed the problem.  Jacob suggested including the parameters. environment, and classes as part of the Puppet::Node initialization, as so  
 
 
 
 
 node_classes = ["nodepatterns"]  
 
 
 node_parameters = variables  
 
 
 node = Puppet::Node.new(  
 
 
   :parameters => node_parameters,  
 
 
   :environment => request.environment,  
 
 
   :classes => node_classes  

Jira (PUP-8443) Hiera3 Lookups fail when agent 5.3.4 is installed

2018-02-10 Thread Matthew Gyurgyik (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Matthew Gyurgyik updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-8443  
 
 
  Hiera3 Lookups fail when agent 5.3.4 is installed   
 

  
 
 
 
 

 
Change By: 
 Matthew Gyurgyik  
 
 
Priority: 
 Blocker Normal  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)  
 
 

 
   
 

  
 

  
 

   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8443) Hiera3 Lookups fail when agent 5.3.4 is installed

2018-02-09 Thread Jacob Helwig (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jacob Helwig commented on  PUP-8443  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Hiera3 Lookups fail when agent 5.3.4 is installed   
 

  
 
 
 
 

 
 Turns out there was a section of code below the snippet that Matthew Gyurgyik included in the ticket that was effectively doing "node.parameters = new_hash". The new hash didn't include an environment key, so the top-scope $environment variable would be nil, which is why we'd see %environment being empty in the hiera config. Before PUP-8225, node.fact_merge would end up re-setting node.parameters['environment'] to the name of node.environment, which is why PUP-8225 broke things here. node.fact_merge stopped setting node.parameters['environment'] because facts aren't supposed to determine the environment a node is in, and fact_merge trying to be smart about re-setting node.parameters['environment'] after letting facts overwrite it was causing a bunch of race-conditions if node.environment hadn't already been populated and needed to be dynamically determined.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)  
 
 

 
   
 

  
 

  
 

   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8443) Hiera3 Lookups fail when agent 5.3.4 is installed

2018-02-09 Thread Jacob Helwig (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jacob Helwig commented on  PUP-8443  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Hiera3 Lookups fail when agent 5.3.4 is installed   
 

  
 
 
 
 

 
 Matthew Gyurgyik, would it be possible for you to directly email me the full content of the file that snippet came from (jacob at puppet dot com)? That snippet looks right, but there might be things going on around it that would be helpful to see.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)  
 
 

 
   
 

  
 

  
 

   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8443) Hiera3 Lookups fail when agent 5.3.4 is installed

2018-02-09 Thread Matthew Gyurgyik (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Matthew Gyurgyik commented on  PUP-8443  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Hiera3 Lookups fail when agent 5.3.4 is installed   
 

  
 
 
 
 

 
 We are using an external node classifier that we wrote a while back. I was looking at the code and noticed that we are setting the environment.  I don't have a great grasp of what is going on from code/internal to puppet perspective, but perhaps this is the root of the problem?  
 
 
 
 
 node = Puppet::Node.new(request.key)  
 
 
 if request.environment  
 
 
   node.environment = request.environment  
 
 
 end  
 
 
 node.classes = ["nodepatterns"]  
 
 
 
   
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)  
 
 

Jira (PUP-8443) Hiera3 Lookups fail when agent 5.3.4 is installed

2018-02-09 Thread Matthew Gyurgyik (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Matthew Gyurgyik commented on  PUP-8443  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Hiera3 Lookups fail when agent 5.3.4 is installed   
 

  
 
 
 
 

 
 We have a few places in our puppet code where we make direct use of the `hiera` function, but most of our hiera calls are the result of automatic class parameter lookups.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)  
 
 

 
   
 

  
 

  
 

   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8443) Hiera3 Lookups fail when agent 5.3.4 is installed

2018-02-09 Thread Josh Cooper (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Josh Cooper commented on  PUP-8443  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Hiera3 Lookups fail when agent 5.3.4 is installed   
 

  
 
 
 
 

 
 Matthew Gyurgyik I'm having trouble reproducing, I see the environment variable correctly interpolated in the lookup. How are you triggering the lookup, e.g. using the hiera function?  
 
 
 
 
 [root@b6ieuqgdfam1rxn ~]# cat /etc/puppetlabs/code/hiera.yaml  
 
 
 ---  
 
 
 :backends:  
 
 
  - yaml  
 
 
    
 
 
 :hierarchy:  
 
 
  - "host/%{::fqdn}"  
 
 
  - "role/%{::role}"  
 
 
  - "hostgroup/%{::hostgroup}"  
 
 
  - "team/%{::team}"  
 
 
  - "enclave/%{::enclave}"  
 
 
  - common  
 
 
    
 
 
 :yaml:  

Jira (PUP-8443) Hiera3 Lookups fail when agent 5.3.4 is installed

2018-02-09 Thread Matthew Gyurgyik (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Matthew Gyurgyik commented on  PUP-8443  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Hiera3 Lookups fail when agent 5.3.4 is installed   
 

  
 
 
 
 

 
 In IRC, Eric Sorenson asked me to try and revert Pup 8225 bug 5.3.x environment fact overwrites enc value. Reverting the change appears to fix this problem.  
 
 
 
 
 [puppet2 tmp]$ wget -q https://github.com/puppetlabs/puppet/commit/389953fe6dbc385fbaf7f27c054306bce3f0de75.patch[root@puppet2 ~]# rpm -q puppet-agent  
 
 
 puppet-agent-5.3.4-1.el7.x86_64  
 
 
 [root@puppet2 ~]# cd /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet  
 
 
 [root@puppet2 puppet]# cat /tmp/389953fe6dbc385fbaf7f27c054306bce3f0de75.patch | patch -R  
 
 
 patching file node.rb  
 
 
 Hunk #2 succeeded at 85 (offset 1 line).  
 
 
 Hunk #3 succeeded at 139 (offset 1 line).  
 
 
 Hunk #4 succeeded at 152 (offset 1 line).[root@puppet2 puppet]# systemctl restart puppetserver  
 
 
 
  Note I did not patch the unit tests (the rest of the patch output was trying to patch the non-existent unit tests)  
 

  
 
 
 
 

 
 
 

 

Jira (PUP-8443) Hiera3 Lookups fail when agent 5.3.4 is installed

2018-02-09 Thread David Hollinger (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 David Hollinger updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-8443  
 
 
  Hiera3 Lookups fail when agent 5.3.4 is installed   
 

  
 
 
 
 

 
Change By: 
 David Hollinger  
 
 
Affects Version/s: 
 PUP 5.3.4  
 
 
Component/s: 
 Hiera & Lookup  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)  
 
 

 
   
 

  
 

  
 

   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8443) Hiera3 Lookups fail when agent 5.3.4 is installed

2018-02-09 Thread Eric Sorenson (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Eric Sorenson moved an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-8443  
 
 
  Hiera3 Lookups fail when agent 5.3.4 is installed   
 

  
 
 
 
 

 
Change By: 
 Eric Sorenson  
 
 
Key: 
 SERVER PUP - 2120 8443  
 
 
Project: 
 Puppet  Server  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)  
 
 

 
   
 

  
 

  
 

   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.