Module: ForemanMaintain::Utils::Facter
Constant Summary
collapse
- FACTER_FILES =
%w[/usr/bin/facter /opt/puppetlabs/bin/facter].freeze
Class Method Summary
collapse
#check_min_version, #clean_all_packages, #create_lv_snapshot, #directory_empty?, #downstream_installation?, #execute, #execute!, #execute?, #execute_with_status, #file_exists?, #find_dir_containing_file, #find_package, #find_symlinks, #format_shell_args, #get_lv_info, #get_lv_path, #hostname, included, #package_version, #packages_action, #parse_csv, #parse_json, #rpm_version, #server?, #service_exists?, #shellescape, #smart_proxy?, #systemd_installed?, #version
#check, #detector, #feature, #find_all_scenarios, #find_checks, #find_procedures, #find_scenarios, #procedure
#logger
Class Method Details
.os_major_release ⇒ Object
17
18
19
|
# File 'lib/foreman_maintain/utils/facter.rb', line 17
def self.os_major_release
execute!("#{path} operatingsystemmajrelease")
end
|
.package ⇒ Object
7
8
9
10
11
|
# File 'lib/foreman_maintain/utils/facter.rb', line 7
def self.package
puppet_version = version(execute!('puppet --version'))
puppet_version.major >= 4 ? 'puppet-agent' : 'facter'
end
|
.path ⇒ Object
13
14
15
|
# File 'lib/foreman_maintain/utils/facter.rb', line 13
def self.path
FACTER_FILES.find { |path| File.exist?(path) }
end
|