fauxhai-ng 8.0.0 → 8.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/bin/fauxhai +8 -8
  3. data/lib/.DS_Store +0 -0
  4. data/lib/fauxhai.rb +5 -5
  5. data/lib/fauxhai/.DS_Store +0 -0
  6. data/lib/fauxhai/fetcher.rb +9 -8
  7. data/lib/fauxhai/mocker.rb +14 -14
  8. data/lib/fauxhai/platforms/.DS_Store +0 -0
  9. data/lib/fauxhai/platforms/amazon/.DS_Store +0 -0
  10. data/lib/fauxhai/platforms/amazon/2.json +683 -660
  11. data/lib/fauxhai/platforms/amazon/2016.03.json +135 -135
  12. data/lib/fauxhai/platforms/amazon/2016.09.json +134 -134
  13. data/lib/fauxhai/platforms/amazon/2017.03.json +125 -125
  14. data/lib/fauxhai/platforms/amazon/2017.09.json +112 -112
  15. data/lib/fauxhai/platforms/amazon/2018.03.json +544 -551
  16. data/lib/fauxhai/platforms/centos/.DS_Store +0 -0
  17. data/lib/fauxhai/platforms/centos/5.11.json +1 -0
  18. data/lib/fauxhai/platforms/centos/6.10.json +314 -314
  19. data/lib/fauxhai/platforms/centos/6.9.json +1 -0
  20. data/lib/fauxhai/platforms/centos/7.5.1804.json +1 -0
  21. data/lib/fauxhai/platforms/centos/7.6.1810.json +40 -40
  22. data/lib/fauxhai/platforms/centos/7.7.1908.json +1512 -7517
  23. data/lib/fauxhai/platforms/centos/7.8.2003.json +3797 -0
  24. data/lib/fauxhai/platforms/centos/8.json +1229 -2348
  25. data/lib/fauxhai/platforms/debian/10.json +420 -208
  26. data/lib/fauxhai/platforms/debian/8.11.json +1 -0
  27. data/lib/fauxhai/platforms/debian/9.11.json +53 -44
  28. data/lib/fauxhai/platforms/debian/{8.10.json → 9.12.json} +994 -1644
  29. data/lib/fauxhai/platforms/debian/9.8.json +52 -42
  30. data/lib/fauxhai/platforms/debian/9.9.json +55 -45
  31. data/lib/fauxhai/platforms/fedora/29.json +1 -1
  32. data/lib/fauxhai/platforms/fedora/30.json +514 -506
  33. data/lib/fauxhai/platforms/fedora/31.json +734 -712
  34. data/lib/fauxhai/platforms/fedora/32.json +3547 -0
  35. data/lib/fauxhai/platforms/mac_os_x/10.15.json +268 -392
  36. data/lib/fauxhai/platforms/opensuse/15.0.json +4383 -37
  37. data/lib/fauxhai/platforms/opensuse/15.1.json +5775 -0
  38. data/lib/fauxhai/platforms/opensuse/15.2.json +5961 -0
  39. data/lib/fauxhai/platforms/oracle/5.11.json +1 -0
  40. data/lib/fauxhai/platforms/oracle/6.10.json +19 -19
  41. data/lib/fauxhai/platforms/oracle/6.9.json +1 -0
  42. data/lib/fauxhai/platforms/oracle/7.5.json +480 -496
  43. data/lib/fauxhai/platforms/oracle/7.6.json +39 -39
  44. data/lib/fauxhai/platforms/redhat/.DS_Store +0 -0
  45. data/lib/fauxhai/platforms/redhat/5.11.json +1 -0
  46. data/lib/fauxhai/platforms/redhat/6.10.json +49 -40
  47. data/lib/fauxhai/platforms/redhat/6.9.json +40 -31
  48. data/lib/fauxhai/platforms/redhat/7.4.json +57 -48
  49. data/lib/fauxhai/platforms/redhat/7.5.json +55 -45
  50. data/lib/fauxhai/platforms/redhat/7.6.json +508 -657
  51. data/lib/fauxhai/platforms/redhat/7.7.json +58 -49
  52. data/lib/fauxhai/platforms/redhat/7.8.json +3954 -0
  53. data/lib/fauxhai/platforms/redhat/8.json +942 -908
  54. data/lib/fauxhai/platforms/suse/.DS_Store +0 -0
  55. data/lib/fauxhai/platforms/suse/12.3.json +38 -40
  56. data/lib/fauxhai/platforms/suse/12.4.json +50 -52
  57. data/lib/fauxhai/platforms/suse/12.5.json +5922 -0
  58. data/lib/fauxhai/platforms/suse/15.json +999 -1001
  59. data/lib/fauxhai/platforms/ubuntu/.DS_Store +0 -0
  60. data/lib/fauxhai/platforms/ubuntu/16.04.json +291 -278
  61. data/lib/fauxhai/platforms/ubuntu/18.04.json +384 -377
  62. data/lib/fauxhai/platforms/ubuntu/20.04.json +4144 -0
  63. data/lib/fauxhai/runner.rb +27 -27
  64. data/lib/fauxhai/runner/default.rb +128 -128
  65. data/lib/fauxhai/runner/windows.rb +77 -77
  66. data/lib/fauxhai/version.rb +1 -1
  67. metadata +14 -18
  68. data/lib/fauxhai/platforms/aix/.DS_Store +0 -0
  69. data/lib/fauxhai/platforms/clearos/.DS_Store +0 -0
  70. data/lib/fauxhai/platforms/debian/8.9.json +0 -3614
  71. data/lib/fauxhai/platforms/freebsd/.DS_Store +0 -0
  72. data/lib/fauxhai/platforms/gentoo/.DS_Store +0 -0
  73. data/lib/fauxhai/platforms/linuxmint/.DS_Store +0 -0
  74. data/lib/fauxhai/platforms/mac_os_x/.DS_Store +0 -0
  75. data/lib/fauxhai/platforms/openbsd/.DS_Store +0 -0
  76. data/lib/fauxhai/platforms/raspbian/.DS_Store +0 -0
  77. data/lib/fauxhai/platforms/solaris2/.DS_Store +0 -0
  78. data/lib/fauxhai/platforms/windows/.DS_Store +0 -0
