Get host deployment status report with REST

25 views
Skip to first unread message

Juan A. S.

unread,
May 28, 2012, 8:10:38 AM5/28/12
to puppet...@googlegroups.com
Hi

Is it possible to get the (last) deployment host report (or the list of reports) for a specific node? I need to access it using REST, to know if the deployment was succesful, and if not, the list of messages, like in the dashboard...

If so, how would be the ACL? Now I have this, to allow the clients submit their reports:

# allow all nodes to store their reports
path /report
method save
allow *


Regards and thanks in advance.

Ohad Levy

unread,
May 28, 2012, 8:30:16 AM5/28/12
to puppet...@googlegroups.com
I'm not 100% if its not possible with the latest version of puppet, but its possible using foreman, something like:
curl -s -u admin:password https://foreman/hosts/<certname>/reports/last -k -H 'Accept:application/json' |prettify_json.rb 
{
  "report": {
    "id": 396001,
    "summary": "Modified",
    "status": {
      "applied": 1,
      "skipped": 0,
      "failed_restarts": 0,
      "restarted": 0,
      "failed": 0
    },
    "host": "certname",
    "logs": [
      {
        "log": {
          "sources": {
            "source": "/Stage[main]/Ntp::Service/Service[ntpd]/ensure"
          },
          "messages": {
            "message": "ensure changed 'stopped' to 'running'"
          }
        }
      },
      {
        "log": {
          "sources": {
            "source": "Puppet"
          },
          "messages": {
            "message": "Finished catalog run in 1.81 seconds"
          }
        }
      }
    ],
    "reported_at": "2012-05-28T11:07:02Z",
    "metrics": {
      "time": {
        "schedule": 0.001669,
        "config_retrieval": 1.55911207199097,
        "package": 0.006316,
        "exec": 0.329731,
        "total": 2.95773607199097,
        "cron": 0.000795,
        "service": 0.56894,
        "mailalias": 0.000378,
        "filebucket": 0.000226,
        "group": 0.001368,
        "yumrepo": 0.005424,
        "file": 0.479179,
        "user": 0.004598
      },
      "changes": {
        "total": 1
      },
      "events": {
        "success": 1,
        "total": 1
      },
      "resources": {
        "changed": 1,
        "out_of_sync": 1,
        "total": 75
      }
    }
  }
}


cheers,
Ohad
 
Regards and thanks in advance.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/G26AQKHHSLUJ.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Juan A. S.

unread,
May 28, 2012, 12:54:54 PM5/28/12
to puppet...@googlegroups.com
Ummmm., I am not using Foreman, just the Puppet REST service or Puppet Dashboard. Any idea?

Thanks.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.

Ohad Levy

unread,
May 29, 2012, 1:24:00 AM5/29/12
to puppet...@googlegroups.com
On Mon, May 28, 2012 at 7:54 PM, Juan A. S. <oke...@gmail.com> wrote:
Ummmm., I am not using Foreman, just the Puppet REST service or Puppet Dashboard. Any idea?

afaik, thats not possible today with just puppet/dashboard.

Ohad 
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/LEM0wLL6GQsJ.

To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages