fauxhai-ng 7.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +22 -0
  3. data/bin/fauxhai +23 -0
  4. data/lib/.DS_Store +0 -0
  5. data/lib/fauxhai.rb +18 -0
  6. data/lib/fauxhai/.DS_Store +0 -0
  7. data/lib/fauxhai/exception.rb +6 -0
  8. data/lib/fauxhai/fetcher.rb +79 -0
  9. data/lib/fauxhai/keys/id_dsa +12 -0
  10. data/lib/fauxhai/keys/id_dsa.pub +1 -0
  11. data/lib/fauxhai/keys/id_rsa +27 -0
  12. data/lib/fauxhai/keys/id_rsa.pub +1 -0
  13. data/lib/fauxhai/mocker.rb +143 -0
  14. data/lib/fauxhai/platforms/.DS_Store +0 -0
  15. data/lib/fauxhai/platforms/aix/.DS_Store +0 -0
  16. data/lib/fauxhai/platforms/aix/6.1.json +730 -0
  17. data/lib/fauxhai/platforms/aix/7.1.json +3128 -0
  18. data/lib/fauxhai/platforms/amazon/.DS_Store +0 -0
  19. data/lib/fauxhai/platforms/amazon/2.json +4581 -0
  20. data/lib/fauxhai/platforms/amazon/2015.03.json +3327 -0
  21. data/lib/fauxhai/platforms/amazon/2015.09.json +3385 -0
  22. data/lib/fauxhai/platforms/amazon/2016.03.json +3377 -0
  23. data/lib/fauxhai/platforms/amazon/2016.09.json +3384 -0
  24. data/lib/fauxhai/platforms/amazon/2017.03.json +3388 -0
  25. data/lib/fauxhai/platforms/amazon/2017.09.json +3409 -0
  26. data/lib/fauxhai/platforms/amazon/2018.03.json +3431 -0
  27. data/lib/fauxhai/platforms/arch/4.10.13-1-ARCH.json +1659 -0
  28. data/lib/fauxhai/platforms/centos/.DS_Store +0 -0
  29. data/lib/fauxhai/platforms/centos/5.11.json +4919 -0
  30. data/lib/fauxhai/platforms/centos/6.10.json +2685 -0
  31. data/lib/fauxhai/platforms/centos/6.8.json +2495 -0
  32. data/lib/fauxhai/platforms/centos/6.9.json +2692 -0
  33. data/lib/fauxhai/platforms/centos/7.3.1611.json +4077 -0
  34. data/lib/fauxhai/platforms/centos/7.4.1708.json +3799 -0
  35. data/lib/fauxhai/platforms/centos/7.5.1804.json +3794 -0
  36. data/lib/fauxhai/platforms/centos/7.6.1804.json +3795 -0
  37. data/lib/fauxhai/platforms/centos/7.6.1810.json +4620 -0
  38. data/lib/fauxhai/platforms/centos/7.7.1908.json +4052 -0
  39. data/lib/fauxhai/platforms/centos/8.json +5827 -0
  40. data/lib/fauxhai/platforms/chefspec/0.6.1.json +20 -0
  41. data/lib/fauxhai/platforms/clearos/.DS_Store +0 -0
  42. data/lib/fauxhai/platforms/clearos/7.4.json +6121 -0
  43. data/lib/fauxhai/platforms/debian/.DS_Store +0 -0
  44. data/lib/fauxhai/platforms/debian/10.json +2700 -0
  45. data/lib/fauxhai/platforms/debian/7.11.json +2932 -0
  46. data/lib/fauxhai/platforms/debian/8.10.json +3587 -0
  47. data/lib/fauxhai/platforms/debian/8.11.json +3595 -0
  48. data/lib/fauxhai/platforms/debian/8.9.json +3614 -0
  49. data/lib/fauxhai/platforms/debian/9.11.json +2928 -0
  50. data/lib/fauxhai/platforms/debian/9.2.json +3084 -0
  51. data/lib/fauxhai/platforms/debian/9.3.json +2929 -0
  52. data/lib/fauxhai/platforms/debian/9.4.json +2930 -0
  53. data/lib/fauxhai/platforms/debian/9.5.json +2928 -0
  54. data/lib/fauxhai/platforms/debian/9.6.json +2928 -0
  55. data/lib/fauxhai/platforms/debian/9.8.json +2928 -0
  56. data/lib/fauxhai/platforms/debian/9.9.json +2928 -0
  57. data/lib/fauxhai/platforms/dragonfly4/4.8-RELEASE.json +387 -0
  58. data/lib/fauxhai/platforms/fedora/.DS_Store +0 -0
  59. data/lib/fauxhai/platforms/fedora/26.json +3565 -0
  60. data/lib/fauxhai/platforms/fedora/27.json +3629 -0
  61. data/lib/fauxhai/platforms/fedora/28.json +3795 -0
  62. data/lib/fauxhai/platforms/fedora/29.json +3826 -0
  63. data/lib/fauxhai/platforms/fedora/30.json +3854 -0
  64. data/lib/fauxhai/platforms/freebsd/.DS_Store +0 -0
  65. data/lib/fauxhai/platforms/freebsd/10.4.json +423 -0
  66. data/lib/fauxhai/platforms/freebsd/11.1.json +425 -0
  67. data/lib/fauxhai/platforms/freebsd/11.2.json +422 -0
  68. data/lib/fauxhai/platforms/gentoo/.DS_Store +0 -0
  69. data/lib/fauxhai/platforms/gentoo/4.9.95-gentoo.json +980 -0
  70. data/lib/fauxhai/platforms/linuxmint/.DS_Store +0 -0
  71. data/lib/fauxhai/platforms/linuxmint/18.3.json +10350 -0
  72. data/lib/fauxhai/platforms/linuxmint/19.0.json +9643 -0
  73. data/lib/fauxhai/platforms/mac_os_x/.DS_Store +0 -0
  74. data/lib/fauxhai/platforms/mac_os_x/10.11.json +976 -0
  75. data/lib/fauxhai/platforms/mac_os_x/10.12.json +974 -0
  76. data/lib/fauxhai/platforms/mac_os_x/10.13.json +1338 -0
  77. data/lib/fauxhai/platforms/mac_os_x/10.14.json +1345 -0
  78. data/lib/fauxhai/platforms/mac_os_x/10.15.json +1629 -0
  79. data/lib/fauxhai/platforms/openbsd/.DS_Store +0 -0
  80. data/lib/fauxhai/platforms/openbsd/6.2.json +290 -0
  81. data/lib/fauxhai/platforms/opensuse/.DS_Store +0 -0
  82. data/lib/fauxhai/platforms/opensuse/15.0.json +1714 -0
  83. data/lib/fauxhai/platforms/opensuse/42.2.json +7200 -0
  84. data/lib/fauxhai/platforms/opensuse/42.3.json +8205 -0
  85. data/lib/fauxhai/platforms/oracle/.DS_Store +0 -0
  86. data/lib/fauxhai/platforms/oracle/5.11.json +7028 -0
  87. data/lib/fauxhai/platforms/oracle/6.10.json +4342 -0
  88. data/lib/fauxhai/platforms/oracle/6.8.json +6170 -0
  89. data/lib/fauxhai/platforms/oracle/6.9.json +4176 -0
  90. data/lib/fauxhai/platforms/oracle/7.3.json +6354 -0
  91. data/lib/fauxhai/platforms/oracle/7.4.json +6389 -0
  92. data/lib/fauxhai/platforms/oracle/7.5.json +6585 -0
  93. data/lib/fauxhai/platforms/oracle/7.6.json +6585 -0
  94. data/lib/fauxhai/platforms/raspbian/8.0.json +466 -0
  95. data/lib/fauxhai/platforms/redhat/.DS_Store +0 -0
  96. data/lib/fauxhai/platforms/redhat/5.11.json +6681 -0
  97. data/lib/fauxhai/platforms/redhat/6.10.json +5807 -0
  98. data/lib/fauxhai/platforms/redhat/6.8.json +5737 -0
  99. data/lib/fauxhai/platforms/redhat/6.9.json +5807 -0
  100. data/lib/fauxhai/platforms/redhat/7.3.json +3860 -0
  101. data/lib/fauxhai/platforms/redhat/7.4.json +3876 -0
  102. data/lib/fauxhai/platforms/redhat/7.5.json +3937 -0
  103. data/lib/fauxhai/platforms/redhat/7.6.json +3952 -0
  104. data/lib/fauxhai/platforms/redhat/8.json +4494 -0
  105. data/lib/fauxhai/platforms/smartos/5.11.json +1677 -0
  106. data/lib/fauxhai/platforms/solaris2/.DS_Store +0 -0
  107. data/lib/fauxhai/platforms/solaris2/5.11.json +8902 -0
  108. data/lib/fauxhai/platforms/suse/.DS_Store +0 -0
  109. data/lib/fauxhai/platforms/suse/11.4.json +5688 -0
  110. data/lib/fauxhai/platforms/suse/12.1.json +5823 -0
  111. data/lib/fauxhai/platforms/suse/12.2.json +5124 -0
  112. data/lib/fauxhai/platforms/suse/12.3.json +5838 -0
  113. data/lib/fauxhai/platforms/suse/12.4.json +5874 -0
  114. data/lib/fauxhai/platforms/suse/15.json +5928 -0
  115. data/lib/fauxhai/platforms/ubuntu/.DS_Store +0 -0
  116. data/lib/fauxhai/platforms/ubuntu/14.04.json +2998 -0
  117. data/lib/fauxhai/platforms/ubuntu/16.04.json +3766 -0
  118. data/lib/fauxhai/platforms/ubuntu/17.10.json +3739 -0
  119. data/lib/fauxhai/platforms/ubuntu/18.04.json +3926 -0
  120. data/lib/fauxhai/platforms/windows/.DS_Store +0 -0
  121. data/lib/fauxhai/platforms/windows/10.json +423 -0
  122. data/lib/fauxhai/platforms/windows/2008R2.json +443 -0
  123. data/lib/fauxhai/platforms/windows/2012.json +396 -0
  124. data/lib/fauxhai/platforms/windows/2012R2.json +398 -0
  125. data/lib/fauxhai/platforms/windows/2016.json +400 -0
  126. data/lib/fauxhai/platforms/windows/2019.json +400 -0
  127. data/lib/fauxhai/platforms/windows/8.1.json +408 -0
  128. data/lib/fauxhai/runner.rb +44 -0
  129. data/lib/fauxhai/runner/default.rb +284 -0
  130. data/lib/fauxhai/runner/windows.rb +101 -0
  131. data/lib/fauxhai/version.rb +3 -0
  132. metadata +261 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: cbf6d94ea26c035e8a7b2f8827c4f3e0b30e71336c959f67e69028ccdb65d621
