fauxhai 3.5.0 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +41 -13
  3. data/lib/fauxhai/platforms/aix/6.1.json +8 -5
  4. data/lib/fauxhai/platforms/aix/7.1.json +8 -7
  5. data/lib/fauxhai/platforms/amazon/2012.09.json +8 -5
  6. data/lib/fauxhai/platforms/amazon/2013.09.json +8 -5
  7. data/lib/fauxhai/platforms/amazon/2014.03.json +8 -5
  8. data/lib/fauxhai/platforms/amazon/2014.09.json +8 -5
  9. data/lib/fauxhai/platforms/amazon/2015.03.json +8 -5
  10. data/lib/fauxhai/platforms/amazon/2015.09.json +8 -5
  11. data/lib/fauxhai/platforms/amazon/2016.03.json +8 -5
  12. data/lib/fauxhai/platforms/arch/3.10.5-1-ARCH.json +8 -8
  13. data/lib/fauxhai/platforms/arch/4.5.4-1-ARCH.json +8 -5
  14. data/lib/fauxhai/platforms/centos/5.0.json +8 -5
  15. data/lib/fauxhai/platforms/centos/5.1.json +8 -5
  16. data/lib/fauxhai/platforms/centos/5.10.json +8 -5
  17. data/lib/fauxhai/platforms/centos/5.11.json +8 -5
  18. data/lib/fauxhai/platforms/centos/5.2.json +8 -5
  19. data/lib/fauxhai/platforms/centos/5.3.json +8 -5
  20. data/lib/fauxhai/platforms/centos/5.4.json +8 -5
  21. data/lib/fauxhai/platforms/centos/5.5.json +8 -5
  22. data/lib/fauxhai/platforms/centos/5.6.json +8 -5
  23. data/lib/fauxhai/platforms/centos/5.7.json +8 -5
  24. data/lib/fauxhai/platforms/centos/5.8.json +8 -5
  25. data/lib/fauxhai/platforms/centos/5.9.json +8 -5
  26. data/lib/fauxhai/platforms/centos/6.0.json +8 -5
  27. data/lib/fauxhai/platforms/centos/6.1.json +8 -5
  28. data/lib/fauxhai/platforms/centos/6.2.json +8 -5
  29. data/lib/fauxhai/platforms/centos/6.3.json +8 -5
  30. data/lib/fauxhai/platforms/centos/6.4.json +8 -5
  31. data/lib/fauxhai/platforms/centos/6.5.json +8 -5
  32. data/lib/fauxhai/platforms/centos/6.6.json +8 -5
  33. data/lib/fauxhai/platforms/centos/6.7.json +8 -5
  34. data/lib/fauxhai/platforms/centos/6.8.json +8 -5
  35. data/lib/fauxhai/platforms/centos/7.0.1406.json +8 -5
  36. data/lib/fauxhai/platforms/centos/7.0.json +8 -5
  37. data/lib/fauxhai/platforms/centos/7.1.1503.json +8 -5
  38. data/lib/fauxhai/platforms/centos/7.2.1511.json +8 -5
  39. data/lib/fauxhai/platforms/debian/6.0.5.json +10 -6
  40. data/lib/fauxhai/platforms/debian/7.0.json +10 -6
  41. data/lib/fauxhai/platforms/debian/7.1.json +10 -7
  42. data/lib/fauxhai/platforms/debian/7.10.json +8 -5
  43. data/lib/fauxhai/platforms/debian/7.2.json +8 -5
  44. data/lib/fauxhai/platforms/debian/7.4.json +8 -5
  45. data/lib/fauxhai/platforms/debian/7.5.json +8 -5
  46. data/lib/fauxhai/platforms/debian/7.6.json +8 -5
  47. data/lib/fauxhai/platforms/debian/7.7.json +8 -5
  48. data/lib/fauxhai/platforms/debian/7.8.json +8 -5
  49. data/lib/fauxhai/platforms/debian/7.9.json +8 -5
  50. data/lib/fauxhai/platforms/debian/8.0.json +8 -5
  51. data/lib/fauxhai/platforms/debian/8.1.json +8 -5
  52. data/lib/fauxhai/platforms/debian/8.2.json +8 -5
  53. data/lib/fauxhai/platforms/debian/8.4.json +8 -5
  54. data/lib/fauxhai/platforms/debian/jessie/sid.json +8 -5
  55. data/lib/fauxhai/platforms/debian/stretch/sid.json +8 -5
  56. data/lib/fauxhai/platforms/dragonfly4/4.2-RELEASE.json +8 -5
  57. data/lib/fauxhai/platforms/fedora/18.json +8 -5
  58. data/lib/fauxhai/platforms/fedora/19.json +8 -5
  59. data/lib/fauxhai/platforms/fedora/20.json +8 -5
  60. data/lib/fauxhai/platforms/fedora/21.json +8 -5
  61. data/lib/fauxhai/platforms/fedora/22.json +8 -5
  62. data/lib/fauxhai/platforms/fedora/23.json +8 -5
  63. data/lib/fauxhai/platforms/freebsd/10.0.json +9 -5
  64. data/lib/fauxhai/platforms/freebsd/10.1.json +9 -5
  65. data/lib/fauxhai/platforms/freebsd/10.2.json +9 -5
  66. data/lib/fauxhai/platforms/freebsd/10.3.json +8 -5
  67. data/lib/fauxhai/platforms/freebsd/8.4.json +9 -5
  68. data/lib/fauxhai/platforms/freebsd/9.1.json +9 -5
  69. data/lib/fauxhai/platforms/freebsd/9.2.json +9 -5
  70. data/lib/fauxhai/platforms/freebsd/9.3.json +9 -5
  71. data/lib/fauxhai/platforms/gentoo/2.1.json +10 -6
  72. data/lib/fauxhai/platforms/gentoo/2.2.json +8 -5
  73. data/lib/fauxhai/platforms/ios_xr/6.0.0.14I.json +8 -5
  74. data/lib/fauxhai/platforms/mac_os_x/10.10.json +8 -7
  75. data/lib/fauxhai/platforms/mac_os_x/10.11.1.json +8 -5
  76. data/lib/fauxhai/platforms/mac_os_x/10.6.8.json +10 -6
  77. data/lib/fauxhai/platforms/mac_os_x/10.7.4.json +10 -6
  78. data/lib/fauxhai/platforms/mac_os_x/10.8.2.json +10 -6
  79. data/lib/fauxhai/platforms/mac_os_x/10.9.2.json +7 -4
  80. data/lib/fauxhai/platforms/nexus/5.json +8 -5
  81. data/lib/fauxhai/platforms/omnios/151002.json +10 -6
  82. data/lib/fauxhai/platforms/omnios/151006.json +8 -5
  83. data/lib/fauxhai/platforms/omnios/151008.json +8 -5
  84. data/lib/fauxhai/platforms/omnios/151014.json +8 -5
  85. data/lib/fauxhai/platforms/omnios/151018.json +8 -5
  86. data/lib/fauxhai/platforms/openbsd/5.4.json +8 -5
  87. data/lib/fauxhai/platforms/opensuse/12.3.json +8 -5
  88. data/lib/fauxhai/platforms/opensuse/13.1.json +8 -5
  89. data/lib/fauxhai/platforms/opensuse/13.2.json +8 -5
  90. data/lib/fauxhai/platforms/opensuse/42.1.json +8 -5
  91. data/lib/fauxhai/platforms/oracle/5.10.json +8 -5
  92. data/lib/fauxhai/platforms/oracle/6.5.json +8 -5
  93. data/lib/fauxhai/platforms/oracle/6.6.json +8 -5
  94. data/lib/fauxhai/platforms/oracle/7.0.json +8 -5
  95. data/lib/fauxhai/platforms/oracle/7.1.json +8 -5
  96. data/lib/fauxhai/platforms/redhat/5.10.json +8 -5
  97. data/lib/fauxhai/platforms/redhat/5.6.json +8 -5
  98. data/lib/fauxhai/platforms/redhat/5.7.json +8 -5
  99. data/lib/fauxhai/platforms/redhat/5.8.json +10 -6
  100. data/lib/fauxhai/platforms/redhat/5.9.json +8 -5
  101. data/lib/fauxhai/platforms/redhat/6.0.json +8 -5
  102. data/lib/fauxhai/platforms/redhat/6.1.json +8 -5
  103. data/lib/fauxhai/platforms/redhat/6.2.json +8 -5
  104. data/lib/fauxhai/platforms/redhat/6.3.json +8 -5
  105. data/lib/fauxhai/platforms/redhat/6.4.json +8 -5
  106. data/lib/fauxhai/platforms/redhat/6.5.json +8 -5
  107. data/lib/fauxhai/platforms/redhat/6.6.json +8 -5
  108. data/lib/fauxhai/platforms/redhat/7.0.json +8 -5
  109. data/lib/fauxhai/platforms/redhat/7.1.json +8 -5
  110. data/lib/fauxhai/platforms/slackware/14.1.json +8 -8
  111. data/lib/fauxhai/platforms/smartos/5.11.json +8 -5
  112. data/lib/fauxhai/platforms/smartos/joyent_20130111T180733Z.json +9 -5
  113. data/lib/fauxhai/platforms/solaris2/5.10.json +8 -5
  114. data/lib/fauxhai/platforms/solaris2/5.11.json +8 -5
  115. data/lib/fauxhai/platforms/suse/11.1.json +8 -5
  116. data/lib/fauxhai/platforms/suse/11.2.json +8 -5
  117. data/lib/fauxhai/platforms/suse/11.3.json +8 -5
  118. data/lib/fauxhai/platforms/suse/12.0.json +8 -5
  119. data/lib/fauxhai/platforms/ubuntu/10.04.json +10 -6
  120. data/lib/fauxhai/platforms/ubuntu/12.04.json +8 -5
  121. data/lib/fauxhai/platforms/ubuntu/13.04.json +10 -6
  122. data/lib/fauxhai/platforms/ubuntu/13.10.json +8 -5
  123. data/lib/fauxhai/platforms/ubuntu/14.04.json +8 -5
  124. data/lib/fauxhai/platforms/ubuntu/14.10.json +8 -6
  125. data/lib/fauxhai/platforms/ubuntu/15.04.json +8 -5
  126. data/lib/fauxhai/platforms/ubuntu/15.10.json +8 -5
  127. data/lib/fauxhai/platforms/ubuntu/16.04.json +8 -5
  128. data/lib/fauxhai/platforms/windows/10.json +92 -27
  129. data/lib/fauxhai/platforms/windows/2003R2.json +92 -28
  130. data/lib/fauxhai/platforms/windows/2008R2.json +92 -27
  131. data/lib/fauxhai/platforms/windows/2012.json +92 -27
  132. data/lib/fauxhai/platforms/windows/2012R2.json +92 -27
  133. data/lib/fauxhai/platforms/windows/8.1.json +92 -27
  134. data/lib/fauxhai/platforms/windows/8.json +92 -27
  135. data/lib/fauxhai/runner.rb +9 -234
  136. data/lib/fauxhai/runner/default.rb +240 -0
  137. data/lib/fauxhai/runner/windows.rb +101 -0
  138. data/lib/fauxhai/version.rb +1 -1
  139. metadata +4 -2
