Skip to content

Commit e76ec65

Browse files
authored
Merge pull request OpenVoxProject#45 from OpenVoxProject/man
2 parents cbf3956 + d6ee8aa commit e76ec65

File tree

5 files changed

+217
-406
lines changed

5 files changed

+217
-406
lines changed

Gemfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,3 @@ group(:integration, optional: true) do
1818
# 1.16.0 - 1.16.2 are broken on Windows
1919
gem 'ffi', '>= 1.15.5', '< 1.17.0', '!= 1.16.0', '!= 1.16.1', '!= 1.16.2', require: false
2020
end
21-
22-
group(:documentation) do
23-
gem 'ronn', '~> 0.7.3', require: false, platforms: [:ruby]
24-
end

lib/facter/templates/man.erb

Lines changed: 49 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,40 @@
1-
<%# encoding: UTF-8%>
2-
facter - collect and display facts about the current system
3-
===========================================================
4-
5-
SYNOPSIS
6-
--------
7-
<b>facter</b> [options] [query] [query] [...]
8-
9-
DESCRIPTION
10-
-----------
11-
<b>facter</b> is a command-line tool that gathers basic facts about nodes (systems) such as hardware details, network settings, OS type and version, and more. These facts are made available as variables in your Puppet manifests and can be used to inform conditional expressions in Puppet.
12-
1+
<%# encoding: UTF-8 -%>
2+
.Dd <%= Time.now.strftime("%b %d, %Y") %>
3+
.Dt FACTER 1
4+
.Os
5+
.Sh NAME
6+
.Nm facter
7+
.Nd collect and display facts about the current system
8+
.Sh SYNOPSIS
9+
.Nm
10+
.Op Ar options
11+
.Op Ar query ...
12+
<% Facter::Cli.commands.select { |_k, command_class| command_class.instance_of?(Thor::Command) }.each do |name, command| -%>
13+
.Nm
14+
.Fl Fl <%= name.to_s.gsub('_','-') %>
15+
<% end -%>
16+
.Sh DESCRIPTION
17+
.Nm
18+
is a command-line tool that gathers basic facts about nodes (systems) such as hardware details, network settings, OS type and version, and more.
19+
These facts are made available as variables in your Puppet manifests and can be used to inform conditional expressions in Puppet.
20+
.Pp
1321
If no queries are given, then all facts will be returned.
14-
22+
.Pp
1523
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.
16-
17-
OPTIONS
18-
-------
19-
<% Facter::Cli.class_options.each do |name, option| -%><% next if option.hide%>
20-
* `<%= option.aliases[0] + '`, `' if option.aliases.any? %>--<%= 'no-' if negate_options.include?(name.to_s)%><%= name.to_s.gsub('_','-') %>`:
21-
22-
<%= option.description %>
23-
24-
<% end -%>
25-
26-
<% Facter::Cli.commands.select { |_k, command_class| command_class.instance_of?(Thor::Command) }.each do |_, command| -%>
27-
* `<%= command.usage %>`:
28-
29-
<%= command.description %>
30-
31-
24+
.Sh OPTIONS
25+
.Bl -tag
26+
<% Facter::Cli.class_options.each do |name, option| -%><% next if option.hide-%>
27+
.It <% if option.aliases.any? %>Fl <%= option.aliases[0].sub(/^-/, '') %> , <% end %>Fl Fl <%= 'no-' if negate_options.include?(name.to_s)%><%= name.to_s.gsub('_','-') %><% if option.type == :string %>= Ns Ar value<% end %>
28+
<%= option.description %>
3229
<% end -%>
33-
34-
FILES
35-
-----
36-
<em>/etc/puppetlabs/facter/facter.conf</em>
37-
30+
.El
31+
.Sh FILES
32+
.Bl -tag
33+
.It /etc/puppetlabs/facter/facter.conf
3834
A HOCON config file that can be used to specify directories for custom and external facts, set various command line options, and specify facts to block. See example below for details, or visit the [GitHub README](https://github.com/puppetlabs/puppetlabs-hocon#overview).
39-
40-
EXAMPLES
41-
--------
35+
.Sh EXAMPLES
4236
Display all facts:
43-
44-
```
37+
.Bd -literal -offset indent
4538
$ facter
4639
disks => {
4740
sda => {
@@ -59,11 +52,10 @@ dmi => {
5952
}
6053
}
6154
[...]
62-
```
63-
55+
.Ed
56+
.Pp
6457
Display a single structured fact:
65-
66-
```
58+
.Bd -literal -offset indent
6759
$ facter processors
6860
{
6961
count => 2,
@@ -74,37 +66,33 @@ $ facter processors
7466
],
7567
physicalcount => 2
7668
}
77-
```
78-
69+
.Ed
70+
.Pp
7971
Display a single fact nested within a structured fact:
80-
81-
```
72+
.Bd -literal -offset indent
8273
$ facter processors.isa
8374
x86_64
84-
```
85-
75+
.Ed
76+
.Pp
8677
Display a single legacy fact. Note that non-structured facts existing in previous versions of Facter are still available,
8778
but are not displayed by default due to redundancy with newer structured facts:
88-
89-
```
79+
.Bd -literal -offset indent
9080
$ facter processorcount
9181
2
92-
```
93-
82+
.Ed
83+
.Pp
9484
Format facts as JSON:
95-
96-
```
85+
.Bd -literal -offset indent
9786
$ facter --json os.name os.release.major processors.isa
9887
{
9988
"os.name": "Ubuntu",
10089
"os.release.major": "14.04",
10190
"processors.isa": "x86_64"
10291
}
103-
```
104-
105-
An example config file.
106-
107-
```
92+
.Ed
93+
.Pp
94+
An example config file:
95+
.Bd -literal -offset indent
10896
# always loaded (CLI and as Ruby module)
10997
global : {
11098
external-dir : "~/external/facts",
@@ -130,4 +118,4 @@ facts : {
130118
# for valid time-to-live entries, use --list-cache-groups
131119
ttls : [ { "timezone" : 30 days } ]
132120
}
133-
```
121+
.Ed

man/man1/facter.1

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
.Dd Aug 22, 2025
2+
.Dt FACTER 1
3+
.Os
4+
.Sh NAME
5+
.Nm facter
6+
.Nd collect and display facts about the current system
7+
.Sh SYNOPSIS
8+
.Nm
9+
.Op Ar options
10+
.Op Ar query ...
11+
.Nm
12+
.Fl Fl version
13+
.Nm
14+
.Fl Fl list-block-groups
15+
.Nm
16+
.Fl Fl list-cache-groups
17+
.Nm
18+
.Fl Fl help
19+
.Sh DESCRIPTION
20+
.Nm
21+
is a command-line tool that gathers basic facts about nodes (systems) such as hardware details, network settings, OS type and version, and more.
22+
These facts are made available as variables in your Puppet manifests and can be used to inform conditional expressions in Puppet.
23+
.Pp
24+
If no queries are given, then all facts will be returned.
25+
.Pp
26+
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.
27+
.Sh OPTIONS
28+
.Bl -tag
29+
.It Fl Fl color
30+
Enable color output.
31+
.It Fl Fl no-color
32+
Disable color output.
33+
.It Fl c , Fl Fl config= Ns Ar value
34+
The location of the config file.
35+
.It Fl Fl custom-dir= Ns Ar value
36+
A directory to use for custom facts.
37+
.It Fl d , Fl Fl debug
38+
Enable debug output.
39+
.It Fl Fl external-dir= Ns Ar value
40+
A directory to use for external facts.
41+
.It Fl Fl hocon
42+
Output in Hocon format.
43+
.It Fl j , Fl Fl json
44+
Output in JSON format.
45+
.It Fl l , Fl Fl log-level= Ns Ar value
46+
Set logging level. Supported levels are: none, trace, debug, info, warn, error, and fatal.
47+
.It Fl Fl no-block
48+
Disable fact blocking.
49+
.It Fl Fl no-cache
50+
Disable loading and refreshing facts from the cache
51+
.It Fl Fl no-custom-facts
52+
Disable custom facts.
53+
.It Fl Fl no-external-facts
54+
Disable external facts.
55+
.It Fl Fl no-ruby
56+
Disable loading Ruby, facts requiring Ruby, and custom facts.
57+
.It Fl Fl trace
58+
Enable backtraces for custom facts.
59+
.It Fl Fl verbose
60+
Enable verbose (info) output.
61+
.It Fl Fl show-legacy
62+
Show legacy facts when querying all facts.
63+
.It Fl y , Fl Fl yaml
64+
Output in YAML format.
65+
.It Fl Fl strict
66+
Enable more aggressive error reporting.
67+
.It Fl t , Fl Fl timing
68+
Show how much time it took to resolve each fact
69+
.It Fl Fl sequential
70+
Resolve facts sequentially
71+
.It Fl Fl http-debug
72+
Whether to write HTTP request and responses to stderr. This should never be used in production.
73+
.It Fl p , Fl Fl puppet
74+
Load the Puppet libraries, thus allowing Facter to load Puppet-specific facts.
75+
.El
76+
.Sh FILES
77+
.Bl -tag
78+
.It /etc/puppetlabs/facter/facter.conf
79+
A HOCON config file that can be used to specify directories for custom and external facts, set various command line options, and specify facts to block. See example below for details, or visit the [GitHub README](https://github.com/puppetlabs/puppetlabs-hocon#overview).
80+
.Sh EXAMPLES
81+
Display all facts:
82+
.Bd -literal -offset indent
83+
$ facter
84+
disks => {
85+
sda => {
86+
model => "Virtual disk",
87+
size => "8.00 GiB",
88+
size_bytes => 8589934592,
89+
vendor => "ExampleVendor"
90+
}
91+
}
92+
dmi => {
93+
bios => {
94+
release_date => "06/23/2013",
95+
vendor => "Example Vendor",
96+
version => "6.00"
97+
}
98+
}
99+
[...]
100+
.Ed
101+
.Pp
102+
Display a single structured fact:
103+
.Bd -literal -offset indent
104+
$ facter processors
105+
{
106+
count => 2,
107+
isa => "x86_64",
108+
models => [
109+
"Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz",
110+
"Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz"
111+
],
112+
physicalcount => 2
113+
}
114+
.Ed
115+
.Pp
116+
Display a single fact nested within a structured fact:
117+
.Bd -literal -offset indent
118+
$ facter processors.isa
119+
x86_64
120+
.Ed
121+
.Pp
122+
Display a single legacy fact. Note that non-structured facts existing in previous versions of Facter are still available,
123+
but are not displayed by default due to redundancy with newer structured facts:
124+
.Bd -literal -offset indent
125+
$ facter processorcount
126+
2
127+
.Ed
128+
.Pp
129+
Format facts as JSON:
130+
.Bd -literal -offset indent
131+
$ facter --json os.name os.release.major processors.isa
132+
{
133+
"os.name": "Ubuntu",
134+
"os.release.major": "14.04",
135+
"processors.isa": "x86_64"
136+
}
137+
.Ed
138+
.Pp
139+
An example config file:
140+
.Bd -literal -offset indent
141+
# always loaded (CLI and as Ruby module)
142+
global : {
143+
external-dir : "~/external/facts",
144+
custom-dir : [
145+
"~/custom/facts",
146+
"~/custom/facts/more-facts"
147+
],
148+
no-external-facts : false,
149+
no-custom-facts : false,
150+
no-ruby : false
151+
}
152+
# loaded when running from the command line
153+
cli : {
154+
debug : false,
155+
trace : true,
156+
verbose : false,
157+
log-level : "info"
158+
}
159+
# always loaded, fact-specific configuration
160+
facts : {
161+
# for valid blocklist entries, use --list-block-groups
162+
blocklist : [ "file system", "EC2" ],
163+
# for valid time-to-live entries, use --list-cache-groups
164+
ttls : [ { "timezone" : 30 days } ]
165+
}
166+
.Ed

0 commit comments

Comments
 (0)