@@ -1,5 +1,5 @@
1
- require 'ohai'
2
- require 'ohai/plugins/chef'
1
+ require "ohai" unless defined?(Ohai::System)
2
+ require "ohai/plugins/chef"
3
3
 
4
4
  module Fauxhai
5
5
  class Runner
@@ -7,35 +7,35 @@ 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_relative 'runner/windows'
13
- self.singleton_class.send :include, ::Fauxhai::Runner::Windows
10
+ case @system.data["platform"]
11
+ when "windows", :windows
12
+ require_relative "runner/windows"
13
+ singleton_class.send :include, ::Fauxhai::Runner::Windows
14
14
  else
15
- require_relative 'runner/default'
16
- self.singleton_class.send :include, ::Fauxhai::Runner::Default
15
+ require_relative "runner/default"
16
+ singleton_class.send :include, ::Fauxhai::Runner::Default
17
17
  end
18
18
 
19
19
  result = @system.data.dup.delete_if { |k, v| !whitelist_attributes.include?(k) }.merge(
20
- 'languages' => languages,
21
- 'counters' => counters,
22
- 'current_user' => current_user,
23
- 'domain' => domain,
24
- 'hostname' => hostname,
25
- 'machinename' => hostname,
26
- 'fqdn' => fqdn,
27
- 'ipaddress' => ipaddress,
28
- 'keys' => keys,
29
- 'macaddress' => macaddress,
30
- 'network' => network,
31
- 'uptime' => uptime,
32
- 'uptime_seconds' => uptime_seconds,
33
- 'idle' => uptime,
34
- 'idletime_seconds' => uptime_seconds,
35
- 'cpu' => cpu,
36
- 'memory' => memory,
37
- 'virtualization' => virtualization,
38
- 'time' => time
20
+ "languages" => languages,
21
+ "counters" => counters,
22
+ "current_user" => current_user,
23
+ "domain" => domain,
24
+ "hostname" => hostname,
25
+ "machinename" => hostname,
26
+ "fqdn" => fqdn,
27
+ "ipaddress" => ipaddress,
28
+ "keys" => keys,
29
+ "macaddress" => macaddress,
30
+ "network" => network,
31
+ "uptime" => uptime,
32
+ "uptime_seconds" => uptime_seconds,
33
+ "idle" => uptime,
34
+ "idletime_seconds" => uptime_seconds,
35
+ "cpu" => cpu,
36
+ "memory" => memory,
37
+ "virtualization" => virtualization,
38
+ "time" => time
39
39
  )
