{ "info": { "author": "Tim Skirvin", "author_email": "tskirvin@fnal.gov", "bugtrack_url": null, "classifiers": [], "description": "# puppetdb-tools\n\nThis package provides tools to interact with a puppetdb via a CLI. These\nscripts use a (configurable-via-environment-variable) json config to\ndetermine how to talk to the server.\n\nThese tools were written to be *less* general than any existing tools I've\nseen out there. Specifically, I don't want to write the necessary JSON\ninput at the command-line every time I'm trying to do a basic query.\n\nThese scripts should support both the v3 and v4 PuppetDB APIs.\n\n## What is puppetdb?\n\n\n\n## Scripts\n\nThis is not an exhaustive list.\n\n### puppetdb-fact\n\nQueries for a given fact, and lists the hosts that have that fact (along\nwith the value of the fact). A specific value can be specified as well.\nExample: `puppetdb-fact puppetversion`\n\n### puppetdb-failed\n\npuppetdb-failed queries the puppetdb to find out which hosts failed on\ntheir last puppet check-in.\n\n### puppetdb-failed-list\n\nQueries the puppetdb for hosts that had failures in their last run, and\nprints out all of the things failed. This is a useful report to send out\nvia email to your team.\n\n### puppetdb-farmlet\n\nQueries the puppetdb for host names, based on zone/role/subrole (our local\nthree-level way of looking up hostnames).\n\n### puppetdb-hosts\n\nList all hosts in the puppetdb.\n\n### puppetdb-last-successful-run\n\nFor each host that failed its last puppet run, find out when it last had\na successful puppet run. This can be useful for determining whether a\nmachine is really \"supported\" any more, especially in conjunction with\npuppetdb-tooquiet.\n\n### puppetdb-node-classes\n\nList the classes deployed on a given system. Should match the per-host\nclasses.txt file.\n\n### puppetdb-node-events\n\nLists events that have affected a given node over the last 48 hours\n(configurable) in much the same format as you would have seen running the\n`puppet agent -t` manually.\n\n### puppetdb-node-facts\n\nLists facts on a node or set of nodes; this should be grep-able enough to\nlet you find, say, uptime across a large swath of hosts, or similar.\n\n### puppetdb-node-resources\n\nLists resources deployed on a node or set of nodes. This is very\npowerful, and the CLI is probably not good enough for what you'd actually\nwant to do with the package.\n\n### puppetdb-report-uptime\n\nLists kernel versions and facts.\n\n### puppetdb-resources\n\nSearch for a given resource type across all hosts, e.g.\n`puppetdb-resources Class --match Mysql::Server`\n\n### puppetdb-tangled\n\npuppetdb-tangled queries the puppetdb to find hosts which are \"tangled\",\nand reports on the associated hosts/events on STDOUT. A \"tangled\" host\nis defined as one where an event is occurring on that host and over and\nover again over the last several runs, which probably indicates that a\nchange is not successful. For instance, Package['foo'] removes\nPackage['bar'] and then Package['bar'] is installed afterwards.\n\n### puppetdb-tooquiet\n\nLists nodes that have not checked into the server for the last 48 hours\n(configurable). Suitable for sending as an email to your team.\n\n### puppetdb-wrapper\n\nSimple bash script to wrap curl with the values of 'key' and 'cert' that\ncome out of the central configuration file.\n\n-------------------------------------------------------------------------------\n\n## Local Scripts\n\nThese scripts may not be helpful to others, but are templates for our own\nuse and show how we interact with facts. These may be useful to others as\ntemplates.\n\n* puppetdb-host-csv\n* puppetdb-manager\n* puppetdb-monitor\n* puppetdb-report-usage\n* puppetdb-uuid-by-host\n\n-------------------------------------------------------------------------------\n\n## Config Files\n\n### /etc/puppetdb/puppetdb.json\n\nThis should work for talking to an https port, where auth requires your own puppet cert (which will only work as root):\n\n {\n \"server\": \"https://{puppetdb_fqdn}:8081\",\n \"ca\": \"/etc/puppetlabs/puppet/ssl/certs/ca.pem\",\n \"cert\": \"/etc/puppetlabs/puppet/ssl/certs/{fqdn}.fnal.gov.pem\",\n \"key\": \"/etc/puppetlabs/puppet/ssl/private_keys/{fqdn}.fnal.gov.pem\",\n \"api_version\": 4\n }\n\nIf you can make queries via http (e.g. without auth):\n\n\n {\n \"server\": \"http://{puppetdb_fqdn}:8080\",\n \"api_version\": 3\n }\n\n### Environment Variables\n\nYou can select alternate configuration files by setting `PUPPETDB_CONFIG`,\ne.g.:\n\n export PUPPETDB_CONFIG=~/rpm/puppetdb-tools/etc/puppetdb/puppetdb3.json\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/tskirvin/puppetdb-tools", "keywords": "puppetdb,puppet", "license": "Perl Artistic", "maintainer": "Tim Skirvin", "maintainer_email": "tskirvin@fnal.gov", "name": "puppetdb-tools", "package_url": "https://pypi.org/project/puppetdb-tools/", "platform": "", "project_url": "https://pypi.org/project/puppetdb-tools/", "project_urls": { "Homepage": "http://github.com/tskirvin/puppetdb-tools" }, "release_url": "https://pypi.org/project/puppetdb-tools/2.2.1/", "requires_dist": null, "requires_python": "", "summary": "puppetdb tools and shared libraries", "version": "2.2.1" }, "last_serial": 5699764, "releases": { "2.1.4": [ { "comment_text": "", "digests": { "md5": "6ff8e891ed8610e0b0cd7e0aed1dfe3c", "sha256": "1cab8d7d21f77366c0394df81ade5d8258f9e7a56dfe2c35ca8900bfaa461852" }, "downloads": -1, "filename": "puppetdb_tools-2.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "6ff8e891ed8610e0b0cd7e0aed1dfe3c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7723, "upload_time": "2019-03-19T20:16:05", "url": "https://files.pythonhosted.org/packages/7d/6a/f0ec12a82bdc9d223425e3d8cc591639ac2bec6a073ee973cc4fef2bf38a/puppetdb_tools-2.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "133a375942ce2ea5a2430fe94d28783a", "sha256": "73800b3d2dbb77c03c728ef1a773089943e67abbd4d4498c2c5c1ebd2cdf853d" }, "downloads": -1, "filename": "puppetdb-tools-2.1.4.tar.gz", "has_sig": false, "md5_digest": "133a375942ce2ea5a2430fe94d28783a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7575, "upload_time": "2019-03-19T20:16:07", "url": "https://files.pythonhosted.org/packages/6f/04/e406bc153b0898ab83373832fa36c3983779133ff2a0bd84c49422b269ec/puppetdb-tools-2.1.4.tar.gz" } ], "2.2.1": [ { "comment_text": "", "digests": { "md5": "769cf17cd15a338c1cfbded00fef8e06", "sha256": "c14731191415e0eb1193c14aaaa7583a5671285342b7cc6741feca208eda588f" }, "downloads": -1, "filename": "puppetdb_tools-2.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "769cf17cd15a338c1cfbded00fef8e06", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7480, "upload_time": "2019-08-19T18:32:48", "url": "https://files.pythonhosted.org/packages/53/18/7e713c515d3020f9e92c9310adf77801bb9bf92d99c7f9fc9136c4d46766/puppetdb_tools-2.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "621c938c57ac3b07f7f632faedd4b099", "sha256": "cf06d55eac16b073fe8dad0e7d0a23dba2b2decde1a1b0ea580622fbee3ca00a" }, "downloads": -1, "filename": "puppetdb-tools-2.2.1.tar.gz", "has_sig": false, "md5_digest": "621c938c57ac3b07f7f632faedd4b099", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7343, "upload_time": "2019-08-19T18:32:49", "url": "https://files.pythonhosted.org/packages/db/57/c1f9e948a1a4c4be6320cd8491479a2a66be2b5db38391851c5aae014efc/puppetdb-tools-2.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "769cf17cd15a338c1cfbded00fef8e06", "sha256": "c14731191415e0eb1193c14aaaa7583a5671285342b7cc6741feca208eda588f" }, "downloads": -1, "filename": "puppetdb_tools-2.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "769cf17cd15a338c1cfbded00fef8e06", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7480, "upload_time": "2019-08-19T18:32:48", "url": "https://files.pythonhosted.org/packages/53/18/7e713c515d3020f9e92c9310adf77801bb9bf92d99c7f9fc9136c4d46766/puppetdb_tools-2.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "621c938c57ac3b07f7f632faedd4b099", "sha256": "cf06d55eac16b073fe8dad0e7d0a23dba2b2decde1a1b0ea580622fbee3ca00a" }, "downloads": -1, "filename": "puppetdb-tools-2.2.1.tar.gz", "has_sig": false, "md5_digest": "621c938c57ac3b07f7f632faedd4b099", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7343, "upload_time": "2019-08-19T18:32:49", "url": "https://files.pythonhosted.org/packages/db/57/c1f9e948a1a4c4be6320cd8491479a2a66be2b5db38391851c5aae014efc/puppetdb-tools-2.2.1.tar.gz" } ] }