facterdb 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.gitmodules +3 -0
- data/CHANGELOG.md +9 -0
- data/README.md +123 -66
- data/Rakefile +86 -0
- data/facts/1.6/ubuntu-18.04-x86_64.facts +59 -0
- data/facts/1.7/ubuntu-18.04-x86_64.facts +85 -0
- data/facts/2.0/ubuntu-18.04-x86_64.facts +86 -0
- data/facts/2.1/ubuntu-18.04-x86_64.facts +96 -0
- data/facts/2.2/ubuntu-18.04-x86_64.facts +127 -0
- data/facts/2.3/ubuntu-18.04-x86_64.facts +128 -0
- data/facts/2.4/ubuntu-18.04-x86_64.facts +129 -0
- data/facts/2.5/ubuntu-18.04-x86_64.facts +129 -0
- data/facts/3.9/solaris-10-i386.facts +679 -0
- data/facts/3.9/solaris-10-x86_64.facts +679 -0
- data/facts/Vagrantfile +6 -0
- data/hugo/archetypes/default.md +6 -0
- data/hugo/config.toml +155 -0
- data/hugo/content/.placeholder +0 -0
- data/images/facterdb.png +0 -0
- data/images/facterdb.svg +439 -0
- data/lib/facterdb.rb +20 -1
- data/lib/facterdb/version.rb +1 -1
- data/spec/facterdb_spec.rb +0 -1
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08ba2383bacdc56efdb30e671bbf94299ffc7c08c4537f46bb8fae32ff6af19c'
|
4
|
+
data.tar.gz: 7ad4a98eac45cc04368e4153f49b1712d532dbceba16c0402a99a2227f2d51a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76e0c53491360d5de231666f3ad9886b54f1a81c777d4f130f120f8c4d77429c2b6a3c757b3959786cab381f126d38b4a0d35d344fe53a67b4b6fceded04c648
|
7
|
+
data.tar.gz: bd485edd94e05721f12ea0aac72cd24eeef993927980ba6ed46066b9bf12fa73a1856077044ceea54cdc5482186e1a2492d7ab073b4a50057377f93cc9b3fc56
|
data/.gitignore
CHANGED
data/.gitmodules
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [0.5.2](https://rubygems.org/gems/facterdb/versions/0.5.2) (2018-04-30)
|
4
|
+
[Full Changelog](https://github.com/camptocamp/facterdb/compare/0.5.1...0.5.2)
|
5
|
+
|
6
|
+
**Merged pull requests:**
|
7
|
+
|
8
|
+
- add Ubuntu 18.04 facts [\#82](https://github.com/camptocamp/facterdb/pull/82) ([bastelfreak](https://github.com/bastelfreak))
|
9
|
+
- \(maint\) Add `rake table` task + update README.md + better Windows detection [\#76](https://github.com/camptocamp/facterdb/pull/76) ([glennsarti](https://github.com/glennsarti))
|
10
|
+
- Added Solaris 10 facts on Facter 3.9 [\#75](https://github.com/camptocamp/facterdb/pull/75) ([sirinek](https://github.com/sirinek))
|
11
|
+
|
3
12
|
## [0.5.1](https://rubygems.org/gems/facterdb/versions/0.5.1) (2018-03-06)
|
4
13
|
[Full Changelog](https://github.com/camptocamp/facterdb/compare/0.5.0...0.5.1)
|
5
14
|
|
data/README.md
CHANGED
@@ -9,6 +9,8 @@ facterdb
|
|
9
9
|
|
10
10
|
A Gem that contains a lot of facts for a lot of Operating Systems.
|
11
11
|
|
12
|
+
![FacterDB](images/facterdb.png)
|
13
|
+
|
12
14
|
# Usage
|
13
15
|
|
14
16
|
## CLI
|
@@ -54,69 +56,86 @@ require 'facterdb'
|
|
54
56
|
FacterDB::get_facts('osfamily=Debian')
|
55
57
|
```
|
56
58
|
|
57
|
-
## Facter
|
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
|
-
|
59
|
+
## Facter version and Operating System coverage
|
60
|
+
|
61
|
+
| operating system | 1.6 | 1.7 | 2.0 | 2.1 | 2.2 | 2.3 | 2.4 | 2.5 | 3.0 | 3.1 | 3.2 | 3.3 | 3.4 | 3.5 | 3.6 | 3.7 | 3.8 | 3.9 |
|
62
|
+
| --------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
63
|
+
| AIX 5300 | | | | | | | | | | | 1 | | | | | | | |
|
64
|
+
| AIX 6100 | | | | | | | | | | | 1 | | | | | | | |
|
65
|
+
| AIX 7100 | | | | | | | | | | | 1 | | | | | | | 1 |
|
66
|
+
| Amazon | 2 | | | | | | | | | | | | | | | | | |
|
67
|
+
| Amazon 2017 | | | | | 1 | 1 | 1 | | | | | | | | 1 | | | |
|
68
|
+
| Amazon 4 | | 1 | 1 | 1 | | | | | 1 | 1 | | 1 | | | | | | |
|
69
|
+
| Archlinux | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 1 | | | | | | | | | | 1 |
|
70
|
+
| CentOS 5 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | 2 | 2 | 2 | 2 | 2 | 2 | |
|
71
|
+
| CentOS 6 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | 2 | 2 | 2 | 2 | 2 | 2 | |
|
72
|
+
| CentOS 7 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 1 | 2 | 2 | | 2 | 1 | 1 | 2 | 1 | 1 | |
|
73
|
+
| Darwin | | | 2 | 2 | | | | | | | | | | | | | | |
|
74
|
+
| Darwin 14 | | | 2 | 2 | 2 | 2 | 2 | 1 | | 1 | | 1 | 1 | 1 | 1 | 1 | 1 | |
|
75
|
+
| Darwin 15 | | | | | 1 | 1 | 1 | 1 | | 1 | | 1 | 1 | 1 | 1 | 1 | 1 | |
|
76
|
+
| Darwin 16 | | | | | 1 | 1 | 1 | 1 | | | | | 1 | 1 | 1 | 1 | 1 | |
|
77
|
+
| Debian 1 | | | | | | 1 | | | | | | | | | | | | |
|
78
|
+
| Debian 6 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | 2 | 2 | | | | | | | | |
|
79
|
+
| Debian 7 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | 2 | 2 | 2 | 2 | 2 | 2 | |
|
80
|
+
| Debian 8 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | 2 | 2 | 2 | 2 | 2 | 2 | |
|
81
|
+
| Debian 9 | | | 2 | 2 | 2 | 1 | 2 | 2 | | | | | | | | | 2 | |
|
82
|
+
| Fedora 19 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | |
|
83
|
+
| Fedora 20 | | 11 | | | | | | | | | | | | | | | | |
|
84
|
+
| Fedora 21 | | | | | | | 11 | | | | | | | | | | | |
|
85
|
+
| Fedora 22 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | | 2 | | | | | | | | |
|
86
|
+
| Fedora 23 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | | 2 | | | | | | | | |
|
87
|
+
| Fedora 24 | 1 | 1 | 2 | 2 | 2 | 2 | 2 | 2 | | | | 2 | 2 | 2 | 2 | 2 | | |
|
88
|
+
| Fedora 25 | | | 2 | 2 | 2 | 2 | 2 | 2 | | | | | | | 2 | 2 | 2 | |
|
89
|
+
| Fedora 26 | | | | | | | 11 | | | | | | | | | | | |
|
90
|
+
| FreeBSD 10 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 1 | | | | | | | | | | 1 |
|
91
|
+
| FreeBSD 11 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | | | | | | | | | | 1 |
|
92
|
+
| FreeBSD 9 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | |
|
93
|
+
| Gentoo | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | |
|
94
|
+
| LinuxMint 18 | | | | | | | | | | 1 | | 1 | | | | | | |
|
95
|
+
| OpenBSD 5.7 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | |
|
96
|
+
| OpenBSD 5.8 | | | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | |
|
97
|
+
| OpenBSD 5.9 | | | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | |
|
98
|
+
| OpenBSD 6.0 | | | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | |
|
99
|
+
| OpenSuSE 12 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | |
|
100
|
+
| OpenSuSE 13 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | |
|
101
|
+
| OpenSuSE 42 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | | | | | 1 | 1 | 1 | 1 | 1 | 1 |
|
102
|
+
| OracleLinux 5 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | 2 | 2 | 2 | 2 | 2 | 2 | |
|
103
|
+
| OracleLinux 6 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | 2 | 2 | 2 | 2 | 2 | 2 | |
|
104
|
+
| OracleLinux 7 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 1 | 2 | 2 | | 2 | 1 | 1 | 2 | 1 | 1 | |
|
105
|
+
| RedHat 5 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | 2 | 2 | 2 | 2 | 2 | 2 | |
|
106
|
+
| RedHat 6 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | 2 | 2 | 2 | 3 | 2 | 2 | |
|
107
|
+
| RedHat 7 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 1 | 2 | 2 | | 2 | 1 | 1 | 2 | 1 | 1 | |
|
108
|
+
| SLES 11 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | | | | 2 | 2 | 2 | 2 | 2 | |
|
109
|
+
| SLES 12 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | | | | | 1 | 1 | 1 | 1 | 1 | |
|
110
|
+
| Scientific 5 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | 2 | 2 | 2 | 2 | 2 | 2 | |
|
111
|
+
| Scientific 6 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | 2 | 2 | 2 | 2 | 2 | 2 | |
|
112
|
+
| Scientific 7 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 1 | 2 | 2 | | 2 | 1 | 1 | 2 | 1 | 1 | |
|
113
|
+
| Solaris | | | | | | | | | | | | | | | | | | 2 |
|
114
|
+
| Solaris 1 | | | | | | | | 1 | | | | | | | | | | |
|
115
|
+
| Solaris 11 | 2 | 2 | | | | | | | | | | | | | | | | |
|
116
|
+
| Solaris 2 | | | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | |
|
117
|
+
| Ubuntu 10.04 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | |
|
118
|
+
| Ubuntu 12.04 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | 2 | 2 | 2 | | | | |
|
119
|
+
| Ubuntu 14.04 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | 2 | 2 | 2 | 2 | 2 | 2 | |
|
120
|
+
| Ubuntu 14.10 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | |
|
121
|
+
| Ubuntu 15.04 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | |
|
122
|
+
| Ubuntu 15.10 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | 2 | 2 | | 2 | 2 | 2 | | | | |
|
123
|
+
| Ubuntu 16.04 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | 2 | | 2 | 2 | 2 | 2 | 2 | 2 | |
|
124
|
+
| Ubuntu 16.10 | | | | | | | | | | | | | | | 2 | | | |
|
125
|
+
| Ubuntu 18.04 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | | | | | | | 0 | | | |
|
126
|
+
| Windows 10 | | | | | | | | 2 | | | | | 2 | 2 | 2 | 2 | 2 | |
|
127
|
+
| Windows 10.0.14393 | | | | 2 | 2 | 2 | 2 | | 2 | 2 | | 2 | | | | | | |
|
128
|
+
| Windows 7 | | | | 1 | 1 | 1 | 2 | 1 | 2 | 2 | | 1 | 1 | 1 | 1 | 1 | 1 | |
|
129
|
+
| Windows 8.1 | | | | 1 | 1 | 1 | 1 | 1 | 1 | 1 | | 1 | 1 | 1 | 1 | 1 | 1 | |
|
130
|
+
| Windows Server 10.0.14393 | | | | 1 | 1 | 1 | 1 | 1 | 1 | 1 | | 1 | | | | | | |
|
131
|
+
| Windows Server 2008 | | | | 1 | 1 | 1 | 1 | 1 | 1 | 1 | | 1 | 1 | 1 | 1 | 1 | 1 | |
|
132
|
+
| Windows Server 2008 R2 | | | | 1 | 1 | 1 | 1 | 1 | 1 | 1 | | 1 | 1 | 1 | 1 | 1 | 1 | |
|
133
|
+
| Windows Server 2012 | | | | 1 | 1 | 1 | 1 | 1 | 1 | 1 | | 1 | 1 | 1 | 1 | 1 | 1 | |
|
134
|
+
| Windows Server 2012 R2 | | | | 1 | 1 | 1 | 2 | 1 | 1 | 1 | | 1 | 1 | 1 | 1 | 1 | 1 | |
|
135
|
+
| Windows Server 2012 R2 Core | | | | 1 | 1 | 1 | 1 | 1 | 1 | 1 | | 1 | 1 | 1 | 1 | 1 | 1 | |
|
136
|
+
| Windows Server 2016 | | | | | | | | | | | | | 1 | 1 | 1 | 1 | 1 | |
|
137
|
+
|
138
|
+
Where the number (1, 2 etc.) are the number of factsets for that OS and facter combination (e.g., x86_64 and i386 architectures)
|
120
139
|
|
121
140
|
## Add new Operating System support
|
122
141
|
|
@@ -144,13 +163,13 @@ for file in facts/*/centos-*.facts; do cat $file | sed -e 's/CentOS/OracleLinux/
|
|
144
163
|
The default facts are great for many things but there will be times when you need to have facterdb search custom
|
145
164
|
fact sets that only make sense in your environment or might contain sensitive information.
|
146
165
|
|
147
|
-
This can be useful when combined with [rspec_puppet_facts](https://github.com/mcanevet/rspec-puppet-facts) or the [puppet-debugger](https://github.com/nwops/puppet-debugger) which both use this gem.
|
166
|
+
This can be useful when combined with [rspec_puppet_facts](https://github.com/mcanevet/rspec-puppet-facts) or the [puppet-debugger](https://github.com/nwops/puppet-debugger) which both use this gem.
|
148
167
|
|
149
168
|
To supply external facts to facterdb just set the `FACTERDB_SEARCH_PATHS` environment variable with one or more
|
150
169
|
paths to your facts. Do this any time facterdb is used directly or indirectly.
|
151
170
|
|
152
|
-
When separating paths please use the default path separator character supported by your OS.
|
153
|
-
* Unix/Linux/OSX = `:`
|
171
|
+
When separating paths please use the default path separator character supported by your OS.
|
172
|
+
* Unix/Linux/OSX = `:`
|
154
173
|
* Windows = `;`
|
155
174
|
|
156
175
|
Each fact set you create must meet the following requirements:
|
@@ -192,6 +211,44 @@ FACTERDB_SEARCH_PATHS="/var/opt/lib/custom_facts:/tmp/custom_facts:/home/user1/c
|
|
192
211
|
FACTERDB_SKIP_DEFAULTDB='yes'
|
193
212
|
```
|
194
213
|
|
214
|
+
## Debugging fact sets
|
215
|
+
|
216
|
+
By setting the environment variable `FACTERDB_INJECT_SOURCE` the following facts are injected into all fact sets:
|
217
|
+
|
218
|
+
`_facterdb_path` : The base name of the file used to load this fact set e.g. `centos-5-i386.facts`
|
219
|
+
|
220
|
+
`_facterdb_filename` : The full path of the file used to load this fact set e.g. `/project/facter-db/centos-5-i386.facts`
|
221
|
+
|
222
|
+
|
223
|
+
``` json
|
224
|
+
{
|
225
|
+
"_facterdb_path": "centos-5-i386.facts",
|
226
|
+
"_facterdb_filename": "/project/facter-db/centos-5-i386.facts",
|
227
|
+
"aio_agent_version": "1.8.3",
|
228
|
+
"architecture": "i386",
|
229
|
+
"augeas": {
|
230
|
+
"version": "1.4.0"
|
231
|
+
},
|
232
|
+
"augeasversion": "1.4.0",
|
233
|
+
"bios_release_date": "07/30/2013",
|
234
|
+
"bios_vendor": "Phoenix Technologies LTD",
|
235
|
+
"bios_version": "6.00",
|
236
|
+
"blockdevice_fd0_size": 4096,
|
237
|
+
"blockdevice_hdc_size": 4294965248,
|
238
|
+
"blockdevice_sda_model": "Virtual disk",
|
239
|
+
...
|
240
|
+
```
|
241
|
+
|
242
|
+
To set the environment variable use;
|
243
|
+
|
244
|
+
``` bash
|
245
|
+
bash> FACTERDB_INJECT_SOURCE='true'
|
246
|
+
```
|
247
|
+
or on Windows
|
248
|
+
``` powershell
|
249
|
+
powershell> $ENV:FACTERDB_INJECT_SOURCE = 'true'
|
250
|
+
```
|
251
|
+
|
195
252
|
# Contributing
|
196
253
|
|
197
254
|
Please submit issues at https://github.com/camptocamp/facterdb/issues or PRs in the same repository.
|
data/Rakefile
CHANGED
@@ -21,3 +21,89 @@ rescue LoadError
|
|
21
21
|
raise 'Install github_changelog_generator to get access to automatic changelog generation'
|
22
22
|
end
|
23
23
|
end
|
24
|
+
|
25
|
+
|
26
|
+
# Generate a human-friendly OS label based on a given factset
|
27
|
+
def factset_to_os_label(fs)
|
28
|
+
os_rel = '???'
|
29
|
+
os_name = '????'
|
30
|
+
if fs.key?(:os) && (fs[:os]['release']['major'] =~ /\d/)
|
31
|
+
os_name = fs[:os]['name']
|
32
|
+
os_rel = fs[:os]['release']['major']
|
33
|
+
os__rel = fs[:os]['release']['full']
|
34
|
+
elsif fs.key? :operatingsystem
|
35
|
+
os_name = fs[:operatingsystem]
|
36
|
+
os_rel = fs.fetch(:operatingsystemmajrelease, fs.fetch(:lsbmajdistrelease, nil))
|
37
|
+
os__rel = fs.fetch(:lsbdistrelease, fs.fetch(:operatingsystemrelease, '@@@'))
|
38
|
+
else
|
39
|
+
require 'pp'
|
40
|
+
pp fs
|
41
|
+
fail( 'ERROR: unrecognized facterset format' )
|
42
|
+
end
|
43
|
+
|
44
|
+
# Sanitize OS names to match the formats used in the facterdb README
|
45
|
+
label = "#{os_name} #{os_rel}"
|
46
|
+
if os_name =~ /^(Archlinux|Gentoo)$/
|
47
|
+
label = os_name
|
48
|
+
elsif os_name =~ /^(SLES|FreeBSD|OpenSuSE)$/ ||
|
49
|
+
(os_name =~ /^(RedHat|Scientific|OracleLinux|CentOS)/ && os_rel.nil?)
|
50
|
+
label = "#{os_name} #{os__rel.split('.').first}"
|
51
|
+
elsif os_name =~ /^(OpenBSD|Ubuntu|Fedora)$/
|
52
|
+
label = "#{os_name} #{os__rel}"
|
53
|
+
elsif os_name =~ /^(Solaris)/
|
54
|
+
label = "#{os_name} #{os__rel.split('.')[1]}"
|
55
|
+
elsif os_name =~ /^windows$/
|
56
|
+
db_filename = fs[:_facterdb_filename] || 'there_is_no_filename'
|
57
|
+
if db_filename =~ /windows-10-/
|
58
|
+
label = "Windows #{os__rel}"
|
59
|
+
elsif db_filename =~ /windows-7-/
|
60
|
+
label = "Windows 7"
|
61
|
+
elsif db_filename =~ /windows-8[\d.]*-/
|
62
|
+
label = "Windows #{os__rel.sub('6.2.9200','8').sub('6.3.9600','8.1')}"
|
63
|
+
elsif db_filename =~ /windows-.+-core-/
|
64
|
+
label = "Windows Server #{os__rel.sub('6.3.9600','2012 R2')} Core"
|
65
|
+
elsif db_filename =~ /windows-2008/ || db_filename =~ /windows-2012/ || db_filename =~ /windows-2016/
|
66
|
+
label = "Windows Server #{os__rel.sub('6.1.7600','2008 R2').sub('6.3.9600','2012 R2')}"
|
67
|
+
else
|
68
|
+
label = "#{os_name} #{os__rel}"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
label
|
73
|
+
end
|
74
|
+
|
75
|
+
desc 'generate a markdown table of Facter/OS coverage (for the README)'
|
76
|
+
task :table do
|
77
|
+
require_relative 'lib/facterdb'
|
78
|
+
# Turn on the source injection
|
79
|
+
old_env = ENV['FACTERDB_INJECT_SOURCE']
|
80
|
+
ENV['FACTERDB_INJECT_SOURCE'] = 'true'
|
81
|
+
factsets = FacterDB.get_facts()
|
82
|
+
# Restore the source injection
|
83
|
+
ENV['FACTERDB_INJECT_SOURCE'] = old_env
|
84
|
+
|
85
|
+
facter_versions = factsets.map{ |x| x[:facterversion][0..2] }.uniq.sort
|
86
|
+
os_facter_matrix = {}
|
87
|
+
|
88
|
+
# Process the facts and create a hash of all the OS and facter combinations
|
89
|
+
factsets.each do |facts|
|
90
|
+
fv = facts[:facterversion][0..2]
|
91
|
+
label = factset_to_os_label(facts)
|
92
|
+
os_facter_matrix[label] ||= {}
|
93
|
+
os_facter_matrix[label][fv] ||= 0
|
94
|
+
os_facter_matrix[label][fv] += 1
|
95
|
+
end
|
96
|
+
# Extract the OS list
|
97
|
+
os_versions = os_facter_matrix.keys.uniq.sort
|
98
|
+
|
99
|
+
# Write out a nice table
|
100
|
+
os_version_width = (os_versions.map{|x| x.size } + [17]).max
|
101
|
+
puts "| #{'operating system'.center(os_version_width)} |#{facter_versions.map{|x| " #{x} |" }.join}"
|
102
|
+
puts "| #{'-' * (os_version_width)} |#{facter_versions.map{|x| " --- |" }.join}"
|
103
|
+
os_versions.each do |label|
|
104
|
+
fvs = facter_versions.map{ |facter_version| os_facter_matrix[label][facter_version] || 0 }
|
105
|
+
row = "| #{label.ljust(os_version_width)} |"
|
106
|
+
fvs.each { |fv| row += (fv > 0? " #{fv.to_s.center(3)} |" : " |" ) }
|
107
|
+
puts row
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
{
|
2
|
+
"gem_version": "~> 1.6.0",
|
3
|
+
"architecture": "amd64",
|
4
|
+
"kernel": "Linux",
|
5
|
+
"domain": "example.com",
|
6
|
+
"macaddress": "02:64:30:56:7d:5d",
|
7
|
+
"facterversion": "1.6.18",
|
8
|
+
"fqdn": "foo.example.com",
|
9
|
+
"hardwareisa": "x86_64",
|
10
|
+
"hardwaremodel": "x86_64",
|
11
|
+
"hostname": "foo",
|
12
|
+
"id": "root",
|
13
|
+
"interfaces": "enp0s3,lo",
|
14
|
+
"macaddress_enp0s3": "02:64:30:56:7d:5d",
|
15
|
+
"ipaddress": "10.0.2.15",
|
16
|
+
"kernelmajversion": "4.15",
|
17
|
+
"kernelrelease": "4.15.0-20-generic",
|
18
|
+
"kernelversion": "4.15.0",
|
19
|
+
"lsbdistcodename": "bionic",
|
20
|
+
"lsbdistdescription": "Ubuntu 18.04 LTS",
|
21
|
+
"lsbdistid": "Ubuntu",
|
22
|
+
"lsbdistrelease": "18.04",
|
23
|
+
"lsbmajdistrelease": "18",
|
24
|
+
"boardmanufacturer": "Oracle Corporation",
|
25
|
+
"boardproductname": "VirtualBox",
|
26
|
+
"boardserialnumber": "0",
|
27
|
+
"manufacturer": "innotek GmbH",
|
28
|
+
"productname": "VirtualBox",
|
29
|
+
"serialnumber": "0",
|
30
|
+
"type": "Other",
|
31
|
+
"memorysize": "985.29 MB",
|
32
|
+
"memoryfree": "825.46 MB",
|
33
|
+
"swapsize": "0.00 kB",
|
34
|
+
"swapfree": "0.00 kB",
|
35
|
+
"memorytotal": "985.29 MB",
|
36
|
+
"operatingsystem": "Ubuntu",
|
37
|
+
"operatingsystemrelease": "18.04",
|
38
|
+
"osfamily": "Debian",
|
39
|
+
"path": "/home/vagrant/vendor/bundler/ruby/2.5.0/bin:/opt/puppetlabs/puppet/bin:/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin",
|
40
|
+
"physicalprocessorcount": 1,
|
41
|
+
"processor0": "Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz",
|
42
|
+
"processor1": "Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz",
|
43
|
+
"processorcount": "2",
|
44
|
+
"ps": "ps -ef",
|
45
|
+
"rubysitedir": "/usr/local/lib/site_ruby/2.5.0",
|
46
|
+
"rubyversion": "2.5.1",
|
47
|
+
"selinux": "false",
|
48
|
+
"sshdsakey": "AAAAB3NzaC1kc3MAAACBAOxbdiIdeYY2BCEr+OzivbL0YhPsBG1QoHkowZKKEIbg1nGHBqXbQV7SCtdmcZ+QONgHNue8DAHEqp9LaOxF/BVc9rjypxaJGh0xzqB0MF2QiJQaZp4B2WlaI97ptHUmGRxCr/pfzqPH11bNtB+ES/kJv+4F21WI3B5bZcUawK5FAAAAFQDE+UQfjAkHXcFFBzgRCKL3x0SM4wAAAIEA2WA6UiBMhDyaH0mLD+QcLVCFmnh0uPmAomIV2SIaFgXShOb/RPdff55Qv5BLa29PTsc+hOu+3l+De4taWdnwT37b78I+p0omKhUnI3oL9q36KA/qeL69mHlVz2pakkyggiHCHgHNh7ckL1aC00/hpfEJunaa0sXFCJEfHWigwEMAAACBAJokMLhoq6dIIAuDwx2OxXaVN99Xa7Q/cBEcPUA1wMFo0rzdhixEoqpnWkYb84lZn7T/Iw0DA8hgVr474/JaTO5Jkwi9rXCsHIm3vmi9u4rRiE2dqwp6r4VhBDBnOQCmNJy4XixPaun3jyvvojlmKD+LoHGKYy+XXF3YRrY85Dep",
|
49
|
+
"sshrsakey": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDBNdwSef8dOKjhCnwsnq8qDUJlpKAu4+9BLaXHGpyDq9Wuo4HRq1rR1pD5b6zVAkryenTAQE1D52i4R3b0PE3lxs35gYnycLfcb3bsYQoznNQCM72/fgCMcnRuac74LbgjvqFN6n68PX/fv47st+aY+1Phv1EcWlr8BmPAxB7nJiK7LfveZRsHPoovo+/0XqdrTfQGy9xIAyvETiTqs5hCUGXfAczqYKN1XAdelQhaYczXgpR3Ha1OSaTuVv0n6u2mcudym16rsdiPdEUVNsOPlL909jp4vxU4Mf8maXRlthNAJqGaDNek4VRn31xJc12lHb8I6sQjSdJrcGOBKdZt",
|
50
|
+
"sshecdsakey": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJIwnVmuDVO3LpIIQ7brM4pt1Lo//8QJjpE/FeoEVYEezgYQzLhozqg5vIA+g9m1hxSDPNOfKa9ark0sO18AJRE=",
|
51
|
+
"timezone": "UTC",
|
52
|
+
"uniqueid": "007f0101",
|
53
|
+
"uptime": "0:09 hours",
|
54
|
+
"uptime_days": 0,
|
55
|
+
"uptime_hours": 0,
|
56
|
+
"uptime_seconds": 542,
|
57
|
+
"virtual": "virtualbox",
|
58
|
+
"is_virtual": "true"
|
59
|
+
}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
{
|
2
|
+
"gem_version": "~> 1.7.0",
|
3
|
+
"architecture": "amd64",
|
4
|
+
"kernel": "Linux",
|
5
|
+
"blockdevice_sdb_size": 10485760,
|
6
|
+
"blockdevice_sdb_vendor": "VBOX",
|
7
|
+
"blockdevice_sdb_model": "HARDDISK",
|
8
|
+
"blockdevice_sda_size": 10737418240,
|
9
|
+
"blockdevice_sda_vendor": "VBOX",
|
10
|
+
"blockdevice_sda_model": "HARDDISK",
|
11
|
+
"blockdevices": "sda,sdb",
|
12
|
+
"domain": "example.com",
|
13
|
+
"macaddress": "02:64:30:56:7d:5d",
|
14
|
+
"osfamily": "Debian",
|
15
|
+
"operatingsystem": "Ubuntu",
|
16
|
+
"lsbdistid": "Ubuntu",
|
17
|
+
"facterversion": "1.7.6",
|
18
|
+
"filesystems": "btrfs,ext2,ext3,ext4,iso9660,squashfs,vfat",
|
19
|
+
"fqdn": "foo.example.com",
|
20
|
+
"hardwareisa": "x86_64",
|
21
|
+
"hardwaremodel": "x86_64",
|
22
|
+
"hostname": "foo",
|
23
|
+
"id": "root",
|
24
|
+
"interfaces": "enp0s3,lo",
|
25
|
+
"ipaddress_enp0s3": "10.0.2.15",
|
26
|
+
"macaddress_enp0s3": "02:64:30:56:7d:5d",
|
27
|
+
"netmask_enp0s3": "255.255.255.0",
|
28
|
+
"ipaddress_lo": "127.0.0.1",
|
29
|
+
"netmask_lo": "255.0.0.0",
|
30
|
+
"ipaddress": "10.0.2.15",
|
31
|
+
"kernelmajversion": "4.15",
|
32
|
+
"kernelrelease": "4.15.0-20-generic",
|
33
|
+
"kernelversion": "4.15.0",
|
34
|
+
"lsbdistcodename": "bionic",
|
35
|
+
"lsbdistdescription": "Ubuntu 18.04 LTS",
|
36
|
+
"lsbdistrelease": "18.04",
|
37
|
+
"lsbmajdistrelease": "18",
|
38
|
+
"boardmanufacturer": "Oracle Corporation",
|
39
|
+
"boardproductname": "VirtualBox",
|
40
|
+
"boardserialnumber": "0",
|
41
|
+
"bios_vendor": "innotek GmbH",
|
42
|
+
"bios_version": "VirtualBox",
|
43
|
+
"bios_release_date": "12/01/2006",
|
44
|
+
"manufacturer": "innotek GmbH",
|
45
|
+
"productname": "VirtualBox",
|
46
|
+
"serialnumber": "0",
|
47
|
+
"uuid": "DEB76A7E-FDC2-4EEC-8542-832F11CC631A",
|
48
|
+
"type": "Other",
|
49
|
+
"memorysize": "985.29 MB",
|
50
|
+
"memoryfree": "823.46 MB",
|
51
|
+
"swapsize": "0.00 MB",
|
52
|
+
"swapfree": "0.00 MB",
|
53
|
+
"swapsize_mb": "0.00",
|
54
|
+
"swapfree_mb": "0.00",
|
55
|
+
"memorysize_mb": "985.29",
|
56
|
+
"memoryfree_mb": "823.46",
|
57
|
+
"memorytotal": "985.29 MB",
|
58
|
+
"netmask": "255.255.255.0",
|
59
|
+
"network_enp0s3": "10.0.2.0",
|
60
|
+
"network_lo": "127.0.0.0",
|
61
|
+
"operatingsystemrelease": "18.04",
|
62
|
+
"path": "/home/vagrant/vendor/bundler/ruby/2.5.0/bin:/opt/puppetlabs/puppet/bin:/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin",
|
63
|
+
"physicalprocessorcount": 1,
|
64
|
+
"processor0": "Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz",
|
65
|
+
"processor1": "Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz",
|
66
|
+
"processorcount": "2",
|
67
|
+
"ps": "ps -ef",
|
68
|
+
"rubysitedir": "/usr/local/lib/site_ruby/2.5.0",
|
69
|
+
"rubyversion": "2.5.1",
|
70
|
+
"selinux": "false",
|
71
|
+
"sshdsakey": "AAAAB3NzaC1kc3MAAACBAOxbdiIdeYY2BCEr+OzivbL0YhPsBG1QoHkowZKKEIbg1nGHBqXbQV7SCtdmcZ+QONgHNue8DAHEqp9LaOxF/BVc9rjypxaJGh0xzqB0MF2QiJQaZp4B2WlaI97ptHUmGRxCr/pfzqPH11bNtB+ES/kJv+4F21WI3B5bZcUawK5FAAAAFQDE+UQfjAkHXcFFBzgRCKL3x0SM4wAAAIEA2WA6UiBMhDyaH0mLD+QcLVCFmnh0uPmAomIV2SIaFgXShOb/RPdff55Qv5BLa29PTsc+hOu+3l+De4taWdnwT37b78I+p0omKhUnI3oL9q36KA/qeL69mHlVz2pakkyggiHCHgHNh7ckL1aC00/hpfEJunaa0sXFCJEfHWigwEMAAACBAJokMLhoq6dIIAuDwx2OxXaVN99Xa7Q/cBEcPUA1wMFo0rzdhixEoqpnWkYb84lZn7T/Iw0DA8hgVr474/JaTO5Jkwi9rXCsHIm3vmi9u4rRiE2dqwp6r4VhBDBnOQCmNJy4XixPaun3jyvvojlmKD+LoHGKYy+XXF3YRrY85Dep",
|
72
|
+
"sshfp_dsa": "SSHFP 2 1 666162d2f3db7264e766c04e259471760397660c\nSSHFP 2 2 5ee49d86bdab7004bc14977def1a1790ab2450eebd71d73238f38198b018e4f8",
|
73
|
+
"sshrsakey": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDBNdwSef8dOKjhCnwsnq8qDUJlpKAu4+9BLaXHGpyDq9Wuo4HRq1rR1pD5b6zVAkryenTAQE1D52i4R3b0PE3lxs35gYnycLfcb3bsYQoznNQCM72/fgCMcnRuac74LbgjvqFN6n68PX/fv47st+aY+1Phv1EcWlr8BmPAxB7nJiK7LfveZRsHPoovo+/0XqdrTfQGy9xIAyvETiTqs5hCUGXfAczqYKN1XAdelQhaYczXgpR3Ha1OSaTuVv0n6u2mcudym16rsdiPdEUVNsOPlL909jp4vxU4Mf8maXRlthNAJqGaDNek4VRn31xJc12lHb8I6sQjSdJrcGOBKdZt",
|
74
|
+
"sshfp_rsa": "SSHFP 1 1 ac45128cb3afa84f369f6a52c09bad0a7c675fad\nSSHFP 1 2 4005b69b41d5f95605d329df03e7566e7c7d50a413ebecf31dcf9d9b9282d410",
|
75
|
+
"sshecdsakey": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJIwnVmuDVO3LpIIQ7brM4pt1Lo//8QJjpE/FeoEVYEezgYQzLhozqg5vIA+g9m1hxSDPNOfKa9ark0sO18AJRE=",
|
76
|
+
"sshfp_ecdsa": "SSHFP 3 1 21dfdecdee66adbb64dcd017ff30d85a0a80ec2c\nSSHFP 3 2 b3ac16b556b9b7d89645260dc40f0f86f435e449a3f2e742fd92a7155bdf7028",
|
77
|
+
"timezone": "UTC",
|
78
|
+
"uniqueid": "007f0101",
|
79
|
+
"uptime": "0:09 hours",
|
80
|
+
"uptime_days": 0,
|
81
|
+
"uptime_hours": 0,
|
82
|
+
"uptime_seconds": 545,
|
83
|
+
"virtual": "virtualbox",
|
84
|
+
"is_virtual": "true"
|
85
|
+
}
|