fauxhai-chef 9.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +2 -0
  3. data/LICENSE +22 -0
  4. data/bin/fauxhai +23 -0
  5. data/fauxhai-chef.gemspec +28 -0
  6. data/lib/fauxhai/exception.rb +6 -0
  7. data/lib/fauxhai/fetcher.rb +80 -0
  8. data/lib/fauxhai/keys/id_dsa +12 -0
  9. data/lib/fauxhai/keys/id_dsa.pub +1 -0
  10. data/lib/fauxhai/keys/id_rsa +27 -0
  11. data/lib/fauxhai/keys/id_rsa.pub +1 -0
  12. data/lib/fauxhai/mocker.rb +143 -0
  13. data/lib/fauxhai/platforms/aix/7.1.json +1889 -0
  14. data/lib/fauxhai/platforms/aix/7.2.json +5289 -0
  15. data/lib/fauxhai/platforms/almalinux/8.json +5754 -0
  16. data/lib/fauxhai/platforms/amazon/2.json +4697 -0
  17. data/lib/fauxhai/platforms/amazon/2018.03.json +3525 -0
  18. data/lib/fauxhai/platforms/arch/4.10.13-1-ARCH.json +1669 -0
  19. data/lib/fauxhai/platforms/centos/6.10.json +2691 -0
  20. data/lib/fauxhai/platforms/centos/7.7.1908.json +3855 -0
  21. data/lib/fauxhai/platforms/centos/7.8.2003.json +3803 -0
  22. data/lib/fauxhai/platforms/centos/8.json +4715 -0
  23. data/lib/fauxhai/platforms/chefspec/0.6.1.json +20 -0
  24. data/lib/fauxhai/platforms/clearos/7.4.json +6130 -0
  25. data/lib/fauxhai/platforms/debian/10.json +2928 -0
  26. data/lib/fauxhai/platforms/debian/11.json +2744 -0
  27. data/lib/fauxhai/platforms/debian/9.11.json +2943 -0
  28. data/lib/fauxhai/platforms/debian/9.12.json +2942 -0
  29. data/lib/fauxhai/platforms/debian/9.13.json +2959 -0
  30. data/lib/fauxhai/platforms/dragonfly4/4.8-RELEASE.json +392 -0
  31. data/lib/fauxhai/platforms/fedora/31.json +3994 -0
  32. data/lib/fauxhai/platforms/fedora/32.json +3554 -0
  33. data/lib/fauxhai/platforms/freebsd/11.2.json +427 -0
  34. data/lib/fauxhai/platforms/freebsd/12.1.json +913 -0
  35. data/lib/fauxhai/platforms/gentoo/4.9.95-gentoo.json +989 -0
  36. data/lib/fauxhai/platforms/linuxmint/19.0.json +9649 -0
  37. data/lib/fauxhai/platforms/mac_os_x/10.14.json +1350 -0
  38. data/lib/fauxhai/platforms/mac_os_x/10.15.json +1510 -0
  39. data/lib/fauxhai/platforms/mac_os_x/11.0.json +2821 -0
  40. data/lib/fauxhai/platforms/mac_os_x/11.json +3356 -0
  41. data/lib/fauxhai/platforms/mac_os_x/12.json +3546 -0
  42. data/lib/fauxhai/platforms/openbsd/6.2.json +295 -0
  43. data/lib/fauxhai/platforms/opensuse/15.2.json +5967 -0
  44. data/lib/fauxhai/platforms/oracle/6.10.json +4349 -0
  45. data/lib/fauxhai/platforms/oracle/7.5.json +6576 -0
  46. data/lib/fauxhai/platforms/oracle/7.6.json +6591 -0
  47. data/lib/fauxhai/platforms/raspbian/10.json +3664 -0
  48. data/lib/fauxhai/platforms/redhat/6.10.json +5822 -0
  49. data/lib/fauxhai/platforms/redhat/7.7.json +3969 -0
  50. data/lib/fauxhai/platforms/redhat/7.8.json +3958 -0
  51. data/lib/fauxhai/platforms/redhat/7.9.json +3959 -0
  52. data/lib/fauxhai/platforms/redhat/8.json +4547 -0
  53. data/lib/fauxhai/platforms/rocky/8.json +5768 -0
  54. data/lib/fauxhai/platforms/smartos/5.11.json +1680 -0
  55. data/lib/fauxhai/platforms/solaris2/5.11.json +10290 -0
  56. data/lib/fauxhai/platforms/suse/12.4.json +5875 -0
  57. data/lib/fauxhai/platforms/suse/12.5.json +5012 -0
  58. data/lib/fauxhai/platforms/suse/15.json +6096 -0
  59. data/lib/fauxhai/platforms/ubuntu/16.04.json +3885 -0
  60. data/lib/fauxhai/platforms/ubuntu/18.04.json +4042 -0
  61. data/lib/fauxhai/platforms/ubuntu/20.04.json +4613 -0
  62. data/lib/fauxhai/platforms/windows/10.json +431 -0
  63. data/lib/fauxhai/platforms/windows/2012.json +404 -0
  64. data/lib/fauxhai/platforms/windows/2012R2.json +406 -0
  65. data/lib/fauxhai/platforms/windows/2016.json +408 -0
  66. data/lib/fauxhai/platforms/windows/2019.json +408 -0
  67. data/lib/fauxhai/platforms/windows/8.1.json +416 -0
  68. data/lib/fauxhai/runner/default.rb +284 -0
  69. data/lib/fauxhai/runner/windows.rb +101 -0
  70. data/lib/fauxhai/runner.rb +45 -0
  71. data/lib/fauxhai/version.rb +3 -0
  72. data/lib/fauxhai.rb +18 -0
  73. metadata +202 -0