@@ -3462,43 +3462,108 @@
3462
3462
  },
3463
3463
  "macaddress": "11:11:11:11:11:11",
3464
3464
  "network": {
3465
- "default_gateway": "10.0.0.1",
3466
- "default_interface": "eth0",
3467
- "settings": {
3468
- },
3469
3465
  "interfaces": {
3470
- "eth0": {
3466
+ "0xe": {
3467
+ "configuration": {
3468
+ "caption": "[00000012] Ethernet Adapter",
3469
+ "database_path": "%SystemRoot%\\System32\\drivers\\etc",
3470
+ "default_ip_gateway": [
3471
+ "default_gateway"
3472
+ ],
3473
+ "description": "Ethernet Adapter",
3474
+ "dhcp_enabled": false,
3475
+ "dns_domain_suffix_search_order": [
3476
+
3477
+ ],
3478
+ "dns_enabled_for_wins_resolution": false,
3479
+ "dns_host_name": "Fauxhai",
3480
+ "domain_dns_registration_enabled": false,
3481
+ "full_dns_registration_enabled": true,
3482
+ "gateway_cost_metric": [
3483
+ 0
3484
+ ],
3485
+ "index": 12,
3486
+ "interface_index": 14,
3487
+ "ip_address": [
3488
+ "10.0.0.2"
3489
+ ],
3490
+ "ip_connection_metric": 5,
3491
+ "ip_enabled": true,
3492
+ "ip_filter_security_enabled": false,
3493
+ "ip_sec_permit_ip_protocols": [
3494
+
3495
+ ],
3496
+ "ip_sec_permit_tcp_ports": [
3497
+
3498
+ ],
3499
+ "ip_sec_permit_udp_ports": [
3500
+
3501
+ ],
3502
+ "ip_subnet": [
3503
+ "255.255.255.0",
3504
+ "64"
3505
+ ],
3506
+ "mac_address": "11:11:11:11:11:11",
3507
+ "service_name": "netkvm",
3508
+ "setting_id": "{00000000-0000-0000-0000-000000000000}",
3509
+ "tcpip_netbios_options": 0,
3510
+ "tcp_window_size": 64240,
3511
+ "wins_enable_lm_hosts_lookup": true,
3512
+ "wins_scope_id": ""
3513
+ },
3514
+ "instance": {
3515
+ "adapter_type": "Ethernet 802.3",
3516
+ "adapter_type_id": 0,
3517
+ "availability": 3,
3518
+ "caption": "[00000012] Ethernet Adapter",
3519
+ "config_manager_error_code": 0,
3520
+ "config_manager_user_config": false,
3521
+ "creation_class_name": "Win32_NetworkAdapter",
3522
+ "description": "Ethernet Adapter",
3523
+ "device_id": "12",
3524
+ "guid": "{00000000-0000-0000-0000-000000000000}",
3525
+ "index": 12,
3526
+ "installed": true,
3527
+ "interface_index": 14,
3528
+ "mac_address": "11:11:11:11:11:11",
3529
+ "manufacturer": "",
3530
+ "max_number_controlled": 0,
3531
+ "name": "Ethernet Adapter",
3532
+ "net_connection_id": "Ethernet",
3533
+ "net_connection_status": 2,
3534
+ "net_enabled": true,
3535
+ "physical_adapter": true,
3536
+ "pnp_device_id": "PCI\\VEN_0000&DEV_0000&SUBSYS_000000000&REV_00\\0&0000000000&00",
3537
+ "power_management_supported": false,
3538
+ "product_name": "Ethernet Adapter",
3539
+ "service_name": "netkvm",
3540
+ "speed": "10000000000",
3541
+ "system_creation_class_name": "Win32_ComputerSystem",
3542
+ "system_name": "Fauxhai",
3543
+ "time_of_last_reset": "20000101000001.000000+000"
3544
+ },
3545
+ "counters": {
3546
+ },
3471
3547
  "addresses": {
3472
3548
  "10.0.0.2": {
3473
- "broadcast": "10.0.0.255",
3474
- "family": "inet",
3549
+ "prefixlen": "24",
3475
3550
  "netmask": "255.255.255.0",
3476
- "prefixlen": "23",
3477
- "scope": "Global"
3551
+ "broadcast": "10.0.0.255",
3552
+ "family": "inet"
3553
+ },
3554
+ "11:11:11:11:11:11": {
3555
+ "family": "lladdr"
3478
3556
  }
3479
3557
  },
3558
+ "type": "Ethernet 802.3",
3480
3559
  "arp": {
3481
3560
  "10.0.0.1": "fe:ff:ff:ff:ff:ff"
3482
3561
  },
3483
- "encapsulation": "Ethernet",
3484
- "flags": [
3485
- "BROADCAST",
3486
- "MULTICAST",
3487
- "UP",
3488
- "LOWER_UP"
3489
- ],
3490
- "mtu": "1500",
3491
- "number": "0",
3492
- "routes": {
3493
- "10.0.0.0/255": {
3494
- "scope": "link",
3495
- "src": "10.0.0.2"
3496
- }
3497
- },
3498
- "state": "up",
3499
- "type": "eth"
3562
+ "encapsulation": "Ethernet"
3500
3563
  }
3501
- }
3564
+ },
3565
+ "default_gateway": "10.0.0.1",
3566
+ "default_interface": "0xe"
3502
3567
  },
