Ask Your Question
3

Is there anyway to get the classes list available under all modules

asked 2013-09-18 05:47:09 -0500

chaitanya.yenugu gravatar image

I want to get all classes list that are available under all the modules. Is there any command to get the list?

edit retag flag offensive close merge delete

Comments

Thanks for the solutions. But, I am just looking more for a puppet command, instead of a shell command.

chaitanya.yenugu gravatar imagechaitanya.yenugu ( 2013-09-20 06:18:19 -0500 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2013-09-23 02:17:42 -0500

rahul khengare gravatar image

updated 2013-09-23 04:26:46 -0500

you can find the list of classes of all the modules in classes.txt file. Get the location of classes.txt file using classfile attribute present in puppet.conf file.

command for viewing the puppet configuration,

# puppet config print all

OR

# puppet config print classfile

edit flag offensive delete link more

Comments

The two above commands returned misleading info (```/var/lib/puppet/state/classes.txt``` is that a default?) --whereas the correct file location was ```/var/lib/puppet/classes.txt``` for my puppet 3.2.3.

markhu gravatar imagemarkhu ( 2015-07-28 18:31:21 -0500 )edit

The command to acquire the correct path is 'puppet config print --section agent classfile' Note that for the yum packages, puppetlabs delivers a different default in the puppet.conf So on rhel-based systems the path is by default set to /var/lib/puppet/classes.txt

pgassmann gravatar imagepgassmann ( 2016-02-10 06:30:39 -0500 )edit
1

answered 2013-09-18 07:07:21 -0500

Sneha More gravatar image

updated 2013-09-18 07:11:18 -0500

Go to your module directory and execute the command :

  find / -name '*.pp' -exec awk '/^class [a-zA-Z]/ {print $2}' {} \;

It will print all the classes in the respective module.

Or you have another way to to find classes by puppet doc as

 puppet doc --outputdir /root/puppetdoc --mode rdoc --manifestdir /etc/puppetlabs/puppet/manifests/ --modulepath /etc/puppetlabs/puppet/modules/

but in this case you will get output in html format.

I hope this will help you.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-09-18 05:47:09 -0500

Seen: 4,494 times

Last updated: Sep 23 '13