Giter VIP home page Giter VIP logo

puppet-ghostbuster's Introduction

puppet-ghostbuster

License Test Release RubyGem Version RubyGem Downloads Donated by Camptocamp

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

$ 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 /etc/puppetlabs/code/hiera.yaml

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. 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

puppet-ghostbuster's People

Contributors

mcanevet avatar raphink avatar bastelfreak avatar saimonn avatar zilchms avatar marek130 avatar dependabot[bot] avatar roidelapluie avatar daenney avatar ekohl avatar h0tw1r3 avatar phil0xf7 avatar roman-mueller avatar sher-chowdhury avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.