- check the cache file exists, and isnt empty - resolves idempotence for zpool-import-cache service Reviewed-on: #409
16 lines
299 B
Ruby
16 lines
299 B
Ruby
# frozen_string_literal: true
|
|
|
|
Facter.add('zfs_zpool_cache_present') do
|
|
confine kernel: 'Linux'
|
|
setcode do
|
|
cache_file = '/etc/zfs/zpool.cache'
|
|
File.exist?(cache_file) && File.size(cache_file).positive?
|
|
end
|
|
end
|
|
|
|
Facter.add('zfs_zpool_cache_present') do
|
|
setcode do
|
|
false
|
|
end
|
|
end
|