how to see which classes are assigned to a node?

1,726 views
Skip to first unread message

Paul Archer

unread,
Dec 13, 2013, 5:29:33 PM12/13/13
to puppet...@googlegroups.com
I'm trying to get my classes setup in hiera, but I'm having some issues, and having problems troubleshooting them.
There doesn't seem to be any way to query either the puppetmaster or the client to get a list of the classes that the client actually gets.

Running 'puppet node find my.node.example.com' should spit out a list of classes, but it doesn't.

Any suggestions?

Mike Delaney

unread,
Dec 13, 2013, 5:45:30 PM12/13/13
to puppet...@googlegroups.com
On the client, the list of classes applied in the last successful puppet run should be written to $vardir/state/classes.txt


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/afa1919b-8824-404c-ad10-1666dbaf682e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Paul Archer

unread,
Dec 16, 2013, 2:17:45 PM12/16/13
to puppet...@googlegroups.com, mde...@computer.org
I don't have a 'classes.txt' file:

root@sftp-test2:/var/lib/puppet/state# l
total 44
drwxr-xr-x. 2 root root  4096 Dec  4 13:09 graphs
-rw-r-----. 1 root root 22128 Dec 13 10:40 last_run_report.yaml
-rw-r--r--. 1 root root   521 Dec 13 10:40 last_run_summary.yaml
-rw-r-----. 1 root root   263 Dec 13 10:40 resources.txt
-rw-rw----. 1 root root  5775 Dec 13 10:40 state.yaml

I ended up coming up with this (it works, but it's clunky):
grep /etc/puppet/modules last_run_* | awk '{print $3}' | awk -F/ '{print $5}' | sort -u

Paul Archer

unread,
Dec 16, 2013, 2:32:58 PM12/16/13
to puppet...@googlegroups.com, mde...@computer.org

grep /etc/puppet/modules /var/lib/puppet/state/last_run_report.yaml | awk '{print $2}' | awk -F/ '{print $5}' | sort -u
Reply all
Reply to author
Forward
0 new messages