Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/voxpupuli/puppet-ghostbuster
π» Dead code detector for Puppet
https://github.com/voxpupuli/puppet-ghostbuster
cleanup code-quality hacktoberfest puppet puppet-lint puppetdb
Last synced: 22 days ago
JSON representation
π» Dead code detector for Puppet
- Host: GitHub
- URL: https://github.com/voxpupuli/puppet-ghostbuster
- Owner: voxpupuli
- License: apache-2.0
- Created: 2015-04-21T09:33:07.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-03-26T09:50:01.000Z (7 months ago)
- Last Synced: 2024-04-14T00:59:15.805Z (7 months ago)
- Topics: cleanup, code-quality, hacktoberfest, puppet, puppet-lint, puppetdb
- Language: Ruby
- Homepage:
- Size: 175 KB
- Stars: 91
- Watchers: 13
- Forks: 25
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-puppet - puppet-ghostbuster - Finds dead code by displaying unused classes, defined resources, template and files. Requires puppetdb 3+. (Puppet Tools)
README
puppet-ghostbuster
==================[![License](https://img.shields.io/github/license/voxpupuli/puppet-ghostbuster.svg)](https://github.com/voxpupuli/puppet-ghostbuster/blob/master/LICENSE)
[![Test](https://github.com/voxpupuli/puppet-ghostbuster/actions/workflows/test.yml/badge.svg)](https://github.com/voxpupuli/puppet-ghostbuster/actions/workflows/test.yml)
[![Release](https://github.com/voxpupuli/puppet-ghostbuster/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/puppet-ghostbuster/actions/workflows/release.yml)
[![RubyGem Version](https://img.shields.io/gem/v/puppet-ghostbuster.svg)](https://rubygems.org/gems/puppet-ghostbuster)
[![RubyGem Downloads](https://img.shields.io/gem/dt/puppet-ghostbuster.svg)](https://rubygems.org/gems/puppet-ghostbuster)
[![Donated by Camptocamp](https://img.shields.io/badge/donated%20by-camptocamp-fb7047.svg)](#transfer-notice)When you have dead puppet code hanging around ...
*Who you gonna call ?*This gems helps puppet users to find dead code by displaying unused classes, defined resources, template and files.
This gems only support PuppetDB APi v4 (PuppetDB 3+)
Usage
-----```shell
$ find . -type f -exec puppet-lint --only-checks ghostbuster_classes,ghostbuster_defines,ghostbuster_facts,ghostbuster_files,ghostbuster_functions,ghostbuster_hiera_files,ghostbuster_templates,ghostbuster_types {} \+
```Environment variables
---------------------### HIERA_YAML_PATH
The location of the `hiera.yaml` file. Defaults to `./hiera.yaml` or `/etc/puppetlabs/puppet/hiera.yaml` whichever is found first.
### PUPPETDB_URL
The url or the PuppetDB. Defaults to `http://puppetdb:8080`
### PUPPETDB_CACERT_FILE
Your siteβs CA certificate
### PUPPETDB_CERT_FILE
An SSL certificate signed by your siteβs Puppet CA
### PUPPETDB_KEY_FILE
The private key for that certificate
### PE_TOKEN
If set, PE token authentication will be used instead of certificate authentication.
Value may be a token _or_ path to a file containing a token.Plugins
-------### ghostbuster_classes
Find unused classes in PuppetDB.
### ghostbuster_defines
Find unused defined types in PuppetDB.
### ghostbuster_facts
Find unused facts in Puppet manifests and templates.
### ghostbuster_files
Find unused files in PuppetDB or in Puppet manifests.
### ghostbuster_functions
Find unused functions in Puppet manifests or templates.
### ghostbuster_hiera_files
Find unused hiera files in PuppetDB.
### ghostbuster_templates
Find unused templates in Puppet manifests.
### ghostbuster_types
Find unused types in Puppet manifests.
Example output
--------------TODO
```
$ find . -type f -exec puppet-lint --only-checks ghostbuster_classes,ghostbuster_defines,ghostbuster_files,ghostbuster_hiera_files,ghostbuster_templates {} \+
./modules/foo/manifests/install.pp - WARNING: Class Foo::Install seems unused on line 1
./modules/foo/manifests/service.pp - WARNING: Class Foo::Service seems unused on line 1
./modules/foo/manifests/init.pp - WARNING: Class Foo seems unused on line 1
./modules/bar/manifests/baz.pp - WARNING: Define Bar::Baz seems unused on line 1
./modules/modulename/templates/foo.erb - WARNING: Template modulename/foo.erb seems unused on line 1
./modules/modulename/templates/bar.erb - WARNING: Template modulename/bar.erb seems unused on line 1
./modules/modulename/templates/baz.erb - WARNING: Template modulename/baz.erb seems unused on line 1
./modules/foo/files/bar.txt - WARNING: File foo/bar.txt seems unused on line 1
./modules/foo/files/baz.txt - WARNING: File foo/baz.txt seems unused on line 1
```## Transfer Notice
This plugin was originally authored by [Camptocamp](http://www.camptocamp.com).
The maintainer preferred that Puppet Community take ownership of the module for future improvement and maintenance.
Existing pull requests and issues were transferred over, please fork and continue to contribute here instead of Camptocamp.Previously: https://github.com/camptocamp/puppet-ghostbuster