40
40
 
41
41
  puts JSON.pretty_generate(result.sort.to_h)
@@ -2,51 +2,51 @@ module Fauxhai
2
2
  class Runner
3
3
  module Default
4
4
  def bin_dir
5
- '/usr/local/bin'
5
+ "/usr/local/bin"
6
6
  end
7
7
 
8
8
  def counters
9
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,
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
21
  },
22
- 'rx' => {
23
- 'bytes' => 0,
24
- 'packets' => 0,
25
- 'errors' => 0,
26
- 'drop' => 0,
27
- 'overrun' => 0,
22
+ "rx" => {
23
+ "bytes" => 0,
24
+ "packets" => 0,
25
+ "errors" => 0,
26
+ "drop" => 0,
27
+ "overrun" => 0,
28
28
  },
29
29
  },
30
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,
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
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,
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
50
  },
51
51
  },
52
52
  },
@@ -55,170 +55,170 @@ module Fauxhai
55
55
  end
56
56
 
57
57
  def current_user
58
- 'fauxhai'
58
+ "fauxhai"
59
59
  end
60
60
 
61
61
  def default_gateway
62
- '10.0.0.1'
62
+ "10.0.0.1"
63
63
  end
64
64
 
65
65
  def default_interface
66
- case @system.data['platform_family']
67
- when 'mac_os_x'
68
- 'en0'
66
+ case @system.data["platform_family"]
67
+ when "mac_os_x"
68
+ "en0"
69
69
  when /bsd/
70
- 'em0'
71
- when 'arch', 'fedora'
72
- 'enp0s3'
70
+ "em0"
71
+ when "arch", "fedora"
72
+ "enp0s3"
73
73
  else
74
- 'eth0'
74
+ "eth0"
75
75
  end
76
76
  end
77
77
 
78
78
  def domain
79
- 'local'
79
+ "local"
80
80
  end
81
81
 
82
82
  def fqdn
83
- 'fauxhai.local'
83
+ "fauxhai.local"
84
84
  end
85
85
 
86
86
  def gem_bin
87
- '/usr/local/bin/gem'
87
+ "/usr/local/bin/gem"
88
88
  end
89
89
 
90
90
  def gems_dir
91
- '/usr/local/gems'
91
+ "/usr/local/gems"
92
92
  end
93
93
 
94
94
  def hostname
95
- 'Fauxhai'
95
+ "Fauxhai"
96
96
  end
97
97
 
98
98
  def ipaddress
99
- '10.0.0.2'
99
+ "10.0.0.2"
100
100
  end
101
101
 
102
102
  def ip6address
103
- 'fe80:0:0:0:0:0:a00:2'
103
+ "fe80:0:0:0:0:0:a00:2"
104
104
  end
105
105
 
106
106
  def keys
107
107
  {
108
- 'ssh' => ssh,
108
+ "ssh" => ssh,
109
109
  }
110
110
  end
111
111
 
112
112
  def languages
113
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'],
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
119
  }
120
120
  end
121
121
 
122
122
  def macaddress
123
- '11:11:11:11:11:11'
123
+ "11:11:11:11:11:11"
124
124
  end
125
125
 
126
126
  def network
127
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',
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
140
  },
141
- '::1' => {
142
- 'family' => 'inet6',
143
- 'prefixlen' => '128',
144
- 'scope' => 'Node',
145
- 'tags' => [],
146
- 'ip_scope' => 'LINK LOCAL LOOPBACK',
141
+ "::1" => {
142
+ "family" => "inet6",
143
+ "prefixlen" => "128",
144
+ "scope" => "Node",
145
+ "tags" => [],
146
+ "ip_scope" => "LINK LOCAL LOOPBACK",
147
147
  },
148
148
  },
149
- 'state' => 'unknown',
149
+ "state" => "unknown",
150
150
  },
151
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' => {
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
158
  macaddress.to_s => {
159
- 'family' => 'lladdr',
159
+ "family" => "lladdr",
160
160
  },
