Sha256: 1c4a228e4fe80aaa59c15738f8b259d3681b91359951617f69718deddcb697d1
Contents?: true
Size: 1.87 KB
Versions: 2
Compression:
Stored size: 1.87 KB
Contents
puppet-ghostbuster ================== [![Build Status](https://img.shields.io/travis/camptocamp/puppet-ghostbuster.svg)](https://travis-ci.org/camptocamp/puppet-ghostbuster) [![Gem Version](https://img.shields.io/gem/v/puppet-ghostbuster.svg)](https://rubygems.org/gems/puppet-ghostbuster) [![Gem Downloads](https://img.shields.io/gem/dt/puppet-ghostbuster.svg)](https://rubygems.org/gems/puppet-ghostbuster) [![Gemnasium](https://img.shields.io/gemnasium/camptocamp/puppet-ghostbuster.svg)](https://gemnasium.com/camptocamp/puppet-ghostbuster) 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. Usage ----- If you want to read default options and private key from puppet configuration, this gem needs to have root (puppet) permissions. ``` sudo bundle exec puppet-ghostbuster ``` You can add preconnect command with ``-p`` and server url with ``-s``. ``-h`` or ``--help`` for full options. Example output -------------- ``` $ bundle exec puppet-ghostbuster -s https://puppetdburl:8081 Class Foo::Install not used Class Foo::Service not used Class Foo not used ... Define Bar::Baz not used ... Template ./modulename/templates/foo.erb not used Template ./modulename/templates/bar.erb not used Template ./modulename/templates/baz.erb not used ... File ./foo/files/bar.txt not used File ./foo/files/baz.txt not used ... ``` How It Works ------------ To find unused classes: 1. It search puppet code recursively starting (by default) from current directory. 2. For each .pp file found, it extract the class name 3. Query puppetdb (using cache) to find matching class in catalogs 4. Display the number of class, followed by the class name. Same method applies to find unused defines. To find template and files, it has to loop twice, so this step can be longer.
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
puppet-ghostbuster-0.2.0 | README.md |
puppet-ghostbuster-0.1.4 | README.md |