Groups
Groups
Sign in
Groups
Groups
Puppet Users
Conversations
About
Send feedback
Help
Puppet resource details using http api or puppetdb api
28 views
Skip to first unread message
Riju Francis
unread,
Nov 5, 2013, 11:50:58 PM
11/5/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
Is there a way to get the package version or service status using the puppet api calls?
Following resource commands show version/status in the output:
puppet resource package iptables
puppet resource service iptables
Can the api be used to get similar output?
Thanks
Riju
Nan Liu
unread,
Nov 6, 2013, 1:10:16 PM
11/6/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
Puppet resource command is a face, so you can query via:
> require 'puppet'
> require 'puppet/indirector/face'
> puts Puppet::Face[:resource, '0.0.1'].find('package/linecache').to_pson
{"title":"linecache","exported":false,"tags":["package","linecache"],"type":"Package","parameters":{"provider":"gem","configfiles":"keep","loglevel":"notice","ensure":["0.46"]}}
Look in the source code and there's additional examples such as listing all resource of a type:
all_users = Puppet::Face[:resource, '0.0.1'].search("user")
Thanks,
Nan
Nan Liu
unread,
Nov 6, 2013, 1:26:09 PM
11/6/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
Bla, have to read more carefully since subject makes a difference here, if you want to search puppet db use (which also supplies a puppet face):
https://github.com/dalen/puppet-puppetdbquery
Nan
Reply all
Reply to author
Forward
0 new messages