-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfacts.8
More file actions
319 lines (314 loc) · 8.57 KB
/
Copy pathfacts.8
File metadata and controls
319 lines (314 loc) · 8.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "FACTS" "8" "June 2026" "Facts" "Facts manual"
.
.SH "NAME"
\fBfacts\fR \- collect and display facts about the current system
.
.SH "SYNOPSIS"
\fBfacts\fR [options] [query] [query] [\.\.\.]
.
.SH "DESCRIPTION"
\fBfacts\fR gathers structured facts about the current system, such as hardware details, network settings, OS type and version, installed packages (namespaced by package database), cloud metadata, and storage state\. The same canonical fact tree is available through the command line and the Go library\.
.
.P
If no queries are given, then all facts will be returned\.
.
.P
Many of the command line options can also be set via the HOCON config file\. This file can also be used to block or cache certain fact groups\.
.
.P
Supported release targets are Linux, macOS/Darwin, Windows, FreeBSD, OpenBSD, NetBSD, DragonFly BSD, and illumos\. The supported fact contract is documented in \fIdocs/schema/facts\.yaml\fR and rendered by platform under \fIdocs/supported\-facts/\fR\.
.
.SH "OPTIONS"
.
.TP
\fB\-\-color\fR:
.
.IP
Force color output (by default, color is enabled when writing to a terminal and disabled otherwise)\. In the default output format, fact keys are colored by nesting depth\.
.
.TP
\fB\-\-no\-color\fR:
.
.IP
Disable color output\.
.
.TP
\fB\-c\fR, \fB\-\-config\fR:
.
.IP
The location of the config file\.
.
.TP
\fB\-d\fR, \fB\-\-debug\fR:
.
.IP
Enable debug output\.
.
.TP
\fB\-\-disable\fR:
.
.IP
Disable facts or fact groups (comma\-separated, repeatable)\. Standalone resolvers are skipped; others are pruned from output, even when queried\. Unions with the \fBFACTS_DISABLE\fR environment variable and the config file disable list; \fB\-\-no\-block\fR clears the whole set\.
.
.TP
\fB\-\-external\-dir\fR:
.
.IP
A directory to use for external facts\.
.
.TP
\fB\-\-force\-dot\-resolution\fR:
.
.IP
Merge dotted facts into structured facts\.
.
.TP
\fB\-\-hocon\fR:
.
.IP
Output in Hocon format\.
.
.TP
\fB\-j\fR, \fB\-\-json\fR:
.
.IP
Output in JSON format\.
.
.TP
\fB\-l\fR, \fB\-\-log\-level\fR:
.
.IP
Set logging level\. Supported levels are: none, trace, debug, info, warn, error, and fatal\.
.
.TP
\fB\-\-no\-block\fR:
.
.IP
Disable fact blocking\.
.
.TP
\fB\-\-no\-cache\fR:
.
.IP
Disable loading and refreshing facts from the cache
.
.TP
\fB\-\-no\-external\-facts\fR:
.
.IP
Disable external facts\.
.
.TP
\fB\-\-verbose\fR:
.
.IP
Enable verbose (info) output\.
.
.TP
\fB\-y\fR, \fB\-\-yaml\fR:
.
.IP
Output in YAML format\.
.
.TP
\fB\-\-strict\fR:
.
.IP
Enable more aggressive error reporting\.
.
.TP
\fB\-t\fR, \fB\-\-timing\fR:
.
.IP
Show how much time it took to resolve each fact
.
.TP
\fB\-\-sequential\fR:
.
.IP
Resolve facts sequentially
.
.TP
\fB\-\-http\-debug\fR:
.
.IP
Whether to write HTTP request and responses to stderr\. This should never be used in production\.
.
.TP
\fB\-\-version, \-v\fR:
.
.IP
Print the version
.
.TP
\fB\-\-list\-block\-groups\fR:
.
.IP
List block groups
.
.TP
\fB\-\-list\-cache\-groups\fR:
.
.IP
List cache groups
.
.TP
\fB\-\-help, \-h\fR:
.
.IP
Help for all arguments
.
.TP
\fB\-\-man\fR:
.
.IP
Display this manual\.
.
.SH "EXIT STATUS"
\fBfacts\fR exits 0 on success, including queries for facts that do not exist (which print nothing)\. It exits 1 when an option is invalid, when \fB\-\-strict\fR is given and a queried fact does not exist, or on any other runtime error\.
.
.SH "COMPATIBILITY"
Facts keeps Ruby Facter compatibility at the CLI process boundary and for operator\-supplied fact sources such as external facts and \fBfacter\.conf\fR\. The Go API is Facts\-native\. Important compatibility boundaries:
.
.IP "\(bu" 4
Ruby DSL fact files (\fB\.rb\fR) are not read from any source: there is no \fB\-\-custom\-dir\fR option, no \fBFACTERLIB\fR lookup, and no Ruby evaluation\. A \fB\.rb\fR file in an external\-fact directory is skipped with a warning\. Rewrite Ruby custom facts as external facts; see \fIdocs/CUSTOM_FACT_MIGRATION\.md\fR\.
.
.IP "\(bu" 4
\fB\-\-puppet\fR, \fB\-p\fR, and \fB\-\-no\-puppet\fR are removed and fail as unknown options: Facts follows Facter's input/output contract, not Puppet's runtime behavior\. Facter's own external\-fact directories (including \fI/opt/puppetlabs/facter/facts\.d\fR) are still read; to load Puppet's agent\-synced module facts pass \fB\-\-external\-dir /opt/puppetlabs/puppet/cache/facts\.d\fR (see \fIdocs/adr/0009\-facter\-contract\-not\-puppet\-runtime\.md\fR)\.
.
.IP "\(bu" 4
\fB\-\-sequential\fR is accepted for compatibility; the Go engine resolves facts deterministically\. \fB\-\-trace\fR is removed along with the Ruby DSL layer (its only function was Ruby custom\-fact backtraces) and fails as an unknown option\.
.
.IP "\(bu" 4
Legacy alias facts (Ruby Facter\'s deprecated flat aliases such as \fBoperatingsystem\fR, \fBhostname\fR, \fBprocessorcount\fR, \fBsshfp_*\fR, \fBmtu_*\fR) are removed entirely: they do not resolve in any output mode or query, the \fB\-\-show\-legacy\fR and \fB\-\-no\-show\-legacy\fR options fail as unknown options, the \fBshow\-legacy\fR config key is inert, and a \fBlegacy\fR blocklist entry blocks nothing\. Use the structured facts instead (\fBos\.name\fR, \fBnetworking\.hostname\fR, \fBprocessors\.count\fR, \fBssh\.*\fR); the full alias\-to\-structured table is in \fIdocs/adr/0007\-no\-legacy\-facts\-structured\-tree\-only\.md\fR\.
.
.IP "\(bu" 4
Facts that cannot resolve a value or do not apply to the platform are omitted entirely instead of appearing with empty or placeholder values: \fBaugeas\fR without an augparse binary, \fBdisks\fR and \fBpartitions\fR when no devices enumerate, \fBprocessors\.speed\fR when the speed is unknown, \fBfips_enabled\fR outside Linux and Windows, and \fBos\.selinux\fR outside Linux\. Conversely, \fBprocessors\.extensions\fR is a deliberate deviation the other way: it reports accurate instruction\-set extension data (for example on Apple Silicon Macs) even where Ruby Facter 4 has no such key\.
.
.IP "\(bu" 4
Primary IPv6 selection deviates from Ruby Facter 4: \fBnetworking\.ip6\fR, \fBnetworking\.network6\fR, and \fBnetworking\.scope6\fR prefer routable addresses on the primary interface \(em global scope first, then unique\-local, then link\-local \(em where Ruby reports the first\-bound address, which on some platforms (notably macOS) is the \fBfe80::\fR link\-local\. A primary interface that carries only link\-local IPv6 still reports it, with \fBscope6\fR \fBlink\fR, matching Ruby\.
.
.IP "" 0
.
.SH "FILES"
\fI/etc/facts/facts\.conf\fR
.
.P
The facts\-native HOCON config file, consulted first\. It can be used to specify directories for external facts, set various command line options, and specify facts to block\. See example below for details, or visit the GitHub README \fIhttps://github\.com/puppetlabs/puppetlabs\-hocon#overview\fR\.
.
.P
\fI/etc/puppetlabs/facter/facter\.conf\fR
.
.P
The facter\-compatible config file, read only when no facts\-native config file exists\. Both files are parsed with identical semantics; \fB\-\-config\fR overrides both\. On Windows the paths are \fIC:/ProgramData/facts/facts\.conf\fR and \fIC:/ProgramData/PuppetLabs/facter/etc/facter\.conf\fR\.
.
.SH "EXAMPLES"
Display all facts:
.
.IP "" 4
.
.nf
$ facts
disks => {
sda => {
model => "Virtual disk",
size => "8\.00 GiB",
size_bytes => 8589934592,
vendor => "ExampleVendor"
}
}
dmi => {
bios => {
release_date => "06/23/2013",
vendor => "Example Vendor",
version => "6\.00"
}
}
[\.\.\.]
.
.fi
.
.IP "" 0
.
.P
Display a single structured fact:
.
.IP "" 4
.
.nf
$ facts processors
{
count => 2,
isa => "x86_64",
models => [
"Intel(R) Xeon(R) CPU E5\-2680 v2 @ 2\.80GHz",
"Intel(R) Xeon(R) CPU E5\-2680 v2 @ 2\.80GHz"
],
physicalcount => 2
}
.
.fi
.
.IP "" 0
.
.P
Display a single fact nested within a structured fact:
.
.IP "" 4
.
.nf
$ facts processors\.isa
x86_64
.
.fi
.
.IP "" 0
.
.P
Format facts as JSON:
.
.IP "" 4
.
.nf
$ facts \-\-json os\.name os\.release\.major processors\.isa
{
"os\.name": "Ubuntu",
"os\.release\.major": "14\.04",
"processors\.isa": "x86_64"
}
.
.fi
.
.IP "" 0
.
.P
An example config file\.
.
.IP "" 4
.
.nf
# always loaded (CLI and as Ruby module)
global : {
external\-dir : "~/external/facts",
no\-external\-facts : false
}
# loaded when running from the command line
cli : {
debug : false,
verbose : false,
log\-level : "info"
}
# always loaded, fact\-specific configuration
facts : {
# for valid blocklist entries, use \-\-list\-block\-groups
blocklist : [ "file system", "EC2" ],
# for valid time\-to\-live entries, use \-\-list\-cache\-groups
ttls : [ { "timezone" : 30 days } ]
}
.
.fi
.
.IP "" 0