3503
3568
  "uptime": "30 days 15 hours 07 minutes 30 seconds",
3504
3569
  "uptime_seconds": 2646450,
@@ -3876,43 +3876,108 @@
3876
3876
  },
3877
3877
  "macaddress": "11:11:11:11:11:11",
3878
3878
  "network": {
3879
- "default_gateway": "10.0.0.1",
3880
- "default_interface": "eth0",
3881
- "settings": {
3882
- },
3883
3879
  "interfaces": {
3884
- "eth0": {
3880
+ "0xe": {
3881
+ "configuration": {
3882
+ "caption": "[00000012] Ethernet Adapter",
3883
+ "database_path": "%SystemRoot%\\System32\\drivers\\etc",
3884
+ "default_ip_gateway": [
3885
+ "default_gateway"
3886
+ ],
3887
+ "description": "Ethernet Adapter",
3888
+ "dhcp_enabled": false,
3889
+ "dns_domain_suffix_search_order": [
3890
+
3891
+ ],
3892
+ "dns_enabled_for_wins_resolution": false,
3893
+ "dns_host_name": "Fauxhai",
3894
+ "domain_dns_registration_enabled": false,
3895
+ "full_dns_registration_enabled": true,
3896
+ "gateway_cost_metric": [
3897
+ 0
3898
+ ],
3899
+ "index": 12,
3900
+ "interface_index": 14,
3901
+ "ip_address": [
3902
+ "10.0.0.2"
3903
+ ],
3904
+ "ip_connection_metric": 5,
3905
+ "ip_enabled": true,
3906
+ "ip_filter_security_enabled": false,
3907
+ "ip_sec_permit_ip_protocols": [
3908
+
3909
+ ],
3910
+ "ip_sec_permit_tcp_ports": [
3911
+
3912
+ ],
3913
+ "ip_sec_permit_udp_ports": [
3914
+
3915
+ ],
3916
+ "ip_subnet": [
3917
+ "255.255.255.0",
3918
+ "64"
3919
+ ],
3920
+ "mac_address": "11:11:11:11:11:11",
3921
+ "service_name": "netkvm",
3922
+ "setting_id": "{00000000-0000-0000-0000-000000000000}",
3923
+ "tcpip_netbios_options": 0,
3924
+ "tcp_window_size": 64240,
3925
+ "wins_enable_lm_hosts_lookup": true,
3926
+ "wins_scope_id": ""
3927
+ },
3928
+ "instance": {
3929
+ "adapter_type": "Ethernet 802.3",
3930
+ "adapter_type_id": 0,
3931
+ "availability": 3,
3932
+ "caption": "[00000012] Ethernet Adapter",
3933
+ "config_manager_error_code": 0,
3934
+ "config_manager_user_config": false,
3935
+ "creation_class_name": "Win32_NetworkAdapter",
3936
+ "description": "Ethernet Adapter",
3937
+ "device_id": "12",
3938
+ "guid": "{00000000-0000-0000-0000-000000000000}",
3939
+ "index": 12,
3940
+ "installed": true,
3941
+ "interface_index": 14,
3942
+ "mac_address": "11:11:11:11:11:11",
3943
+ "manufacturer": "",
3944
+ "max_number_controlled": 0,
3945
+ "name": "Ethernet Adapter",
3946
+ "net_connection_id": "Ethernet",
3947
+ "net_connection_status": 2,
3948
+ "net_enabled": true,
3949
+ "physical_adapter": true,
3950
+ "pnp_device_id": "PCI\\VEN_0000&DEV_0000&SUBSYS_000000000&REV_00\\0&0000000000&00",
3951
+ "power_management_supported": false,
3952
+ "product_name": "Ethernet Adapter",
3953
+ "service_name": "netkvm",
3954
+ "speed": "10000000000",
3955
+ "system_creation_class_name": "Win32_ComputerSystem",
3956
+ "system_name": "Fauxhai",
3957
+ "time_of_last_reset": "20000101000001.000000+000"
3958
+ },
3959
+ "counters": {
3960
+ },
3885
3961
  "addresses": {
3886
3962
  "10.0.0.2": {
3887
- "broadcast": "10.0.0.255",
3888
- "family": "inet",
3963
+ "prefixlen": "24",
3889
3964
  "netmask": "255.255.255.0",
3890
- "prefixlen": "23",
3891
- "scope": "Global"
3965
+ "broadcast": "10.0.0.255",
3966
+ "family": "inet"
3967
+ },
3968
+ "11:11:11:11:11:11": {
3969
+ "family": "lladdr"
3892
3970
  }
3893
3971
  },
3972
+ "type": "Ethernet 802.3",
3894
3973
  "arp": {
3895
3974
  "10.0.0.1": "fe:ff:ff:ff:ff:ff"
3896
3975
  },
3897
- "encapsulation": "Ethernet",
3898
- "flags": [
3899
- "BROADCAST",
3900
- "MULTICAST",
3901
- "UP",
3902
- "LOWER_UP"
3903
- ],
3904
- "mtu": "1500",
3905
- "number": "0",
3906
- "routes": {
3907
- "10.0.0.0/255": {
3908
- "scope": "link",
3909
- "src": "10.0.0.2"
3910
- }
3911
- },
3912
- "state": "up",
3913
- "type": "eth"
3976
+ "encapsulation": "Ethernet"
3914
3977
  }
3915
- }
3978
+ },
3979
+ "default_gateway": "10.0.0.1",
3980
+ "default_interface": "0xe"
3916
3981
  },
