Class: Inspec::Resources::System
- Inherits:
-
Object
- Object
- Inspec::Resources::System
- Defined in:
- lib/inspec/resources/sys_info.rb
Overview
this resource returns additional system informatio
Instance Method Summary collapse
-
#hostname ⇒ Object
returns the hostname of the local system.
Instance Method Details
#hostname ⇒ Object
returns the hostname of the local system
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/inspec/resources/sys_info.rb', line 19 def hostname os = inspec.os if os.linux? || os.darwin? inspec.command("hostname").stdout.chomp elsif os.windows? inspec.powershell("$env:computername").stdout.chomp else skip_resource "The `sys_info.hostname` resource is not supported on your OS yet." end end |