Class: PEBuild::Cap::Facts::Debian
- Defined in:
- lib/pe_build/cap/facts/debian.rb
Overview
Facts implementation for Debian guests
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#os_info ⇒ Hash
Returns info about the OS type.
-
#release_info ⇒ Hash
Returns info about the OS version.
Methods inherited from POSIX
Methods inherited from Base
#architecture, #basic_facts, #initialize, #load_facts, pebuild_facts, #puppet_path
Constructor Details
This class inherits a constructor from PEBuild::Cap::Facts::Base
Instance Method Details
#os_info ⇒ Hash
Returns info about the OS type
Returns family
as Debian
and name
as Debian
.
13 14 15 16 17 18 |
# File 'lib/pe_build/cap/facts/debian.rb', line 13 def os_info { 'name' => 'Debian', 'family' => 'Debian' } end |
#release_info ⇒ Hash
Returns info about the OS version
Reads /etc/debian_version
and generates a full
version along with
major
and minor
components.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/pe_build/cap/facts/debian.rb', line 26 def release_info release_file = sudo('cat /etc/debian_version')[:stdout] version = release_file.match(/(\d+\.\d+)/)[1] { 'major' => version.split('.', 2)[0], 'minor' => version.split('.', 2)[1], 'full' => version } end |