161
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',
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
168
  },
169
- 'fe80::11:1111:1111:1111' => {
170
- 'family' => 'inet6',
171
- 'prefixlen' => '64',
172
- 'scope' => 'Link',
173
- 'tags' => [],
174
- 'ip_scope' => 'LINK LOCAL UNICAST',
169
+ "fe80::11:1111:1111:1111" => {
170
+ "family" => "inet6",
171
+ "prefixlen" => "64",
172
+ "scope" => "Link",
173
+ "tags" => [],
174
+ "ip_scope" => "LINK LOCAL UNICAST",
175
175
  },
176
176
  },
177
- 'state' => 'up',
178
- 'arp' => {
179
- '10.0.0.1' => 'fe:ff:ff:ff:ff:ff',
177
+ "state" => "up",
178
+ "arp" => {
179
+ "10.0.0.1" => "fe:ff:ff:ff:ff:ff",
180
180
  },
181
- 'routes' => [
181
+ "routes" => [
182
182
  {
183
- 'destination' => 'default',
184
- 'family' => 'inet',
185
- 'via' => default_gateway,
183
+ "destination" => "default",
184
+ "family" => "inet",
185
+ "via" => default_gateway,
186
186
  },
187
187
  {
188
- 'destination' => '10.0.0.0/24',
189
- 'family' => 'inet',
190
- 'scope' => 'link',
191
- 'proto' => 'kernel',
192
- 'src' => ipaddress,
188
+ "destination" => "10.0.0.0/24",
189
+ "family" => "inet",
190
+ "scope" => "link",
191
+ "proto" => "kernel",
192
+ "src" => ipaddress,
193
193
  },
194
194
  {
195
- 'destination' => 'fe80::/64',
196
- 'family' => 'inet6',
197
- 'metric' => '256',
198
- 'proto' => 'kernel',
195
+ "destination" => "fe80::/64",
196
+ "family" => "inet6",
197
+ "metric" => "256",
198
+ "proto" => "kernel",
199
199
  },
200
200
  ],
201
- 'ring_params' => {},
201
+ "ring_params" => {},
202
202
  },
203
203
  },
204
- 'default_interface' => default_interface,
205
- 'default_gateway' => default_gateway,
204
+ "default_interface" => default_interface,
205
+ "default_gateway" => default_gateway,
206
206
  }
207
207
  end
208
208
 
209
209
  def ruby_bin
210
- '/usr/local/bin/ruby'
210
+ "/usr/local/bin/ruby"
211
211
  end
212
212
 
213
213
  def ssh
214
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,
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
217
  }
218
218
  end
219
219
 
220
220
  def uptime
221
- '30 days 15 hours 07 minutes 30 seconds'
221
+ "30 days 15 hours 07 minutes 30 seconds"
222
222
  end
223
223
 
224
224
  def uptime_seconds
@@ -227,27 +227,27 @@ module Fauxhai
227
227
 
228
228
  def cpu
229
229
  {
230
- 'real' => 1,
231
- 'total' => 1,
232
- 'cores' => 1,
230
+ "real" => 1,
231
+ "total" => 1,
232
+ "cores" => 1,
233
233
  }
234
234
  end
235
235
 
236
236
  def memory
237
237
  {
238
- 'total' => '1048576kB',
238
+ "total" => "1048576kB",
239
239
  }
240
240
  end
241
241
 
242
242
  def virtualization
243
243
  {
244
- 'systems' => {},
244
+ "systems" => {},
245
245
  }
246
246
  end
247
247
 
248
248
  def time
249
249
  {
250
- 'timezone' => 'GMT',
250
+ "timezone" => "GMT",
251
251
  }
252
252
  end
253
253
 
@@ -256,7 +256,7 @@ module Fauxhai
256
256
  #
257
257
  # @return [Array] - the key of whitelisted attributes
258
258
  def whitelist_attributes
259
- %w(
259
+ %w{
260
260
  block_device
261
261
  chef_packages
262
262
  command
@@ -277,7 +277,7 @@ module Fauxhai
277
277
  root_group
278
278
  shard_seed
279
279
  shells
280
- )
280
+ }
281
281
  end
282
282
  end
283
283
  end