Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-4182

add a flag to get JSON output from puppet resource

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Template:
    • Team:
      Coremunity
    • Story Points:
      3

      Description

      As I discussed with Henrik Lindberg, I'd like an option to get JSON (and perhaps YAML) output from the puppet resource command. I can see two use cases:

      1) For YAML, ability to go directly from existing puppet resources to YAML entries I can put into hiera to feed into create_resource
      2) for JSON, as an extension point to use puppet in the context of shell scripts, python fabric scripts, etc. For example, using the puppetlabs-aws module, you could loop over the output of a puppet resource command listing all ec2_instances, use jq in bash (or python json parsing, etc) to select instances that lack appropriate tags, modify the JSON to add the appropriate tags, then feed that back into puppet apply to update the resources.

      Ideally, I'd like some ability to pipe JSON into a puppet resource to set parameters, as well, but that's less important because I can use puppet functions in a puppet apply.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              daniel.dreier Daniel Dreier
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:

                  Zendesk Support