Re: [Puppet Users] Problem querying PuppetDB from within a Puppet class

2019-03-06 Thread Dirk Heinrichs
Am Donnerstag, den 28.02.2019, 13:46 + schrieb Dirk Heinrichs: Am Donnerstag, den 28.02.2019, 13:53 +0100 schrieb Henrik Lindberg: Did you mean to use map() to get an array of the names? That is, like this: $debian_nodes = puppetdb_query($debian_nodes_query).map |$value| {

Re: [Puppet Users] Problem querying PuppetDB from within a Puppet class

2019-02-28 Thread Henrik Lindberg
On 2019-02-28 16:12, Henrik Lindberg wrote: Where in documentation did you get that example? It is wrong so needs to be corrected. You definitively need to use `map` to map the result to what you want. Already fixed in later versions of the documentation: ticket is here:

Re: [Puppet Users] Problem querying PuppetDB from within a Puppet class

2019-02-28 Thread Henrik Lindberg
On 2019-02-28 14:46, Dirk Heinrichs wrote: Am Donnerstag, den 28.02.2019, 13:53 +0100 schrieb Henrik Lindberg: On 2019-02-28 13:37, Dirk Heinrichs wrote: following the example in the PuppetDB documentation, I tried this code: $debian_nodes_query = 'nodes[certname]{facts{name =

Re: [Puppet Users] Problem querying PuppetDB from within a Puppet class

2019-02-28 Thread Dirk Heinrichs
Am Donnerstag, den 28.02.2019, 13:53 +0100 schrieb Henrik Lindberg: On 2019-02-28 13:37, Dirk Heinrichs wrote: following the example in the PuppetDB documentation, I tried this code: $debian_nodes_query = 'nodes[certname]{facts{name = "operatingsystem" and value = "Debian"}}' $debian_nodes =

Re: [Puppet Users] Problem querying PuppetDB from within a Puppet class

2019-02-28 Thread Henrik Lindberg
On 2019-02-28 13:37, Dirk Heinrichs wrote: Hi, following the example in the PuppetDB documentation, I tried this code: $debian_nodes_query = 'nodes[certname]{facts{name = "operatingsystem" and value = "Debian"}}' $debian_nodes = puppetdb_query($debian_nodes_query).each |$value| { The line