{"id":15013965,"url":"https://github.com/bartavelle/language-puppet","last_synced_at":"2025-04-12T06:03:54.588Z","repository":{"id":5129140,"uuid":"6294822","full_name":"bartavelle/language-puppet","owner":"bartavelle","description":"A library to work with Puppet manifests, test them and eventually replace everything ruby.","archived":false,"fork":false,"pushed_at":"2023-11-07T15:51:29.000Z","size":3226,"stargazers_count":51,"open_issues_count":20,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-12T06:02:09.989Z","etag":null,"topics":["continuous-integration","haskell","library","parser","puppet","server","tests"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"burningtongue/rollingstonesmap","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bartavelle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-10-19T12:48:34.000Z","updated_at":"2023-05-12T16:39:13.000Z","dependencies_parsed_at":"2024-09-16T01:14:30.789Z","dependency_job_id":null,"html_url":"https://github.com/bartavelle/language-puppet","commit_stats":{"total_commits":1589,"total_committers":10,"mean_commits":158.9,"dds":0.3983637507866583,"last_synced_commit":"c3c3df22a47c5b4524d49458caf279e3098929e8"},"previous_names":[],"tags_count":89,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartavelle%2Flanguage-puppet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartavelle%2Flanguage-puppet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartavelle%2Flanguage-puppet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartavelle%2Flanguage-puppet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bartavelle","download_url":"https://codeload.github.com/bartavelle/language-puppet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525135,"owners_count":21118616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["continuous-integration","haskell","library","parser","puppet","server","tests"],"created_at":"2024-09-24T19:45:00.609Z","updated_at":"2025-04-12T06:03:54.555Z","avatar_url":"https://github.com/bartavelle.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![language puppet](https://img.shields.io/hackage/v/language-puppet.svg)\n![lts](https://www.stackage.org/package/language-puppet/badge/lts)\n![nightly](https://www.stackage.org/package/language-puppet/badge/nightly)\n![Build Status](https://travis-ci.org/bartavelle/language-puppet.svg?branch=master)\n![cachix cachix orange](https://img.shields.io/badge/cachix-cachix-orange.svg)\n\nA library to work with Puppet manifests, test them and eventually replace everything ruby.\n\n# Install\n\n**Install with stack:**\n```\nstack install language-puppet\n```\n\n**Install with nix:**\n```\nnix-env -i -f https://github.com/bartavelle/language-puppet/tarball/v1.4.5\n```\n(replace `1.4.3` with any commit ref or tag).\n\n**Build from sources:**\n\n```\ngit clone https://github.com/bartavelle/language-puppet.git\ncd language-puppet\n# Using nix\nnix build\n# Using stack\nln -s stack-10.yaml stack.yaml\nstack build\n```\n\n# Puppetresources\n\n**Basic usage**\n\n    puppetresources --puppetdir /where/your/puppet/files/are --node node.name.com\n\nThe `puppetresources` command is a command line utility that let you\ninteractively compute catalogs on your local computer. It is much faster\nthan its ruby counterpart, and has been designed for giving assistance\nto the Puppet catalog writer.\n\nThere are 4 different modes:\n\n  - `--node` will display all resources on screen in a nice\n    user-friendly colored fashion.\n\n  - `--all` displays statistics and optionally shows dead code.\n\n  - `--parse` only goes as far as parsing. No interpretation.\n\n  - `--showcontent` to display file content.\n\nCatalog is not computed exactly the same way Puppet does. Some good\npractices are enforced. A strict and more permissive mode are provided.\n\n**Command line arguments**\n\n  - `-p` or `--puppetdir`\n    This argument is mandatory except in `parse` mode. It must point to\n    the base of the puppet directory (the directory that contains the\n    `modules` and `manifests` directories).\n\n  - `-o` or `--node`\n    Enable the `node mode`. This let you specify the name of the node\n    you wish to compute the catalog for.\n\n  - `-a` or `--all`\n    Enable the `stats mode`. If you specify `allnodes` it will compute\n    the catalogs for all nodes that are specified in `site.pp` (this\n    will not work for regexp-specified or the default nodes). You can\n    also specify a list of nodes separated by a comma.\n\n    Combined with `--deadcode`, it will display the list of puppet files\n    that have not been used.\n\n    This is useful as automated tests, to check a change didn’t break\n    something. You might want to run this option with `+RTS -N`.\n\n  - `-t` or `--type`\n    Filters the resources of the resulting catalog by type. Using PCRE\n    regex is supported.\n\n  - `-n` or `--name`\n    Filters the resources of the resulting catalog by name. Using PCRE\n    regex is supported.\n\n  - `-c` or `--showcontent`\n    If `-n` is the exact name of a file type resource defined in the\n    catalog, this will display the file content nicely. Useful for\n    debugging templates.\n\n    Example: `puppetresources -p . -o mynodename -n '/etc/motd'\n    --showcontent`\n\n  - `--loglevel` or `-v`\n    Possible values are : DEBUG, INFO, NOTICE, WARNING, ERROR\n\n  - `--pdburl`\n    Expects the url of a live PuppetDB.\n\n  - `--pdbfile`\n    Expects a path to a **fake** PuppetDB, represented as a YAML file on\n    disk. This option is pretty slow but can be invaluable to test\n    exported resources tricks.\n\n  - `--hiera`\n    Expects the path to the `hiera.yaml` file.\n\n  - `--ignoredmodules`\n    Expects a list of comma-separated modules. The interpreter will not\n    try to parse and evaluate the defined types and classes from this\n    module. This is useful for using modules that use bad practices\n    forbidden by `puppetresources`.\n\n  - `--commitdb`\n    When this flag is set, exported resources, catalogs and facts are\n    saved in the PuppetDB. This is useful in conjunction with\n    `--pdbfile`.\n\n  - `--checkExported`\n    When this flag is set, exported resources are saved in the PuppetDB.\n    This is useful in conjunction with `--pdbfile`.\n\n  - `-j` or `--JSON`\n    Displays the catalog as a Puppet-compatible JSON file, that can then\n    be used with `puppet apply`.\n\n  - `--strict`\n    Enable strict check. Strict is less permissive than vanilla Puppet.\n    It is meant to prevent some pitfalls by enforcing good practices.\n    For instance it refuses to\n\n      - silently ignore/convert `undef` variables\n\n      - lookup an hash with an unknown key and return `undef`.\n\n  - `--noextratests`\n    Disable the extra tests from `Puppet.OptionalTests`.\n\n  - `--parse`\n    Enable `parse mode`. Specify the puppet file to be parsed. Variables\n    are not resolved. No interpretation.\n\n  - `--version`\n    Output version information and exist.\n\n**Settings defaults using a yaml file**\n\nDefaults for some of these options can be set using a\n`/yourworkingdirectory/tests/defaults.yaml` file. For instance\n`OptionalTests` is checking that all users and groups are known. Because\nsome of these users and groups might be defined outside puppet, a list\nof known ones is used internally. This can be overridden in that file\nusing the key `knownusers` and `knowngroups`.\n\nPlease look at [the template\nfile](https://github.com/bartavelle/language-puppet/blob/master/tests/defaults.yaml)\nfor a list of possible defaults.\n\n# pdbQuery\n\nThe `pdbquery` command will work with different implementations of\nPuppetDB (the official one with its HTTP API, the file-based backend and\ndummy ones). It can be used to:\n\n  - export data from production PuppetDB to a file (in order to debug\n    some issue with `puppetresources`).\n  - query a Puppetdb\n\n**Command line arguments**\n\n  - `-l` or `--location`\n    The URL of the PuppetDB when working with a remote PuppetDB, a file\n    path when working with the file-based test implementation.\n\n  - `-t` or `--pdbtype`\n    The type of PuppetDB to work with:\n\n      - dummy: a dummy PuppetDB.\n\n      - remote: a \"real\" PuppetDB, accessed by its HTTP API.\n\n      - test: a file-based backend emulating a PuppetDB.\n\n\n  - `facts`\n    Output facts for a specific node (json)\n\n  - `nodes`\n    Output all nodes (json)\n\n  - `resources`\n    Output all resources for a specific node (json)\n\n  - `dumpfacts`\n    Dump all facts to `/tmp/allfacts.yaml`.\n\n  - `snapshot`\n    Create a test DB from the current DB\n\n  - `addfacts`\n    Adds facts to the test DB for the given node name, if they are not\n    already defined.\n\n  - `--version`\n    Output version information and exit.\n\n# Supported features\n\n  - Supported version\n    puppet 4 is mostly supported. Please look at the list of issues for\n    details.\n\n  - Custom ruby functions\n    The tool might bark when resolving custom ruby functions. These\n    function can easily be mocked or implemented in Haskell if\n    necessary.\n\n  - Puppet functions\n\n      - the `require` function is not supported (see [issue\n        \\#17](https://github.com/bartavelle/language-puppet/issues/17))\n\n      - the deprecated `import` function is not supported\n\n      - the deprecated node inheritance feature is not supported\n\n  - OS\n    Linux is the default OS. The tool has also been successfully\n    installed and used on `OS X`. Windows is not supported.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartavelle%2Flanguage-puppet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbartavelle%2Flanguage-puppet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartavelle%2Flanguage-puppet/lists"}