Skip to content

Commit 6a7bda9

Browse files
author
Gary Larizza
committed
Certname custom fact
This custom fact (hack) will print out the certname of the node.
1 parent e702146 commit 6a7bda9

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/facter/certname.rb

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Facter.add("certname") do
2+
path = '/usr/bin/puppet'
3+
setcode do
4+
%x{#{path} --configprint certname}.chomp if File.exists?(path)
5+
end
6+
end
7+

tests/certname.rb

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
notify{$certname:}

0 commit comments

Comments
 (0)