Changed 'plugins' directory name to 'lib' to reflect changes in 0.25+ puppet server.
This commit is contained in:
parent
05b0b8ab70
commit
24000d595c
6 changed files with 0 additions and 0 deletions
30
custom/lib/facter/console_type.rb
Normal file
30
custom/lib/facter/console_type.rb
Normal file
|
@ -0,0 +1,30 @@
|
|||
|
||||
Facter.add('console_type') do
|
||||
setcode do
|
||||
begin
|
||||
Facter.kernel
|
||||
rescue
|
||||
Facter.loadfacts()
|
||||
end
|
||||
console = 'vga'
|
||||
kernel = Facter.value('kernel')
|
||||
if kernel == 'Linux'
|
||||
File.open('/proc/cmdline', 'r') do |f|
|
||||
while line = f.gets
|
||||
if line =~ /console=ttyS[0-9]/
|
||||
console = 'serial'
|
||||
end
|
||||
end
|
||||
end
|
||||
elsif kernel == 'OpenBSD'
|
||||
File.open('/etc/boot.conf', 'r') do |f|
|
||||
while line = f.gets
|
||||
if line =~ /^set tty com[0-9]$/
|
||||
console = 'serial'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
console
|
||||
end
|
||||
end
|
8
custom/lib/facter/puppet_ssldir.rb
Normal file
8
custom/lib/facter/puppet_ssldir.rb
Normal file
|
@ -0,0 +1,8 @@
|
|||
require 'puppet'
|
||||
|
||||
Facter.add('puppet_ssldir') do
|
||||
setcode do
|
||||
Puppet.parse_config
|
||||
Puppet.settings.value('ssldir')
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue