Jira (HI-582) Make hiera.yaml aware of key

2017-09-15 Thread Laura Macchi (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Laura Macchi commented on  HI-582 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Make hiera.yaml aware of key  
 
 
 
 
 
 
 
 
 
 
Thanks Craig! I see you created a wrapper for the key, KEY, which was one of my options. My concern is that customers will try to use that in other backends and failed, because it is not hiera notation but a function specific one. I guess with good docs, this shouldn't be an issue. 
For what it's worth, in my [MsSQL backend](https://github.com/LMacchi/hiera_mssql) I hard coded the query instead of allowing customers to pass an option['query']. Since this is my first time developing something like this, I'll go through yours to see if there's anything I can do better. 
Much appreciated Craig and Henrik! 
L. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 (HI-582) Make hiera.yaml aware of key

2017-09-15 Thread Craig Dunn (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Craig Dunn commented on  HI-582 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Make hiera.yaml aware of key  
 
 
 
 
 
 
 
 
 
 
Laura Macchi Thanks for bringing this up - yes the current 2.x hiera-mysql end is no longer compatible with Hiera 5, I don't think it's worth rolling a fix into the 2.x code because if people are on Hiera 5 they should be migrating to Hiera 5 configs, and since the issue doesn't affect anyone on Puppet < 4.9, I think the best way is to move forward with a Hiera 5 backend 
I've just released hiera-mysql 3.0.0 (https://forge.puppet.com/crayfishx/hiera_mysql/readme) - this will take a little more configuration on your side as you'll need to migrate your existing Hiera 3 config to Hiera 5 (https://docs.puppet.com/puppet/5.1/hiera_migrate.html). Using this version you will be able to interpolate keys into your query with "_KEY_". There are also some other features that weren't available before that you might find useful. Please read the README on the module with regards to behaviour of lookups as there may be some subtle differences to take into account. Note also that hiera-mysql 3.0.0 is shipped as a Puppet module, not a gem (although the gem dependencies are unchanged) 
I'm happy to help with any issues you have with this or any features you think this backend should have. Feel free to reach out to me. 
Regards Craig 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 (HI-582) Make hiera.yaml aware of key

2017-09-14 Thread Laura Macchi (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Laura Macchi commented on  HI-582 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Make hiera.yaml aware of key  
 
 
 
 
 
 
 
 
 
 
Awesome, thanks Henrik and Craig!  
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 (HI-582) Make hiera.yaml aware of key

2017-09-14 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg commented on  HI-582 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Make hiera.yaml aware of key  
 
 
 
 
 
 
 
 
 
 
Laura Macchi I chatted with Craig about this, he has already fixed the very same problem in his HTTP backend and he said he will do the same fix for his mysql backend. He also promised to post on this ticket with info when he has a fix for the problem. So... stay tuned. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 (HI-582) Make hiera.yaml aware of key

2017-09-14 Thread Laura Macchi (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Laura Macchi commented on  HI-582 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Make hiera.yaml aware of key  
 
 
 
 
 
 
 
 
 
 
How do I provide a query like the ones described above?  
I am working on a mssql lookup_key function, and find it really hard to implement without hiera.yaml aware of key. Do you have any suggestions on how to implement that?  
I've noticed that Craig didn't write the MySQL backend in hiera 5, and the hiera 3 one stopped working, I'm guessing it is because of this? 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 (HI-582) Make hiera.yaml aware of key

2017-09-14 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg commented on  HI-582 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Make hiera.yaml aware of key  
 
 
 
 
 
 
 
 
 
 
The way to implement this is to use a backend of the hiera5 lookup_key kind of backend function. It can receive the query and do whatever processing it wants. (Here is the documentation for the lookup key kind of backend: https://docs.puppet.com/puppet/5.1/hiera_custom_lookup_key.html). That however is something that is best implemented by the implementor of the backend ("crayfishx" - Craig Dunn). 
I would be very hesitant to making the key being looked up available for interpolation as that completely blows up any caching (and therefore most of the performance gains in hiera 5) since the key changes with every lookup. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 (HI-582) Make hiera.yaml aware of key

2017-09-14 Thread Ranjit Viswakumar (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Ranjit Viswakumar updated an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Hiera /  HI-582 
 
 
 
  Make hiera.yaml aware of key  
 
 
 
 
 
 
 
 
 

Change By:
 
 Ranjit Viswakumar 
 
 
 
 
 
 
 
 
 
 In the past, hiera.yaml was aware of {{"%\{key\}"}}, which allowed to write custom backends with options like this:{{:query: SELECT val FROM configdata WHERE var='%\{key\}'}}With hiera 5, hiera.yaml is not aware of key, so when that option gets to the function, it looks like:{{:query: SELECT val FROM configdata WHERE var=''}}Customers that use the [mysql backend](https://github.com/crayfishx/hiera-mysql), for example, cannot use it in hiera 5 and writing one without key relies on a very inflexible implementation ,  since the query needs to be  hardcoded  hard coded  inside the function code. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 (HI-582) Make hiera.yaml aware of key

2017-09-14 Thread Ranjit Viswakumar (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Ranjit Viswakumar updated an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Hiera /  HI-582 
 
 
 
  Make hiera.yaml aware of key  
 
 
 
 
 
 
 
 
 

Change By:
 
 Ranjit Viswakumar 
 
 
 
 
 
 
 
 
 
 In the past, hiera.yaml was aware of {{"%\{key\}"}}, which allowed to write custom backends with options like this:{{:query: SELECT val FROM configdata WHERE var='%\{key\}'}}With hiera 5, hiera.yaml is not aware of key, so when that option gets to the function, it looks like:{{:query: SELECT val FROM configdata WHERE var=''}}Customers that use the [mysql backend](https://github.com/crayfishx/hiera-mysql), for example, cannot use it in hiera 5 and writing one without key relies  in  on  a very inflexible implementation, since the query needs to be hardcoded inside the function code. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 (HI-582) Make hiera.yaml aware of key

2017-09-14 Thread Ranjit Viswakumar (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Ranjit Viswakumar updated an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Hiera /  HI-582 
 
 
 
  Make hiera.yaml aware of key  
 
 
 
 
 
 
 
 
 

Change By:
 
 Ranjit Viswakumar 
 
 
 
 
 
 
 
 
 
 In the past, hiera.yaml was aware of  {{"  % \ {key \ } "}} , which allowed to write custom backends with options like this: {{ :query: SELECT val FROM configdata WHERE var='% \ {key \ }' }} With hiera 5, hiera.yaml is not aware of key, so when that option gets to the function, it looks like: {{ :query: SELECT val FROM configdata WHERE var='' }} Customers that use the [mysql backend](https://github.com/crayfishx/hiera-mysql), for example, cannot use it in hiera 5 and writing one without key relies in a very inflexible implementation, since the query needs to be hardcoded inside the function code. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 (HI-582) Make hiera.yaml aware of key

2017-09-14 Thread Laura Macchi (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Laura Macchi updated an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Hiera /  HI-582 
 
 
 
  Make hiera.yaml aware of key  
 
 
 
 
 
 
 
 
 

Change By:
 
 Laura Macchi 
 
 
 
 
 
 
 
 
 
 In the past, hiera.yaml was aware of %{key}, which allowed to write custom backends with options like this: {code} :query: SELECT val FROM configdata WHERE var='%{key}' {code}   With hiera 5, hiera.yaml is not aware of key, so when that option gets to the function, it looks like: {code} :query: SELECT val FROM configdata WHERE var='' {code}   Customers that use the [mysql backend](https://github.com/crayfishx/hiera-mysql), for example, cannot use it in hiera 5 and writing one without key relies in a very inflexible implementation, since the query needs to be hardcoded inside the function code. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 (HI-582) Make hiera.yaml aware of key

2017-09-14 Thread Laura Macchi (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Laura Macchi created an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Hiera /  HI-582 
 
 
 
  Make hiera.yaml aware of key  
 
 
 
 
 
 
 
 
 

Issue Type:
 
  Bug 
 
 
 

Assignee:
 

 Unassigned 
 
 
 

Created:
 

 2017/09/14 9:57 AM 
 
 
 

Priority:
 
  Normal 
 
 
 

Reporter:
 
 Laura Macchi 
 
 
 
 
 
 
 
 
 
 
In the past, hiera.yaml was aware of % {key}, which allowed to write custom backends with options like this:  
 
 
 
 
 
 
  
 
 
 
 
 
 :query: SELECT val FROM configdata WHERE var='%{key} 
' 
 
 
 
 
 
 
  
 
 
 
 
With hiera 5, hiera.yaml is not aware of key, so when that option gets to the function, it looks like: