Class: Specinfra::Command::Linux::Base::Inventory
- Inherits:
-
Base::Inventory
- Object
- Base
- Base::Inventory
- Specinfra::Command::Linux::Base::Inventory
- Defined in:
- lib/specinfra/command/linux/base/inventory.rb
Direct Known Subclasses
Class Method Summary collapse
- .get_block_device ⇒ Object
- .get_cpu ⇒ Object
- .get_domain ⇒ Object
- .get_filesystem ⇒ Object
- .get_fqdn ⇒ Object
- .get_hostname ⇒ Object
- .get_kernel ⇒ Object
- .get_memory ⇒ Object
- .get_system_product_name ⇒ Object
Methods inherited from Base
Class Method Details
permalink .get_block_device ⇒ Object
[View source]
31 32 33 34 |
# File 'lib/specinfra/command/linux/base/inventory.rb', line 31 def get_block_device block_device_dirs = '/sys/block/*/{size,removable,device/{model,rev,state,timeout,vendor},queue/rotational}' "for f in $(ls #{block_device_dirs}); do echo -e \"${f}\t$(cat ${f})\"; done" end |
permalink .get_cpu ⇒ Object
[View source]
7 8 9 |
# File 'lib/specinfra/command/linux/base/inventory.rb', line 7 def get_cpu 'cat /proc/cpuinfo' end |
permalink .get_domain ⇒ Object
[View source]
15 16 17 |
# File 'lib/specinfra/command/linux/base/inventory.rb', line 15 def get_domain 'dnsdomainname' end |
permalink .get_filesystem ⇒ Object
[View source]
23 24 25 |
# File 'lib/specinfra/command/linux/base/inventory.rb', line 23 def get_filesystem 'df -P' end |
permalink .get_fqdn ⇒ Object
[View source]
19 20 21 |
# File 'lib/specinfra/command/linux/base/inventory.rb', line 19 def get_fqdn 'hostname -f' end |
permalink .get_hostname ⇒ Object
[View source]
11 12 13 |
# File 'lib/specinfra/command/linux/base/inventory.rb', line 11 def get_hostname 'hostname -s' end |
permalink .get_kernel ⇒ Object
[View source]
27 28 29 |
# File 'lib/specinfra/command/linux/base/inventory.rb', line 27 def get_kernel 'uname -s -r' end |
permalink .get_memory ⇒ Object
[View source]
3 4 5 |
# File 'lib/specinfra/command/linux/base/inventory.rb', line 3 def get_memory 'cat /proc/meminfo' end |
permalink .get_system_product_name ⇒ Object
[View source]
36 37 38 |
# File 'lib/specinfra/command/linux/base/inventory.rb', line 36 def get_system_product_name "dmidecode -s system-product-name" end |