Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#
# nfs_versions.rb
#
# This fact provides ...
#
$nfs3 = false
$nfs4 = false
if Facter.value(:kernel) == 'Linux'
# We work-around an issue in Facter #10278 by forcing locale settings ...
ENV['LC_ALL'] = 'C'
Facter::Util::Resolution.exec('/bin/cat /proc/net/rpc/nfs').each_line do |line|
if line.match(/^proc3.+/)
$nfs3 = true
elsif line.match(/^proc4.+/)
$nfs4 = true
end
end
Facter.add('nfs3') do
confine :kernel => :linux
setcode do
"#{$nfs3}"
end
end
Facter.add('nfs4') do
confine :kernel => :linux
setcode do
"#{$nfs4}"
end
end
end