3917
3982
  "uptime": "30 days 15 hours 07 minutes 30 seconds",
3918
3983
  "uptime_seconds": 2646450,
@@ -7,6 +7,15 @@ module Fauxhai
7
7
  @system = Ohai::System.new
8
8
  @system.all_plugins
9
9
 
10
+ case @system.data['platform']
11
+ when 'windows', :windows
12
+ require 'fauxhai/runner/windows'
13
+ self.singleton_class.send :include, ::Fauxhai::Runner::Windows
14
+ else
15
+ require 'fauxhai/runner/default'
16
+ self.singleton_class.send :include, ::Fauxhai::Runner::Default
17
+ end
18
+
10
19
  result = @system.data.dup.delete_if { |k, v| !whitelist_attributes.include?(k) }.merge(
11
20
  'languages' => languages,
12
21
  'chef_packages' => chef_packages,
@@ -29,239 +38,5 @@ module Fauxhai
29
38
 
30
39
  puts JSON.pretty_generate(result)
31
40
  end
32
-
33
- private
34
-
35
- def bin_dir
36
- '/usr/local/bin'
37
- end
38
-
39
- def chef_packages
40
- return {} if @system.data['chef_packages'].nil?
41
-
42
- chef_version = @system.data['chef_packages']['chef']['version']
43
- ohai_version = @system.data['chef_packages']['ohai']['version']
44
-
45
- {
46
- 'chef' => {
47
- 'version' => chef_version,
48
- 'chef_root' => ['/opt/chef/embedded/lib/ruby/gems/2.1.0/gems', "chef-#{chef_version}", 'lib'].join('/')
49
- },
50
- 'ohai' => {
51
- 'version' => ohai_version,
52
- 'ohai_root' => ['/opt/chef/embedded/lib/ruby/gems/2.1.0/gems', "ohai-#{ohai_version}", 'lib', 'ohai'].join('/')
53
- }
54
- }
55
- end
56
-
57
- def counters
58
- {
59
- 'network' => {
60
- 'interfaces' => {
61
- 'eth0' => {
62
- 'rx' => {
63
- 'bytes' => '0',
64
- 'packets' => '0',
65
- 'errors' => '0',
66
- 'drop' => 0,
67
- 'overrun' => 0,
68
- 'frame' => 0,
69
- 'compressed' => 0,
70
- 'multicast' => 0
71
- },
72
- 'tx' => {
73
- 'bytes' => '342',
74
- 'packets' => '0',
75
- 'errors' => '0',
76
- 'drop' => 0,
77
- 'overrun' => 0,
78
- 'collisions' => '0',
79
- 'carrier' => 0,
80
- 'compressed' => 0
81
- }
82
- }
83
- }
84
- }
85
- }
86
- end
87
-
88
- def current_user
89
- 'fauxhai'
90
- end
91
-
92
- def default_gateway
93
- '10.0.0.1'
94
- end
95
-
96
- def default_interface
97
- 'eth0'
98
- end
99
-
100
- def domain
101
- 'local'
102
- end
103
-
104
- def etc
105
- {
106
- 'passwd' => {
107
- 'fauxhai' => {
108
- 'dir' => '/home/fauxhai',
109
- 'gid' => 0,
110
- 'uid' => 0,
111
- 'shell' => '/bin/bash',
112
- 'gecos' => 'Fauxhai'
113
- }
114
- },
115
- 'group' => {
116
- 'fauxhai' => {
117
- 'gid' => 0,
118
- 'members' => [
119
- 'fauxhai'
120
- ]
121
- }
122
- }
123
- }
124
- end
125
-
126
- def fqdn
127
- 'fauxhai.local'
128
- end
129
-
130
- def gem_bin
131
- '/usr/local/bin/gem'
132
- end
133
-
134
- def gems_dir
135
- '/usr/local/gems'
136
- end
137
-
138
- def hostname
139
- 'Fauxhai'
140
- end
141
-
142
- def ipaddress
143
- '10.0.0.2'
144
- end
145
-
146
- def ip6address
147
- 'fe80:0:0:0:0:0:a00:2'
148
- end
149
-
150
- def keys
151
- {
152
- 'ssh' => ssh
153
- }
154
- end
155
-
156
- def languages
157
- {
158
- 'ruby' => @system.data['languages']['ruby'].merge('bin_dir' => bin_dir,
159
- 'gem_bin' => gem_bin,
160
- 'gems_dir' => gems_dir,
161
- 'ruby_bin' => ruby_bin),
162
- 'powershell' => @system.data['languages']['powershell']
163
- }
164
- end
165
-
166
- def macaddress
167
- '11:11:11:11:11:11'
168
- end
169
-
170
- def network
171
- {
172
- 'default_gateway' => default_gateway,
173
- 'default_interface' => default_interface,
174
- 'settings' => {},
175
- 'interfaces' => {
176
- 'eth0' => {
177
- 'addresses' => {
178
- '10.0.0.2' => {
179
- 'broadcast' => '10.0.0.255',
180
- 'family' => 'inet',
181
- 'netmask' => '255.255.255.0',
182
- 'prefixlen' => '23',
183
- 'scope' => 'Global'
184
- }
185
- },
186
- 'arp' => {
187
- '10.0.0.1' => 'fe:ff:ff:ff:ff:ff'
188
- },
189
- 'encapsulation' => 'Ethernet',
190
- 'flags' => %w(BROADCAST MULTICAST UP LOWER_UP),
191
- 'mtu' => '1500',
192
- 'number' => '0',
193
- 'routes' => {
194
- '10.0.0.0/255' => {
195
- 'scope' => 'link',
196
- 'src' => '10.0.0.2'
197
- }
198
- },
199
- 'state' => 'up',
200
- 'type' => 'eth'
201
- }
202
- }
203
- }
204
- end
205
-
206
- def ruby_bin
207
- '/usr/local/bin/ruby'
208
- end
209
-
210
- def ssh
211
- {
212
- 'host_dsa_public' => File.read( File.join(Fauxhai.root, 'lib', 'fauxhai', 'keys', 'id_dsa.pub') ).strip,
213
- 'host_rsa_public' => File.read( File.join(Fauxhai.root, 'lib', 'fauxhai', 'keys', 'id_rsa.pub') ).strip
214
- }
215
- end
216
-
217
- def uptime
218
- '30 days 15 hours 07 minutes 30 seconds'
219
- end
220
-
221
- def uptime_seconds
222
- 2646450
223
- end
224
-
225
- def cpu
226
- {
227
- 'real' => 1,
228
- 'total' => 1,
229
- 'cores' => 1
230
- }
231
- end
232
-
233
- def memory
234
- {
235
- 'total' => '1048576kB'
236
- }
237
- end
238
-
239
- def virtualization
240
- {
241
- 'systems' => {}
242
- }
243
- end
244
-
245
- # Whitelist attributes are attributes that we *actually* want from the node. Other attributes are
246
- # either ignored or overridden, but we ensure these are returned with the command.
247
- #
248
- # @return [Array] - the key of whitelisted attributes
249
- def whitelist_attributes
250
- %w(
251
- command
252
- dmi
253
- filesystem
254
- kernel
255
- lsb
256
- ohai_time
257
- os
258
- os_version
259
- platform
260
- platform_version
261
- platform_build
262
- platform_family
263
- init_package
264
- root_group)
265
- end
266
41
  end
267
42
  end