@@ -0,0 +1,416 @@
1
+ {
2
+ "chef_packages": {
3
+ "chef": {
4
+ "chef_root": "C:/opscode/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.10.9-universal-mingw32/lib",
5
+ "version": "14.10.9"
6
+ },
7
+ "ohai": {
8
+ "ohai_root": "C:/opscode/chef/embedded/lib/ruby/gems/2.5.0/gems/ohai-14.8.10/lib/ohai",
9
+ "version": "14.8.10"
10
+ }
11
+ },
12
+ "command": {
13
+ },
14
+ "counters": {
15
+ "network": {
16
+ "interfaces": {
17
+ "0xe": {
18
+ "rx": {
19
+ "bytes": 0,
20
+ "compressed": 0,
21
+ "drop": 0,
22
+ "errors": 0,
23
+ "frame": 0,
24
+ "multicast": 0,
25
+ "overrun": 0,
26
+ "packets": 0
27
+ },
28
+ "tx": {
29
+ "bytes": 0,
30
+ "carrier": 0,
31
+ "collisions": 0,
32
+ "compressed": 0,
33
+ "drop": 0,
34
+ "errors": 0,
35
+ "overrun": 0,
36
+ "packets": 0
37
+ }
38
+ },
39
+ "lo": {
40
+ "rx": {
41
+ "bytes": 0,
42
+ "drop": 0,
43
+ "errors": 0,
44
+ "overrun": 0,
45
+ "packets": 0
46
+ },
47
+ "tx": {
48
+ "bytes": 0,
49
+ "carrier": 0,
50
+ "collisions": 0,
51
+ "drop": 0,
52
+ "errors": 0,
53
+ "packets": 0,
54
+ "queuelen": "1"
55
+ }
56
+ }
57
+ }
58
+ }
59
+ },
60
+ "cpu": {
61
+ "cores": 1,
62
+ "real": 1,
63
+ "total": 1
64
+ },
65
+ "current_user": "fauxhai",
66
+ "dmi": {
67
+ },
68
+ "domain": "local",
69
+ "filesystem": {
70
+ "A:": {
71
+ "fs_type": "",
72
+ "kb_available": 0,
73
+ "kb_size": 0,
74
+ "kb_used": 0,
75
+ "mount": "A:",
76
+ "percent_used": 0,
77
+ "volume_name": ""
78
+ },
79
+ "C:": {
80
+ "fs_type": "ntfs",
81
+ "kb_available": 119364108,
82
+ "kb_size": 137436852,
83
+ "kb_used": 18072744,
84
+ "mount": "C:",
85
+ "percent_used": 13,
86
+ "volume_name": ""
87
+ },
88
+ "D:": {
89
+ "encryption_status": "FullyDecrypted",
90
+ "fs_type": "ntfs",
91
+ "kb_available": 51567525,
92
+ "kb_size": 53685972,
93
+ "kb_used": 2118447,
94
+ "mount": "D:",
95
+ "percent_used": 3,
96
+ "volume_name": "temporary storage"
97
+ },
98
+ "E:": {
99
+ "fs_type": "",
100
+ "kb_available": 0,
101
+ "kb_size": 0,
102
+ "kb_used": 0,
103
+ "mount": "E:",
104
+ "percent_used": 0,
105
+ "volume_name": ""
106
+ }
107
+ },
108
+ "fips": {
109
+ "kernel": {
110
+ "enabled": false
111
+ }
112
+ },
113
+ "fqdn": "fauxhai.local",
114
+ "hostname": "Fauxhai",
115
+ "idle": "30 days 15 hours 07 minutes 30 seconds",
116
+ "idletime_seconds": 2646450,
117
+ "ipaddress": "10.0.0.2",
118
+ "kernel": {
119
+ "cs_info": {
120
+ "admin_password_status": 3,
121
+ "automatic_managed_pagefile": false,
122
+ "automatic_reset_boot_option": true,
123
+ "automatic_reset_capability": true,
124
+ "boot_option_on_limit": 0,
125
+ "boot_option_on_watch_dog": 0,
126
+ "boot_rom_supported": true,
127
+ "bootup_state": "Normal boot",
128
+ "caption": "win81",
129
+ "chassis_bootup_state": 3,
130
+ "current_time_zone": 0,
131
+ "daylight_in_effect": null,
132
+ "description": "AT/AT COMPATIBLE",
133
+ "dns_host_name": "win81",
134
+ "domain": "WORKGROUP",
135
+ "domain_role": 0,
136
+ "enable_daylight_savings_time": true,
137
+ "front_panel_reset_status": 3,
138
+ "hypervisor_present": true,
139
+ "infrared_supported": false,
140
+ "initial_load_info": null,
141
+ "install_date": null,
142
+ "keyboard_password_status": 3,
143
+ "last_load_info": null,
144
+ "manufacturer": "Microsoft Corporation",
145
+ "model": "Virtual Machine",
146
+ "name": "win81",
147
+ "name_format": null,
148
+ "network_server_mode_enabled": true,
149
+ "number_of_logical_processors": 2,
150
+ "number_of_processors": 1,
151
+ "oem_string_array": [
152
+ "[MS_VM_CERT/SHA1/9b80ca0d5dd061ec9da4e494f4c3fd1196270c22]",
153
+ "00000000000000000000000000000000",
154
+ "To be filed by MSFT"
155
+ ],
156
+ "part_of_domain": false,
157
+ "pause_after_reset": "3932100000",
158
+ "pc_system_type": 1,
159
+ "pc_system_type_ex": 1,
160
+ "power_management_capabilities": null,
161
+ "power_management_supported": null,
162
+ "power_on_password_status": 3,
163
+ "power_state": 0,
164
+ "power_supply_state": 3,
165
+ "primary_owner_contact": null,
166
+ "primary_owner_name": "Windows User",
167
+ "reset_capability": 1,
168
+ "reset_count": -1,
169
+ "reset_limit": -1,
170
+ "roles": [
171
+ "LM_Workstation",
172
+ "LM_Server",
173
+ "NT"
174
+ ],
175
+ "status": "OK",
176
+ "support_contact_description": null,
177
+ "system_startup_delay": null,
178
+ "system_startup_options": null,
179
+ "system_startup_setting": null,
180
+ "system_type": "x64-based PC",
181
+ "thermal_state": 1,
182
+ "total_physical_memory": "8589463552",
183
+ "user_name": null,
184
+ "wake_up_type": 6,
185
+ "workgroup": "WORKGROUP"
186
+ },
187
+ "machine": "x86_64",
188
+ "name": "Microsoft Windows 8.1 Enterprise N",
189
+ "os": "WINNT",
190
+ "os_info": {
191
+ "boot_device": "\\Device\\HarddiskVolume1",
192
+ "build_number": "9600",
193
+ "build_type": "Multiprocessor Free",
194
+ "caption": "Microsoft Windows 8.1 Enterprise N",
195
+ "code_set": "1252",
196
+ "country_code": "1",
197
+ "cs_name": "win81",
198
+ "csd_version": null,
199
+ "current_time_zone": 0,
200
+ "data_execution_prevention_32_bit_applications": true,
201
+ "data_execution_prevention_available": true,
202
+ "data_execution_prevention_drivers": true,
203
+ "data_execution_prevention_support_policy": 2,
204
+ "debug": false,
205
+ "description": "",
206
+ "distributed": false,
207
+ "encryption_level": 256,
208
+ "foreground_application_boost": 2,
209
+ "install_date": "20190130214616.000000+000",
210
+ "large_system_cache": null,
211
+ "last_boot_up_time": "20190130214440.541330+000",
212
+ "local_date_time": "20190130220322.654000+000",
213
+ "locale": "0409",
214
+ "manufacturer": "Microsoft Corporation",
215
+ "max_number_of_processes": -1,
216
+ "max_process_memory_size": "137438953344",
217
+ "mui_languages": [
218
+ "en-US"
219
+ ],
220
+ "name": "Microsoft Windows 8.1 Enterprise N|C:\\Windows|\\Device\\Harddisk0\\Partition1",
221
+ "number_of_licensed_users": 0,
222
+ "number_of_processes": 60,
223
+ "number_of_users": 2,
224
+ "operating_system_sku": 27,
225
+ "organization": "",
226
+ "os_architecture": "64-bit",
227
+ "os_language": 1033,
228
+ "os_product_suite": 256,
229
+ "os_type": 18,
230
+ "other_type_description": null,
231
+ "pae_enabled": null,
232
+ "plus_product_id": null,
233
+ "plus_version_number": null,
234
+ "portable_operating_system": false,
235
+ "primary": true,
236
+ "product_type": 1,
237
+ "registered_user": "Windows User",
238
+ "serial_number": "00261-40000-00000-AA383",
239
+ "service_pack_major_version": 0,
240
+ "service_pack_minor_version": 0,
241
+ "size_stored_in_paging_files": "1966080",
242
+ "status": "OK",
243
+ "suite_mask": 272,
244
+ "system_device": "\\Device\\HarddiskVolume1",
245
+ "system_directory": "C:\\Windows\\system32",
246
+ "system_drive": "C:",
247
+ "total_visible_memory_size": "8388148",
248
+ "version": "6.3.9600",
249
+ "windows_directory": "C:\\Windows"
250
+ },
251
+ "product_type": "Workstation",
252
+ "release": "6.3.9600",
253
+ "server_core": false,
254
+ "system_type": "Desktop",
255
+ "version": "6.3.9600 Build 9600"
256
+ },
257
+ "keys": {
258
+ "ssh": {
259
+ "host_dsa_public": "ssh-dss AAAAB3NzaC1kc3MAAACBAJFo9BLAw4WKEs5hgipk5m423FzBsDXCZSMcC9ca/om/1VYzMqImixGe3uICDzNFUWxFoLJTQAOccyzo6MXZiQqwWJDLFi5qOSr6w2XcMyE+zd4wOyMoDiVM5fizmG8K3FzrqvGjwBcHcBdOQnavSijoj38DN25J9zhrid5BY4WlAAAAFQDxXrCyG52XCzn3FV4ej38wJBkomQAAAIBovGPJ4mP2P6BK8lHl0PPbktwQbWlpJ13oz6REJFDVcUi7vV26bX/BjQX+ohzZQzljdz1SpUbPc/8nuA4darYkVh91eBi307EN8IdxRHj2eBgp/ZG4yshIebG3WHrwJD/xUjjZ1MRfyDT1ermVi4LvjjPgWDxLZnPpMaR6S1nzgQAAAIEAj0Vd6DCWslvlsZ8+N53HWsqPi3gnx35JoLPz9Z2epkKIKqmEHav+93G3hdfztVa4I4t3phoPniQchYryF5+RNg8hqxKzjNtrIqUYCeuf2NJrksNsH7OZygPHZpqt4kTuwAGZxjxEGfAI0y8DhkU2ntp2LnzRnWH106BQBCmcXwo= fauxhai.local",
260
+ "host_rsa_public": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCtLCeqtqr/HbnORckw1ukdLhpfGoOPFi5/esKEokzTqq1gsgQ2V8emmyjfq1i6XXfRtSBxkdlHv/GWdP5wBTuE2G85MzBkVSQPvmwQN8lX/JMPEEtKXkeOo0o92/PiSmvY4eRsdF0mw40Uvg7jtE3f3fxj497kzh5fKtkrHnF4x9gXCbVdr3FqXJfggR5IJwAxToerbK7x/uRS+7YuZI9Pip3tt14nv9ezwXcuGb/tvjWOZINiFl8izVIFKi7sxfTX09p4NgamxRS7TD2Yd0jT8nEoF9UZTsgXcJ1kDSx7N7NxFfNfP6rCdOGRRz4gUhXtsUjG/XkxPeCwZ7A9VnOD fauxhai.local"
261
+ }
262
+ },
263
+ "languages": {
264
+ "powershell": {
265
+ "build_version": "10.0.14409.1018",
266
+ "clr_version": "4.0.30319.42000",
267
+ "compatible_versions": [
268
+ "1.0",
269
+ "2.0",
270
+ "3.0",
271
+ "4.0",
272
+ "5.0",
273
+ "5.1.14409.1018"
274
+ ],
275
+ "remoting_protocol_version": "2.3",
276
+ "serialization_version": "1.1.0.1",
277
+ "version": "5.1.14409.1018",
278
+ "ws_man_stack_version": "3.0"
279
+ },
280
+ "ruby": {
281
+ "bin_dir": "/usr/local/bin",
282
+ "gem_bin": "/usr/local/bin/gem",
283
+ "gems_dir": "/usr/local/gems",
284
+ "ruby_bin": "/usr/local/bin/ruby"
285
+ }
286
+ },
287
+ "macaddress": "11:11:11:11:11:11",
288
+ "machinename": "Fauxhai",
289
+ "memory": {
290
+ "total": "1048576kB"
291
+ },
292
+ "network": {
293
+ "default_gateway": "10.0.0.1",
294
+ "default_interface": "0xe",
295
+ "interfaces": {
296
+ "0xe": {
297
+ "addresses": {
298
+ "10.0.0.2": {
299
+ "broadcast": "10.0.0.255",
300
+ "family": "inet",
301
+ "netmask": "255.255.255.0",
302
+ "prefixlen": "24"
303
+ },
304
+ "11:11:11:11:11:11": {
305
+ "family": "lladdr"
306
+ }
307
+ },
308
+ "arp": {
309
+ "10.0.0.1": "fe:ff:ff:ff:ff:ff"
310
+ },
311
+ "configuration": {
312
+ "caption": "[00000012] Ethernet Adapter",
313
+ "database_path": "%SystemRoot%\\System32\\drivers\\etc",
314
+ "default_ip_gateway": [
315
+ "default_gateway"
316
+ ],
317
+ "description": "Ethernet Adapter",
318
+ "dhcp_enabled": false,
319
+ "dns_domain_suffix_search_order": [
320
+ ],
321
+ "dns_enabled_for_wins_resolution": false,
322
+ "dns_host_name": "Fauxhai",
323
+ "domain_dns_registration_enabled": false,
324
+ "full_dns_registration_enabled": true,
325
+ "gateway_cost_metric": [
326
+ 0
327
+ ],
328
+ "index": 12,
329
+ "interface_index": 14,
330
+ "ip_address": [
331
+ "10.0.0.2"
332
+ ],
333
+ "ip_connection_metric": 5,
334
+ "ip_enabled": true,
335
+ "ip_filter_security_enabled": false,
336
+ "ip_sec_permit_ip_protocols": [
337
+ ],
338
+ "ip_sec_permit_tcp_ports": [
339
+ ],
340
+ "ip_sec_permit_udp_ports": [
341
+ ],
342
+ "ip_subnet": [
343
+ "255.255.255.0",
344
+ "64"
345
+ ],
346
+ "mac_address": "11:11:11:11:11:11",
347
+ "service_name": "netkvm",
348
+ "setting_id": "{00000000-0000-0000-0000-000000000000}",
349
+ "tcp_window_size": 64240,
350
+ "tcpip_netbios_options": 0,
351
+ "wins_enable_lm_hosts_lookup": true,
352
+ "wins_scope_id": ""
353
+ },
354
+ "counters": {
355
+ },
356
+ "encapsulation": "Ethernet",
357
+ "instance": {
358
+ "adapter_type": "Ethernet 802.3",
359
+ "adapter_type_id": 0,
360
+ "availability": 3,
361
+ "caption": "[00000012] Ethernet Adapter",
362
+ "config_manager_error_code": 0,
363
+ "config_manager_user_config": false,
364
+ "creation_class_name": "Win32_NetworkAdapter",
365
+ "description": "Ethernet Adapter",
366
+ "device_id": "12",
367
+ "guid": "{00000000-0000-0000-0000-000000000000}",
368
+ "index": 12,
369
+ "installed": true,
370
+ "interface_index": 14,
371
+ "mac_address": "11:11:11:11:11:11",
372
+ "manufacturer": "",
373
+ "max_number_controlled": 0,
374
+ "name": "Ethernet Adapter",
375
+ "net_connection_id": "Ethernet",
376
+ "net_connection_status": 2,
377
+ "net_enabled": true,
378
+ "physical_adapter": true,
379
+ "pnp_device_id": "PCI\\VEN_0000&DEV_0000&SUBSYS_000000000&REV_00\\0&0000000000&00",
380
+ "power_management_supported": false,
381
+ "product_name": "Ethernet Adapter",
382
+ "service_name": "netkvm",
383
+ "speed": "10000000000",
384
+ "system_creation_class_name": "Win32_ComputerSystem",
385
+ "system_name": "Fauxhai",
386
+ "time_of_last_reset": "20000101000001.000000+000"
387
+ },
388
+ "type": "Ethernet 802.3"
389
+ }
390
+ }
391
+ },
392
+ "ohai_time": 1548885810.973912,
393
+ "os": "windows",
394
+ "os_version": "6.3.9600",
395
+ "packages": {
396
+ "Chef Client v14.10.9": {
397
+ "installdate": "20190130",
398
+ "publisher": "Chef Software, Inc.",
399
+ "version": "14.10.9.1"
400
+ }
401
+ },
402
+ "platform": "windows",
403
+ "platform_family": "windows",
404
+ "platform_version": "6.3.9600",
405
+ "root_group": "Administrators",
406
+ "shard_seed": 176560041,
407
+ "time": {
408
+ "timezone": "GMT"
409
+ },
410
+ "uptime": "30 days 15 hours 07 minutes 30 seconds",
411
+ "uptime_seconds": 2646450,
412
+ "virtualization": {
413
+ "systems": {
414
+ }
415
+ }
416
+ }
@@ -0,0 +1,284 @@
1
+ module Fauxhai
2
+ class Runner
3
+ module Default
4
+ def bin_dir
5
+ "/usr/local/bin"
6
+ end
7
+
8
+ def counters
9
+ {
10
+ "network" => {
11
+ "interfaces" => {
12
+ "lo" => {
13
+ "tx" => {
14
+ "queuelen" => "1",
15
+ "bytes" => 0,
16
+ "packets" => 0,
17
+ "errors" => 0,
18
+ "drop" => 0,
19
+ "carrier" => 0,
20
+ "collisions" => 0,
21
+ },
22
+ "rx" => {
23
+ "bytes" => 0,
24
+ "packets" => 0,
25
+ "errors" => 0,
26
+ "drop" => 0,
27
+ "overrun" => 0,
28
+ },
29
+ },
30
+ default_interface.to_s => {
31
+ "rx" => {
32
+ "bytes" => 0,
33
+ "packets" => 0,
34
+ "errors" => 0,
35
+ "drop" => 0,
36
+ "overrun" => 0,
37
+ "frame" => 0,
38
+ "compressed" => 0,
39
+ "multicast" => 0,
40
+ },
41
+ "tx" => {
42
+ "bytes" => 0,
43
+ "packets" => 0,
44
+ "errors" => 0,
45
+ "drop" => 0,
46
+ "overrun" => 0,
47
+ "collisions" => 0,
48
+ "carrier" => 0,
49
+ "compressed" => 0,
50
+ },
51
+ },
52
+ },
53
+ },
54
+ }
55
+ end
56
+
57
+ def current_user
58
+ "fauxhai"
59
+ end
60
+
61
+ def default_gateway
62
+ "10.0.0.1"
63
+ end
64
+
65
+ def default_interface
66
+ case @system.data["platform_family"]
67
+ when "mac_os_x"
68
+ "en0"
69
+ when /bsd/
70
+ "em0"
71
+ when "arch", "fedora"
72
+ "enp0s3"
73
+ else
74
+ "eth0"
75
+ end
76
+ end
77
+
78
+ def domain
79
+ "local"
80
+ end
81
+
82
+ def fqdn
83
+ "fauxhai.local"
84
+ end
85
+
86
+ def gem_bin
87
+ "/usr/local/bin/gem"
88
+ end
89
+
90
+ def gems_dir
91
+ "/usr/local/gems"
92
+ end
93
+
94
+ def hostname
95
+ "Fauxhai"
96
+ end
97
+
98
+ def ipaddress
99
+ "10.0.0.2"
100
+ end
101
+
102
+ def ip6address
103
+ "fe80:0:0:0:0:0:a00:2"
104
+ end
105
+
106
+ def keys
107
+ {
108
+ "ssh" => ssh,
109
+ }
110
+ end
111
+
112
+ def languages
113
+ {
114
+ "ruby" => @system.data["languages"]["ruby"].merge("bin_dir" => bin_dir,
115
+ "gem_bin" => gem_bin,
116
+ "gems_dir" => gems_dir,
117
+ "ruby_bin" => ruby_bin),
118
+ "powershell" => @system.data["languages"]["powershell"],
119
+ }
120
+ end
121
+
122
+ def macaddress
123
+ "11:11:11:11:11:11"
124
+ end
125
+
126
+ def network
127
+ {
128
+ "interfaces" => {
129
+ "lo" => {
130
+ "mtu" => "65536",
131
+ "flags" => %w{LOOPBACK UP LOWER_UP},
132
+ "encapsulation" => "Loopback",
133
+ "addresses" => {
134
+ "127.0.0.1" => {
135
+ "family" => "inet",
136
+ "prefixlen" => "8",
137
+ "netmask" => "255.0.0.0",
138
+ "scope" => "Node",
139
+ "ip_scope" => "LOOPBACK",
140
+ },
141
+ "::1" => {
142
+ "family" => "inet6",
143
+ "prefixlen" => "128",
144
+ "scope" => "Node",
145
+ "tags" => [],
146
+ "ip_scope" => "LINK LOCAL LOOPBACK",
147
+ },
148
+ },
149
+ "state" => "unknown",
150
+ },
151
+ default_interface.to_s => {
152
+ "type" => default_interface.chop,
153
+ "number" => "0",
154
+ "mtu" => "1500",
155
+ "flags" => %w{BROADCAST MULTICAST UP LOWER_UP},
156
+ "encapsulation" => "Ethernet",
157
+ "addresses" => {
158
+ macaddress.to_s => {
159
+ "family" => "lladdr",
160
+ },
161
+ ipaddress.to_s => {
162
+ "family" => "inet",
163
+ "prefixlen" => "24",
164
+ "netmask" => "255.255.255.0",
165
+ "broadcast" => "10.0.0.255",
166
+ "scope" => "Global",
167
+ "ip_scope" => "RFC1918 PRIVATE",
168
+ },
169
+ "fe80::11:1111:1111:1111" => {
170
+ "family" => "inet6",
171
+ "prefixlen" => "64",
172
+ "scope" => "Link",
173
+ "tags" => [],
174
+ "ip_scope" => "LINK LOCAL UNICAST",
175
+ },
176
+ },
177
+ "state" => "up",
178
+ "arp" => {
179
+ "10.0.0.1" => "fe:ff:ff:ff:ff:ff",
180
+ },
181
+ "routes" => [
182
+ {
183
+ "destination" => "default",
184
+ "family" => "inet",
185
+ "via" => default_gateway,
186
+ },
187
+ {
188
+ "destination" => "10.0.0.0/24",
189
+ "family" => "inet",
190
+ "scope" => "link",
191
+ "proto" => "kernel",
192
+ "src" => ipaddress,
193
+ },
194
+ {
195
+ "destination" => "fe80::/64",
196
+ "family" => "inet6",
197
+ "metric" => "256",
198
+ "proto" => "kernel",
199
+ },
200
+ ],
201
+ "ring_params" => {},
202
+ },
203
+ },
204
+ "default_interface" => default_interface,
205
+ "default_gateway" => default_gateway,
206
+ }
207
+ end
208
+
209
+ def ruby_bin
210
+ "/usr/local/bin/ruby"
211
+ end
212
+
213
+ def ssh
214
+ {
215
+ "host_dsa_public" => File.read(File.join(Fauxhai.root, "lib", "fauxhai", "keys", "id_dsa.pub")).strip,
216
+ "host_rsa_public" => File.read(File.join(Fauxhai.root, "lib", "fauxhai", "keys", "id_rsa.pub")).strip,
217
+ }
218
+ end
219
+
220
+ def uptime
221
+ "30 days 15 hours 07 minutes 30 seconds"
222
+ end
223
+
224
+ def uptime_seconds
225
+ 2646450
226
+ end
227
+
228
+ def cpu
229
+ {
230
+ "real" => 1,
231
+ "total" => 1,
232
+ "cores" => 1,
233
+ }
234
+ end
235
+
236
+ def memory
237
+ {
238
+ "total" => "1048576kB",
239
+ }
240
+ end
241
+
242
+ def virtualization
243
+ {
244
+ "systems" => {},
245
+ }
246
+ end
247
+
248
+ def time
249
+ {
250
+ "timezone" => "GMT",
251
+ }
252
+ end
253
+
254
+ # Whitelist attributes are attributes that we *actually* want from the node. Other attributes are
255
+ # either ignored or overridden, but we ensure these are returned with the command.
256
+ #
257
+ # @return [Array] - the key of whitelisted attributes
258
+ def whitelist_attributes
259
+ %w{
260
+ block_device
261
+ chef_packages
262
+ command
263
+ dmi
264
+ filesystem
265
+ fips
266
+ init_package
267
+ kernel
268
+ lsb
269
+ ohai_time
270
+ os
271
+ os_version
272
+ packages
273
+ platform
274
+ platform_version
275
+ platform_build
276
+ platform_family
277
+ root_group
278
+ shard_seed
279
+ shells
280
+ }
281
+ end
282
+ end
283
+ end
284
+ end