Hi all,
I had this strange thing regarding to puppetdb_query. I am trying to
experence PQL.What I do was to create a simple test module that has these
content,
class test {
$debian_nodes_query = 'nodes[certname]{facts{name = "operatingsystem" and
value = "Debian"}}'
$debian_nodes = puppetdb_query($debian_nodes_query).map |$value| {
$value["certname"] }
notify {"Debian nodes":
message => "Your debian nodes are ${join($debian_nodes, ', ')}",
}
$last_node_query = "nodes[certname] { certname ~ 'hadoop.*worker-.*' order
by certname}"
# $last_node_query = "certname in nodes[certname] { facts[certname] { name
= 'icebrg_hadoop_group' and value = 'shakedown_test' } group by certname
order by certname }"
$latest_node = puppetdb_query($last_node_query)
Notify {"hello PQL":
message => "My last report was from $latest_node.",
}
}
While the above module was able to successfully execute from puppet master.
It failed on one of my agents with the following complain,
Error: Evaluation Error: Unknown function: 'puppetdb_query'. (file:
/tmp/test/manifests/init.pp, line: 3, column: 19) on node xxx
I found on the puppet master side, these components exists
/opt/puppetlabs/puppet/cache/lib/puppet/provider/puppetdb_conn_validator/puppet_https.rb
/opt/puppetlabs/puppet/cache/lib/puppet/type/puppetdb_conn_validator.rb
/opt/puppetlabs/puppet/cache/lib/puppet/util/puppetdb_validator.rb
/opt/puppetlabs/puppet/cache/lib/puppetdb/astnode.rb
/opt/puppetlabs/puppet/cache/lib/puppetdb/connection.rb
/opt/puppetlabs/puppet/cache/lib/puppetdb/grammar.racc
/opt/puppetlabs/puppet/cache/lib/puppetdb/lexer.rb
/opt/puppetlabs/puppet/cache/lib/puppetdb/lexer.rex
/opt/puppetlabs/puppet/cache/lib/puppetdb/parser.rb
/opt/puppetlabs/puppet/cache/lib/puppetdb/parser_helper.rb
But they are not exist on the agent side. Anyone can help me on this?
Thanks,
Chengkai
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/bde88b3a-c2d5-4a97-9031-eb41c44c546b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.