4
+ data.tar.gz: b8d3d10546fe74d18d137bc3871aced38a56f43b0c37bd5fb159ca26df91053d
5
+ SHA512:
6
+ metadata.gz: 5e914fc06b8b7164759e6be72a7d5a8b97fff9739b9aa51c9a4b004409e2601fedd33c035f5ddc7ef25332fabb010fe34c75d6b6c2a6140cb4a4ef431f562213
7
+ data.tar.gz: 101e0096a65742cd44eea3eaa01da270f5bf23139b13f5bfabda86d4c54f7145e37218eca4b345bca6ad9fe8d9d46929de6b82d2638978c7d08b9dffe406c34d
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Seth Vargo and CustomInk, LCC
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ lib = File.expand_path(File.dirname(__FILE__) + '../../lib')
4
+ $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
5
+
6
+ args = ARGV.dup
7
+ ARGV.clear
8
+
9
+ unless (args & ['-v', '--version']).empty?
10
+ require 'fauxhai/version'
11
+ puts Fauxhai::VERSION
12
+ exit(0)
13
+ end
14
+
15
+ unless (args & ['-h', '--help']).empty?
16
+ puts 'Usage: fauxhai'
17
+ puts '(There are no flags or options)'
18
+ exit(0)
19
+ end
20
+
21
+ require 'fauxhai'
22
+ require 'fauxhai/runner'
23
+ Fauxhai::Runner.new(args)
Binary file
@@ -0,0 +1,18 @@
1
+ module Fauxhai
2
+ autoload :Exception, 'fauxhai/exception'
3
+ autoload :Fetcher, 'fauxhai/fetcher'
4
+ autoload :Mocker, 'fauxhai/mocker'
5
+ autoload :VERSION, 'fauxhai/version'
6
+
7
+ def self.root
8
+ @@root ||= File.expand_path('../../', __FILE__)
9
+ end
10
+
11
+ def self.mock(*args, &block)
12
+ Fauxhai::Mocker.new(*args, &block)
13
+ end
14
+
15
+ def self.fetch(*args, &block)
16
+ Fauxhai::Fetcher.new(*args, &block)
17
+ end
18
+ end
Binary file
@@ -0,0 +1,6 @@
1
+ module Fauxhai
2
+ module Exception
3
+ class InvalidPlatform < ArgumentError; end
4
+ class InvalidVersion < ArgumentError; end
5
+ end
6
+ end
@@ -0,0 +1,79 @@
1
+ require 'digest/sha1'
2
+ require 'json'
3
+ require 'net/ssh'
4
+
5
+ module Fauxhai
6
+ class Fetcher
7
+ def initialize(options = {}, &override_attributes)
8
+ @options = options
9
+
10
+ if !force_cache_miss? && cached?
11
+ @data = cache
12
+ else
13
+ Net::SSH.start(host, user, @options) do |ssh|
14
+ @data = JSON.parse(ssh.exec!('ohai'))
15
+ end
16
+
17
+ # cache this data so we do not have to SSH again
18
+ File.open(cache_file, 'w+') { |f| f.write(@data.to_json) }
19
+ end
20
+
21
+ yield(@data) if block_given?
22
+
23
+ if defined?(ChefSpec)
24
+ data = @data
25
+ ::ChefSpec::Runner.send :define_method, :fake_ohai do |ohai|
26
+ data.each_pair do |attribute, value|
27
+ ohai[attribute] = value
28
+ end
29
+ end
30
+ end
31
+
32
+ @data
33
+ end
34
+
35
+ def cache
36
+ @cache ||= JSON.parse(File.read(cache_file))
37
+ end
38
+
39
+ def cached?
40
+ File.exist?(cache_file)
41
+ end
42
+
43
+ def cache_key
44
+ Digest::SHA2.hexdigest("#{user}@#{host}")
45
+ end
46
+
47
+ def cache_file
48
+ File.expand_path(File.join(Fauxhai.root, 'tmp', cache_key))
49
+ end
50
+
51
+ def force_cache_miss?
52
+ @force_cache_miss ||= @options.delete(:force_cache_miss) || false
53
+ end
54
+
55
+ # Return the given `@data` attribute as a Ruby hash instead of a JSON object
56
+ #
57
+ # @return [Hash] the `@data` represented as a Ruby hash
58
+ def to_hash(*args)
59
+ @data.to_hash(*args)
60
+ end
61
+
62
+ def to_s
63
+ "#<Fauxhai::Fetcher @host=#{host}, @options=#{@options}>"
64
+ end
65
+
66
+ private
67
+
68
+ def host
69
+ @host ||= begin
70
+ raise ArgumentError, ':host is a required option for Fauxhai.fetch' unless @options[:host]
71
+ @options.delete(:host)
72
+ end
73
+ end
74
+
75
+ def user
76
+ @user ||= (@options.delete(:user) || ENV['USER'] || ENV['USERNAME']).chomp
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,12 @@
1
+ -----BEGIN DSA PRIVATE KEY-----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keOo0o92/PiSmvY4eRsdF0mw40Uvg7jtE3f3fxj497kzh5fKtkrHnF4x9gXCbVdr3FqXJfggR5IJwAxToerbK7x/uRS+7YuZI9Pip3tt14nv9ezwXcuGb/tvjWOZINiFl8izVIFKi7sxfTX09p4NgamxRS7TD2Yd0jT8nEoF9UZTsgXcJ1kDSx7N7NxFfNfP6rCdOGRRz4gUhXtsUjG/XkxPeCwZ7A9VnOD fauxhai.local
@@ -0,0 +1,143 @@
1
+ require 'json'
2
+ require 'pathname'
3
+ require 'open-uri'
4
+
5
+ module Fauxhai
6
+ class Mocker
7
+ # The base URL for the GitHub project (raw)
8
+ RAW_BASE = 'https://raw.githubusercontent.com/chefspec/fauxhai/master'.freeze
9
+
10
+ # A message about where to find a list of platforms
11
+ PLATFORM_LIST_MESSAGE = 'A list of available platforms is available at https://github.com/chefspec/fauxhai/blob/master/PLATFORMS.md'.freeze
12
+
13
+ # Create a new Ohai Mock with fauxhai.
14
+ #
15
+ # @param [Hash] options
16
+ # the options for the mocker
17
+ # @option options [String] :platform
18
+ # the platform to mock
19
+ # @option options [String] :version
20
+ # the version of the platform to mock
21
+ # @option options [String] :path
22
+ # the path to a local JSON file
23
+ # @option options [Bool] :github_fetching
24
+ # whether to try loading from Github
25
+ def initialize(options = {}, &override_attributes)
26
+ @options = { github_fetching: true }.merge(options)
27
+
28
+ yield(data) if block_given?
29
+ end
30
+
31
+ def data
32
+ @fauxhai_data ||= lambda do
33
+ # If a path option was specified, use it
34
+ if @options[:path]
35
+ filepath = File.expand_path(@options[:path])
36
+
37
+ unless File.exist?(filepath)
38
+ raise Fauxhai::Exception::InvalidPlatform.new("You specified a path to a JSON file on the local system that does not exist: '#{filepath}'")
39
+ end
40
+ else
41
+ filepath = File.join(platform_path, "#{version}.json")
42
+ end
43
+
44
+ if File.exist?(filepath)
45
+ parse_and_validate(File.read(filepath))
46
+ elsif @options[:github_fetching]
47
+ # Try loading from github (in case someone submitted a PR with a new file, but we haven't
48
+ # yet updated the gem version). Cache the response locally so it's faster next time.
49
+ begin
50
+ response = open("#{RAW_BASE}/lib/fauxhai/platforms/#{platform}/#{version}.json")
51
+ rescue OpenURI::HTTPError
52
+ raise Fauxhai::Exception::InvalidPlatform.new("Could not find platform '#{platform}/#{version}' on the local disk and an HTTP error was encountered when fetching from Github. #{PLATFORM_LIST_MESSAGE}")
53
+ end
54
+
55
+ if response.status.first.to_i == 200
56
+ response_body = response.read
57
+ path = Pathname.new(filepath)
58
+ FileUtils.mkdir_p(path.dirname)
59
+
60
+ begin
61
+ File.open(filepath, 'w') { |f| f.write(response_body) }
62
+ rescue Errno::EACCES # a pretty common problem in CI systems
63
+ puts "Fetched '#{platform}/#{version}' from GitHub, but could not write to the local path: #{filepath}. Fix the local file permissions to avoid downloading this file every run."
64
+ end
65
+ return parse_and_validate(response_body)
66
+ else
67
+ raise Fauxhai::Exception::InvalidPlatform.new("Could not find platform '#{platform}/#{version}' on the local disk and an Github fetching returned http error code #{response.status.first.to_i}! #{PLATFORM_LIST_MESSAGE}")
68
+ end
69
+ else
70
+ raise Fauxhai::Exception::InvalidPlatform.new("Could not find platform '#{platform}/#{version}' on the local disk and Github fetching is disabled! #{PLATFORM_LIST_MESSAGE}")
71
+ end
72
+ end.call
73
+ end
74
+
75
+ private
76
+
77
+ # As major releases of Ohai ship it's difficult and sometimes impossible
78
+ # to regenerate all fauxhai data. This allows us to deprecate old releases
79
+ # and eventually remove them while giving end users ample warning.
80
+ def parse_and_validate(unparsed_data)
81
+ parsed_data = JSON.parse(unparsed_data)
82
+ if parsed_data['deprecated']
83
+ STDERR.puts "WARNING: Fauxhai platform data for #{parsed_data['platform']} #{parsed_data['platform_version']} is deprecated and will be removed in the 7.0 release 3/2019. #{PLATFORM_LIST_MESSAGE}"
84
+ end
85
+ parsed_data
86
+ end
87
+
88
+ def platform
89
+ @options[:platform] ||= begin
90
+ STDERR.puts "WARNING: you must specify a 'platform' and optionally a 'version' for your ChefSpec Runner and/or Fauxhai constructor, in the future omitting the platform will become a hard error. #{PLATFORM_LIST_MESSAGE}"
91
+ 'chefspec'
92
+ end
93
+ end
94
+
95
+ def platform_path
96
+ File.join(Fauxhai.root, 'lib', 'fauxhai', 'platforms', platform)
97
+ end
98
+
99
+ def version
100
+ @version ||= begin
101
+ if File.exist?("#{platform_path}/#{@options[:version]}.json")
102
+ # Whole version, use it as-is.
103
+ @options[:version]
104
+ else
105
+ # Check if it's a prefix of an existing version.
106
+ versions = Dir["#{platform_path}/*.json"].map {|path| File.basename(path, '.json') }
107
+ unless @options[:version].to_s == ''
108
+ # If the provided version is nil or '', that means take anything,
109
+ # otherwise run the prefix match with an extra \D to avoid the
110
+ # case where "7.1" matches "7.10.0".
111
+ prefix_re = /^#{Regexp.escape(@options[:version])}\D/
112
+ versions.select! {|ver| ver =~ prefix_re }
113
+ end
114
+
115
+ if versions.empty?
116
+ # No versions available, either an unknown platform or nothing matched
117
+ # the prefix check. Pass through the option as given so we can try
118
+ # github fetching.
119
+ @options[:version]
120
+ else
121
+ # Take the highest version available, trying to use rules that should
122
+ # probably mostly work on all OSes. Famous last words. The idea of
123
+ # the regex is to split on any punctuation (the common case) and
124
+ # also any single letter with digit on either side (2012r2). This
125
+ # leaves any long runs of letters intact (4.2-RELEASE). Then convert
126
+ # any run of digits to an integer to get version-ish comparison.
127
+ # This is basically a more flexible version of Gem::Version.
128
+ versions.max_by do |ver|
129
+ ver.split(/[^a-z0-9]|(?<=\d)[a-z](?=\d)/i).map do |part|
130
+ if part =~ /^\d+$/
131
+ part.to_i
132
+ else
133
+ part
134
+ end
135
+ end
136
+ end
137
+ end
138
+ end
139
+ end
140
+ end
141
+
142
+ end
143
+ end
@@ -0,0 +1,730 @@
1
+ {
2
+ "chef_packages": {
3
+ "chef": {
4
+ "chef_root": "/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.2.1/lib",
5
+ "version": "12.2.1"
6
+ },
7
+ "ohai": {
8
+ "ohai_root": "/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ohai-8.13.0/lib/ohai",
9
+ "version": "8.13.0"
10
+ }
11
+ },
12
+ "command": {
13
+ "ps": "ps -ef"
14
+ },
15
+ "counters": {
16
+ "network": {
17
+ "interfaces": {
18
+ "eth0": {
19
+ "rx": {
20
+ "bytes": "0",
21
+ "compressed": 0,
22
+ "drop": 0,
23
+ "errors": "0",
24
+ "frame": 0,
25
+ "multicast": 0,
26
+ "overrun": 0,
27
+ "packets": "0"
28
+ },
29
+ "tx": {
30
+ "bytes": "342",
31
+ "carrier": 0,
32
+ "collisions": "0",
33
+ "compressed": 0,
34
+ "drop": 0,
35
+ "errors": "0",
36
+ "overrun": 0,
37
+ "packets": "0"
38
+ }
39
+ }
40
+ }
41
+ }
42
+ },
43
+ "cpu": {
44
+ "cores": 1,
45
+ "real": 1,
46
+ "total": 1
47
+ },
48
+ "current_user": "fauxhai",
49
+ "dmi": {},
50
+ "domain": "local",
51
+ "etc": {
52
+ "group": {
53
+ "fauxhai": {
54
+ "gid": 0,
55
+ "members": [
56
+ "fauxhai"
57
+ ]
58
+ }
59
+ },
60
+ "passwd": {
61
+ "fauxhai": {
62
+ "dir": "/home/fauxhai",
63
+ "gecos": "Fauxhai",
64
+ "gid": 0,
65
+ "shell": "/bin/bash",
66
+ "uid": 0
67
+ }
68
+ }
69
+ },
70
+ "filesystem": {
71
+ "Global:/": {
72
+ "fs_type": "jfs2",
73
+ "kb_available": "478640",
74
+ "kb_size": "524288",
75
+ "kb_used": "45648",
76
+ "mount": "/",
77
+ "mount_options": [
78
+ "rw",
79
+ "log=NULL"
80
+ ],
81
+ "percent_used": "9%"
82
+ },
83
+ "Global:/home": {
84
+ "fs_type": "jfs2",
85
+ "kb_available": "2080928",
86
+ "kb_size": "2097152",
87
+ "kb_used": "16224",
88
+ "mount": "/home",
89
+ "mount_options": [
90
+ "rw",
91
+ "log=NULL"
92
+ ],
93
+ "percent_used": "1%"
94
+ },
95
+ "Global:/opt": {
96
+ "fs_type": "jfs2",
97
+ "kb_available": "3739436",
98
+ "kb_size": "5242880",
99
+ "kb_used": "1503444",
100
+ "mount": "/opt",
101
+ "mount_options": [
102
+ "rw",
103
+ "log=NULL"
104
+ ],
105
+ "percent_used": "29%"
106
+ },
107
+ "Global:/proc": {
108
+ "fs_type": "namefs",
109
+ "kb_available": "-",
110
+ "kb_size": "-",
111
+ "kb_used": "-",
112
+ "mount": "/proc",
113
+ "mount_options": [
114
+ "rw"
115
+ ],
116
+ "percent_used": "-"
117
+ },
118
+ "Global:/tmp": {
119
+ "fs_type": "jfs2",
120
+ "kb_available": "670952",
121
+ "kb_size": "1048576",
122
+ "kb_used": "377624",
123
+ "mount": "/tmp",
124
+ "mount_options": [
125
+ "rw",
126
+ "log=NULL"
127
+ ],
128
+ "percent_used": "37%"
129
+ },
130
+ "Global:/usr": {
131
+ "fs_type": "jfs2",
132
+ "kb_available": "2802776",
133
+ "kb_size": "5242880",
134
+ "kb_used": "2440104",
135
+ "mount": "/usr",
136
+ "mount_options": [
137
+ "rw",
138
+ "log=NULL"
139
+ ],
140
+ "percent_used": "47%"
141
+ },
142
+ "Global:/var": {
143
+ "fs_type": "jfs2",
144
+ "kb_available": "448300",
145
+ "kb_size": "524288",
146
+ "kb_used": "75988",
147
+ "mount": "/var",
148
+ "mount_options": [
149
+ "rw",
150
+ "log=NULL"
151
+ ],
152
+ "percent_used": "15%"
153
+ }
154
+ },
155
+ "fqdn": "fauxhai.local",
156
+ "hostname": "Fauxhai",
157
+ "ipaddress": "10.0.0.2",
158
+ "kernel": {
159
+ "bits": "64",
160
+ "machine": "powerpc",
161
+ "modules": {
162
+ "/etc/drivers/coreprobe.ext": {
163
+ "data": {
164
+ "address": "f1000000c01ec000",
165
+ "size": "2b0"
166
+ },
167
+ "text": {
168
+ "address": "f1000000c01e8000",
169
+ "size": "5000"
170
+ }
171
+ },
172
+ "/etc/drivers/scsidiskpin": {
173
+ "data": {
174
+ "address": "4340000",
175
+ "size": "ad50"
176
+ },
177
+ "text": {
178
+ "address": "42f0000",
179
+ "size": "60000"
180
+ }
181
+ },
182
+ "/unix": {
183
+ "data": {
184
+ "address": "0",
185
+ "size": "2c0def0"
186
+ },
187
+ "text": {
188
+ "address": "28b6e50",
189
+ "size": "0"
190
+ }
191
+ },
192
+ "/usr/lib/drivers/aio.ext": {
193
+ "data": {
194
+ "address": "4870000",
195
+ "size": "1198"
196
+ },
197
+ "text": {
198
+ "address": "4860000",
199
+ "size": "20000"
200
+ }
201
+ },
202
+ "/usr/lib/drivers/aiopin": {
203
+ "data": {
204
+ "address": "4890000",
205
+ "size": "8910"
206
+ },
207
+ "text": {
208
+ "address": "4880000",
209
+ "size": "20000"
210
+ }
211
+ },
212
+ "/usr/lib/drivers/aixdiskpcmke": {
213
+ "data": {
214
+ "address": "4390000",
215
+ "size": "8310"
216
+ },
217
+ "text": {
218
+ "address": "4350000",
219
+ "size": "50000"
220
+ }
221
+ },
222
+ "/usr/lib/drivers/cluster": {
223
+ "data": {
224
+ "address": "f1000000c0421000",
225
+ "size": "1ecac"
226
+ },
227
+ "text": {
228
+ "address": "f1000000c03c9000",
229
+ "size": "77000"
230
+ }
231
+ },
232
+ "/usr/lib/drivers/crypto/clickext": {
233
+ "data": {
234
+ "address": "f1000000c0257000",
235
+ "size": "b148"
236
+ },
237
+ "text": {
238
+ "address": "f1000000c0214000",
239
+ "size": "50000"
240
+ }
241
+ },
242
+ "/usr/lib/drivers/eth_demux": {
243
+ "data": {
244
+ "address": "42a0000",
245
+ "size": "410"
246
+ },
247
+ "text": {
248
+ "address": "4290000",
249
+ "size": "20000"
250
+ }
251
+ },
252
+ "/usr/lib/drivers/hd_pin": {
253
+ "data": {
254
+ "address": "43d0000",
255
+ "size": "1f90"
256
+ },
257
+ "text": {
258
+ "address": "43a0000",
259
+ "size": "40000"
260
+ }
261
+ },
262
+ "/usr/lib/drivers/hd_pin_bot": {
263
+ "data": {
264
+ "address": "4420000",
265
+ "size": "20d10"
266
+ },
267
+ "text": {
268
+ "address": "43e0000",
269
+ "size": "70000"
270
+ }
271
+ },
272
+ "/usr/lib/drivers/if_en": {
273
+ "data": {
274
+ "address": "4790000",
275
+ "size": "bd8"
276
+ },
277
+ "text": {
278
+ "address": "4780000",
279
+ "size": "20000"
280
+ }
281
+ },
282
+ "/usr/lib/drivers/iscsidd": {
283
+ "data": {
284
+ "address": "4490000",
285
+ "size": "7ea8"
286
+ },
287
+ "text": {
288
+ "address": "4450000",
289
+ "size": "50000"
290
+ }
291
+ },
292
+ "/usr/lib/drivers/krpc.ext": {
293
+ "data": {
294
+ "address": "4930000",
295
+ "size": "dbe8"
296
+ },
297
+ "text": {
298
+ "address": "48e0000",
299
+ "size": "60000"
300
+ }
301
+ },
302
+ "/usr/lib/drivers/ldterm": {
303
+ "data": {
304
+ "address": "f1000000c0212000",
305
+ "size": "16d8"
306
+ },
307
+ "text": {
308
+ "address": "f1000000c01f9000",
309
+ "size": "1b000"
310
+ }
311
+ },
312
+ "/usr/lib/drivers/netinet": {
313
+ "data": {
314
+ "address": "4630000",
315
+ "size": "14b8c0"
316
+ },
317
+ "text": {
318
+ "address": "4540000",
319
+ "size": "240000"
320
+ }
321
+ },
322
+ "/usr/lib/drivers/nfs.ext": {
323
+ "data": {
324
+ "address": "4b00000",
325
+ "size": "65700"
326
+ },
327
+ "text": {
328
+ "address": "4950000",
329
+ "size": "220000"
330
+ }
331
+ },
332
+ "/usr/lib/drivers/nfs_kdes.ext": {
333
+ "data": {
334
+ "address": "f1000000c03a8000",
335
+ "size": "d0"
336
+ },
337
+ "text": {
338
+ "address": "f1000000c03a7000",
339
+ "size": "2000"
340
+ }
341
+ },
342
+ "/usr/lib/drivers/perfvmmstat": {
343
+ "data": {
344
+ "address": "4840000",
345
+ "size": "9f0"
346
+ },
347
+ "text": {
348
+ "address": "4830000",
349
+ "size": "20000"
350
+ }
351
+ },
352
+ "/usr/lib/drivers/pkcs11": {
353
+ "data": {
354
+ "address": "f1000000c032f000",
355
+ "size": "50e58"
356
+ },
357
+ "text": {
358
+ "address": "f1000000c0264000",
359
+ "size": "11d000"
360
+ }
361
+ },
362
+ "/usr/lib/drivers/planar_pal_chrp": {
363
+ "data": {
364
+ "address": "4220000",
365
+ "size": "cbd8"
366
+ },
367
+ "text": {
368
+ "address": "41f0000",
369
+ "size": "40000"
370
+ }
371
+ },
372
+ "/usr/lib/drivers/posix_aio.ext": {
373
+ "data": {
374
+ "address": "48b0000",
375
+ "size": "e80"
376
+ },
377
+ "text": {
378
+ "address": "48a0000",
379
+ "size": "20000"
380
+ }
381
+ },
382
+ "/usr/lib/drivers/posix_aiopin": {
383
+ "data": {
384
+ "address": "48d0000",
385
+ "size": "8990"
386
+ },
387
+ "text": {
388
+ "address": "48c0000",
389
+ "size": "20000"
390
+ }
391
+ },
392
+ "/usr/lib/drivers/pse/pse": {
393
+ "data": {
394
+ "address": "f1000000c01a4000",
395
+ "size": "7f88"
396
+ },
397
+ "text": {
398
+ "address": "f1000000c0154000",
399
+ "size": "59000"
400
+ }
401
+ },
402
+ "/usr/lib/drivers/pse/sc": {
403
+ "data": {
404
+ "address": "f1000000c01bd000",
405
+ "size": "610"
406
+ },
407
+ "text": {
408
+ "address": "f1000000c01bb000",
409
+ "size": "3000"
410
+ }
411
+ },
412
+ "/usr/lib/drivers/pse/spx": {
413
+ "data": {
414
+ "address": "f1000000c01b9000",
415
+ "size": "2b0"
416
+ },
417
+ "text": {
418
+ "address": "f1000000c01b7000",
419
+ "size": "3000"
420
+ }
421
+ },
422
+ "/usr/lib/drivers/pse/stddev": {
423
+ "data": {
424
+ "address": "f1000000c01b5000",
425
+ "size": "940"
426
+ },
427
+ "text": {
428
+ "address": "f1000000c01b3000",
429
+ "size": "3000"
430
+ }
431
+ },
432
+ "/usr/lib/drivers/pse/stdmod": {
433
+ "data": {
434
+ "address": "f1000000c01c0000",
435
+ "size": "9d0"
436
+ },
437
+ "text": {
438
+ "address": "f1000000c01bf000",
439
+ "size": "2000"
440
+ }
441
+ },
442
+ "/usr/lib/drivers/pse/timod": {
443
+ "data": {
444
+ "address": "f1000000c01e1000",
445
+ "size": "580"
446
+ },
447
+ "text": {
448
+ "address": "f1000000c01de000",
449
+ "size": "4000"
450
+ }
451
+ },
452
+ "/usr/lib/drivers/pse/tirdwr": {
453
+ "data": {
454
+ "address": "f1000000c01e5000",
455
+ "size": "498"
456
+ },
457
+ "text": {
458
+ "address": "f1000000c01e2000",
459
+ "size": "4000"
460
+ }
461
+ },
462
+ "/usr/lib/drivers/pse/xtiso": {
463
+ "data": {
464
+ "address": "f1000000c01dc000",
465
+ "size": "10f8"
466
+ },
467
+ "text": {
468
+ "address": "f1000000c01c1000",
469
+ "size": "1d000"
470
+ }
471
+ },
472
+ "/usr/lib/drivers/ptydd": {
473
+ "data": {
474
+ "address": "f1000000c039a000",
475
+ "size": "2154"
476
+ },
477
+ "text": {
478
+ "address": "f1000000c0381000",
479
+ "size": "1c000"
480
+ }
481
+ },
482
+ "/usr/lib/drivers/random": {
483
+ "data": {
484
+ "address": "f1000000c03b1000",
485
+ "size": "17148"
486
+ },
487
+ "text": {
488
+ "address": "f1000000c03a9000",
489
+ "size": "20000"
490
+ }
491
+ },
492
+ "/usr/lib/drivers/scsidisk": {
493
+ "data": {
494
+ "address": "42e0000",
495
+ "size": "c98"
496
+ },
497
+ "text": {
498
+ "address": "42c0000",
499
+ "size": "30000"
500
+ }
501
+ },
502
+ "/usr/lib/drivers/sfwcomdd": {
503
+ "data": {
504
+ "address": "4520000",
505
+ "size": "9350"
506
+ },
507
+ "text": {
508
+ "address": "44f0000",
509
+ "size": "40000"
510
+ }
511
+ },
512
+ "/usr/lib/drivers/smt_load": {
513
+ "data": {
514
+ "address": "f1000000c03a2000",
515
+ "size": "698"
516
+ },
517
+ "text": {
518
+ "address": "f1000000c039d000",
519
+ "size": "6000"
520
+ }
521
+ },
522
+ "/usr/lib/drivers/smt_loadpin": {
523
+ "data": {
524
+ "address": "f1000000c03a6000",
525
+ "size": "78"
526
+ },
527
+ "text": {
528
+ "address": "f1000000c03a5000",
529
+ "size": "2000"
530
+ }
531
+ },
532
+ "/usr/lib/drivers/storfwork": {
533
+ "data": {
534
+ "address": "44e0000",
535
+ "size": "4028"
536
+ },
537
+ "text": {
538
+ "address": "44b0000",
539
+ "size": "40000"
540
+ }
541
+ },
542
+ "/usr/lib/drivers/syscalls64.ext": {
543
+ "data": {
544
+ "address": "f1000000c01e7000",
545
+ "size": "98"
546
+ },
547
+ "text": {
548
+ "address": "f1000000c01e6000",
549
+ "size": "2000"
550
+ }
551
+ },
552
+ "/usr/lib/drivers/trcdd": {
553
+ "data": {
554
+ "address": "f1000000c044b000",
555
+ "size": "160b0"
556
+ },
557
+ "text": {
558
+ "address": "f1000000c0440000",
559
+ "size": "22000"
560
+ }
561
+ },
562
+ "/usr/lib/drivers/ttydbg": {
563
+ "data": {
564
+ "address": "f1000000c01b2000",
565
+ "size": "4d0"
566
+ },
567
+ "text": {
568
+ "address": "f1000000c01b1000",
569
+ "size": "2000"
570
+ }
571
+ },
572
+ "/usr/lib/drivers/ttydbg_pinned": {
573
+ "data": {
574
+ "address": "f1000000c01b0000",
575
+ "size": "440"
576
+ },
577
+ "text": {
578
+ "address": "f1000000c01ad000",
579
+ "size": "4000"
580
+ }
581
+ },
582
+ "/usr/lib/drivers/vconsdd": {
583
+ "data": {
584
+ "address": "f1000000c01f8000",
585
+ "size": "788"
586
+ },
587
+ "text": {
588
+ "address": "f1000000c01f0000",
589
+ "size": "9000"
590
+ }
591
+ },
592
+ "/usr/lib/drivers/vdev_busdd": {
593
+ "data": {
594
+ "address": "4250000",
595
+ "size": "2a34"
596
+ },
597
+ "text": {
598
+ "address": "4230000",
599
+ "size": "30000"
600
+ }
601
+ },
602
+ "/usr/lib/drivers/vioentdd": {
603
+ "data": {
604
+ "address": "4280000",
605
+ "size": "fe60"
606
+ },
607
+ "text": {
608
+ "address": "4260000",
609
+ "size": "30000"
610
+ }
611
+ },
612
+ "/usr/lib/drivers/vscsi_initdd": {
613
+ "data": {
614
+ "address": "f1000000c0151000",
615
+ "size": "2783"
616
+ },
617
+ "text": {
618
+ "address": "f1000000c0130000",
619
+ "size": "24000"
620
+ }
621
+ },
622
+ "/usr/lib/perf/perfstat": {
623
+ "data": {
624
+ "address": "47d0000",
625
+ "size": "f14"
626
+ },
627
+ "text": {
628
+ "address": "47b0000",
629
+ "size": "30000"
630
+ }
631
+ },
632
+ "/usr/pmapi/etc/pmsvcs": {
633
+ "data": {
634
+ "address": "4810000",
635
+ "size": "334c"
636
+ },
637
+ "text": {
638
+ "address": "47e0000",
639
+ "size": "40000"
640
+ }
641
+ }
642
+ },
643
+ "name": "aix",
644
+ "release": "1",
645
+ "version": "6"
646
+ },
647
+ "keys": {
648
+ "ssh": {
649
+ "host_dsa_public": "ssh-dss AAAAB3NzaC1kc3MAAACBAJFo9BLAw4WKEs5hgipk5m423FzBsDXCZSMcC9ca/om/1VYzMqImixGe3uICDzNFUWxFoLJTQAOccyzo6MXZiQqwWJDLFi5qOSr6w2XcMyE+zd4wOyMoDiVM5fizmG8K3FzrqvGjwBcHcBdOQnavSijoj38DN25J9zhrid5BY4WlAAAAFQDxXrCyG52XCzn3FV4ej38wJBkomQAAAIBovGPJ4mP2P6BK8lHl0PPbktwQbWlpJ13oz6REJFDVcUi7vV26bX/BjQX+ohzZQzljdz1SpUbPc/8nuA4darYkVh91eBi307EN8IdxRHj2eBgp/ZG4yshIebG3WHrwJD/xUjjZ1MRfyDT1ermVi4LvjjPgWDxLZnPpMaR6S1nzgQAAAIEAj0Vd6DCWslvlsZ8+N53HWsqPi3gnx35JoLPz9Z2epkKIKqmEHav+93G3hdfztVa4I4t3phoPniQchYryF5+RNg8hqxKzjNtrIqUYCeuf2NJrksNsH7OZygPHZpqt4kTuwAGZxjxEGfAI0y8DhkU2ntp2LnzRnWH106BQBCmcXwo= fauxhai.local",
650
+ "host_rsa_public": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCtLCeqtqr/HbnORckw1ukdLhpfGoOPFi5/esKEokzTqq1gsgQ2V8emmyjfq1i6XXfRtSBxkdlHv/GWdP5wBTuE2G85MzBkVSQPvmwQN8lX/JMPEEtKXkeOo0o92/PiSmvY4eRsdF0mw40Uvg7jtE3f3fxj497kzh5fKtkrHnF4x9gXCbVdr3FqXJfggR5IJwAxToerbK7x/uRS+7YuZI9Pip3tt14nv9ezwXcuGb/tvjWOZINiFl8izVIFKi7sxfTX09p4NgamxRS7TD2Yd0jT8nEoF9UZTsgXcJ1kDSx7N7NxFfNfP6rCdOGRRz4gUhXtsUjG/XkxPeCwZ7A9VnOD fauxhai.local"
651
+ }
652
+ },
653
+ "languages": {
654
+ "powershell": null,
655
+ "ruby": {
656
+ "bin_dir": "/usr/local/bin",
657
+ "gem_bin": "/usr/local/bin/gem",
658
+ "gems_dir": "/usr/local/gems",
659
+ "host": "powerpc-ibm-aix6.1.0.0",
660
+ "host_cpu": "powerpc",
661
+ "host_os": "aix6.1.0.0",
662
+ "host_vendor": "ibm",
663
+ "platform": "powerpc-aix6.1.0.0",
664
+ "release_date": "2014-11-13",
665
+ "ruby_bin": "/usr/local/bin/ruby",
666
+ "target": "powerpc-ibm-aix6.1.0.0",
667
+ "target_cpu": "powerpc",
668
+ "target_os": "aix6.1.0.0",
669
+ "target_vendor": "ibm",
670
+ "version": "2.1.5"
671
+ }
672
+ },
673
+ "macaddress": "11:11:11:11:11:11",
674
+ "memory": {
675
+ "total": "1048576kB"
676
+ },
677
+ "network": {
678
+ "default_gateway": "10.0.0.1",
679
+ "default_interface": "eth0",
680
+ "interfaces": {
681
+ "eth0": {
682
+ "addresses": {
683
+ "10.0.0.2": {
684
+ "broadcast": "10.0.0.255",
685
+ "family": "inet",
686
+ "netmask": "255.255.255.0",
687
+ "prefixlen": "24",
688
+ "scope": "Global"
689
+ }
690
+ },
691
+ "arp": {
692
+ "10.0.0.1": "fe:ff:ff:ff:ff:ff"
693
+ },
694
+ "encapsulation": "Ethernet",
695
+ "flags": [
696
+ "BROADCAST",
697
+ "MULTICAST",
698
+ "UP",
699
+ "LOWER_UP"
700
+ ],
701
+ "mtu": "1500",
702
+ "number": "0",
703
+ "routes": [
704
+ {
705
+ "destination": "10.0.0.0/24",
706
+ "family": "inet",
707
+ "proto": "kernel",
708
+ "scope": "link",
709
+ "src": "10.0.0.2"
710
+ }
711
+ ],
712
+ "state": "up",
713
+ "type": "eth"
714
+ }
715
+ },
716
+ "settings": {}
717
+ },
718
+ "ohai_time": 1459361828.044256,
719
+ "os": "aix",
720
+ "os_version": "6",
721
+ "platform": "aix",
722
+ "platform_family": "aix",
723
+ "platform_version": "6.1",
724
+ "root_group": "system",
725
+ "uptime": "30 days 15 hours 07 minutes 30 seconds",
726
+ "uptime_seconds": 2646450,
727
+ "virtualization": {
728
+ "systems": {}
729
+ }
730
+ }