Skip to content

Instantly share code, notes, and snippets.

@nicklewis
Created August 29, 2013 23:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicklewis/6384464 to your computer and use it in GitHub Desktop.
Save nicklewis/6384464 to your computer and use it in GitHub Desktop.
Hypothetical PuppetDB ternary operator
["and",
["=", "type", "Package"],
["?:",
["in", "certname",
["extract", "certname",
["select-facts",
["and", ["=", "name", "kernelrelease"], ["=", "value", "3.2.0-3-amd64"]]]]]
["=", "title", "linux-headers-3.2.0-3-amd64"],
["=", "title", "linux-headers-3.2.0-2-amd64"]]]
["and",
["=", "type", "Package"],
["or",
["and",
["in", "certname",
["extract", "certname",
["select-facts",
["and", ["=", "name", "kernelrelease"], ["=", "value", "3.2.0-3-amd64"]]]]],
["=", "title", "linux-headers-3.2.0-3-amd64"]],
["and",
["not",
["in", "certname",
["extract", "certname",
["select-facts",
["and", ["=", "name", "osfamily"], ["=", "value", "3.2.0-3-amd64"]]]]]],
["=", "title", "linux-headers-3.2.0-2-amd64"]]]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment