facterdb 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/.travis.yml +33 -0
- data/CHANGELOG.md +19 -0
- data/README.md +35 -12
- data/Rakefile +7 -0
- data/facterdb.gemspec +2 -0
- data/facts/1.6/openbsd-5.7-i386.facts +56 -0
- data/facts/1.6/openbsd-5.7-x86_64.facts +56 -0
- data/facts/1.6/solaris-11-i386.facts +60 -0
- data/facts/1.7/openbsd-5.7-i386.facts +63 -0
- data/facts/1.7/openbsd-5.7-x86_64.facts +63 -0
- data/facts/1.7/solaris-11-i386.facts +80 -0
- data/facts/2.0/openbsd-5.7-i386.facts +64 -0
- data/facts/2.0/openbsd-5.7-x86_64.facts +64 -0
- data/facts/2.0/solaris-11-i386.facts +82 -0
- data/facts/2.1/openbsd-5.7-i386.facts +66 -0
- data/facts/2.1/openbsd-5.7-x86_64.facts +66 -0
- data/facts/2.1/solaris-11-i386.facts +82 -0
- data/facts/2.2/openbsd-5.7-i386.facts +134 -0
- data/facts/2.2/openbsd-5.7-x86_64.facts +134 -0
- data/facts/2.2/solaris-11-i386.facts +105 -0
- data/facts/2.3/openbsd-5.7-i386.facts +137 -0
- data/facts/2.3/openbsd-5.7-x86_64.facts +137 -0
- data/facts/2.3/solaris-11-i386.facts +106 -0
- data/facts/2.4/openbsd-5.7-i386.facts +137 -0
- data/facts/2.4/openbsd-5.7-x86_64.facts +137 -0
- data/facts/2.4/solaris-11-i386.facts +106 -0
- data/facts/3.0/debian-6-i386.facts +229 -0
- data/facts/3.0/debian-6-x86_64.facts +229 -0
- data/facts/3.0/debian-7-i386.facts +243 -0
- data/facts/3.0/debian-7-x86_64.facts +243 -0
- data/facts/3.0/debian-8-i386.facts +204 -0
- data/facts/3.0/debian-8-x86_64.facts +204 -0
- data/facts/3.0/ubuntu-12.04-i386.facts +234 -0
- data/facts/3.0/ubuntu-12.04-x86_64.facts +234 -0
- data/facts/3.0/ubuntu-14.04-i386.facts +241 -0
- data/facts/3.0/ubuntu-14.04-x86_64.facts +241 -0
- data/facts/Vagrantfile +24 -0
- data/facts/get_facts.sh +55 -6
- data/lib/facterdb/version.rb +1 -1
- data/lib/facterdb.rb +7 -6
- data/spec/facterdb_spec.rb +1 -2
- metadata +77 -16
@@ -0,0 +1,241 @@
|
|
1
|
+
{
|
2
|
+
"augeas": {
|
3
|
+
"version": "1.4.0"
|
4
|
+
},
|
5
|
+
"disks": {
|
6
|
+
"sda": {
|
7
|
+
"model": "VBOX HARDDISK",
|
8
|
+
"size": "20.00 GiB",
|
9
|
+
"size_bytes": 21474836480,
|
10
|
+
"vendor": "ATA"
|
11
|
+
}
|
12
|
+
},
|
13
|
+
"dmi": {
|
14
|
+
"bios": {
|
15
|
+
"release_date": "12/01/2006",
|
16
|
+
"vendor": "innotek GmbH",
|
17
|
+
"version": "VirtualBox"
|
18
|
+
},
|
19
|
+
"board": {
|
20
|
+
"manufacturer": "Oracle Corporation",
|
21
|
+
"product": "VirtualBox",
|
22
|
+
"serial_number": "0"
|
23
|
+
},
|
24
|
+
"chassis": {
|
25
|
+
"type": "Other"
|
26
|
+
},
|
27
|
+
"manufacturer": "innotek GmbH",
|
28
|
+
"product": {
|
29
|
+
"name": "VirtualBox",
|
30
|
+
"serial_number": "0",
|
31
|
+
"uuid": "6A78E712-50F6-4D39-87D3-CA35E538AB88"
|
32
|
+
}
|
33
|
+
},
|
34
|
+
"facterversion": "3.0.2",
|
35
|
+
"filesystems": "ext2,ext3,ext4,vfat",
|
36
|
+
"identity": {
|
37
|
+
"gid": 0,
|
38
|
+
"group": "root",
|
39
|
+
"uid": 0,
|
40
|
+
"user": "root"
|
41
|
+
},
|
42
|
+
"is_virtual": true,
|
43
|
+
"kernel": "Linux",
|
44
|
+
"kernelmajversion": "3.16",
|
45
|
+
"kernelrelease": "3.16.0-30-generic",
|
46
|
+
"kernelversion": "3.16.0",
|
47
|
+
"load_averages": {
|
48
|
+
"15m": 0.04,
|
49
|
+
"1m": 0.21,
|
50
|
+
"5m": 0.1
|
51
|
+
},
|
52
|
+
"memory": {
|
53
|
+
"swap": {
|
54
|
+
"available": "511.58 MiB",
|
55
|
+
"available_bytes": 536432640,
|
56
|
+
"capacity": "0.08%",
|
57
|
+
"total": "512.00 MiB",
|
58
|
+
"total_bytes": 536866816,
|
59
|
+
"used": "424.00 KiB",
|
60
|
+
"used_bytes": 434176
|
61
|
+
},
|
62
|
+
"system": {
|
63
|
+
"available": "419.82 MiB",
|
64
|
+
"available_bytes": 440209408,
|
65
|
+
"capacity": "14.28%",
|
66
|
+
"total": "489.74 MiB",
|
67
|
+
"total_bytes": 513531904,
|
68
|
+
"used": "69.93 MiB",
|
69
|
+
"used_bytes": 73322496
|
70
|
+
}
|
71
|
+
},
|
72
|
+
"mountpoints": {
|
73
|
+
"/": {
|
74
|
+
"available": "17.54 GiB",
|
75
|
+
"available_bytes": 18838560768,
|
76
|
+
"capacity": "6.83%",
|
77
|
+
"device": "/dev/mapper/localhost--vg-root",
|
78
|
+
"filesystem": "ext4",
|
79
|
+
"options": [
|
80
|
+
"rw",
|
81
|
+
"errors=remount-ro"
|
82
|
+
],
|
83
|
+
"size": "18.83 GiB",
|
84
|
+
"size_bytes": 20219142144,
|
85
|
+
"used": "1.29 GiB",
|
86
|
+
"used_bytes": 1380581376
|
87
|
+
},
|
88
|
+
"/boot": {
|
89
|
+
"available": "198.65 MiB",
|
90
|
+
"available_bytes": 208301056,
|
91
|
+
"capacity": "15.58%",
|
92
|
+
"device": "/dev/sda1",
|
93
|
+
"filesystem": "ext2",
|
94
|
+
"options": [
|
95
|
+
"rw"
|
96
|
+
],
|
97
|
+
"size": "235.32 MiB",
|
98
|
+
"size_bytes": 246755328,
|
99
|
+
"used": "36.67 MiB",
|
100
|
+
"used_bytes": 38454272
|
101
|
+
}
|
102
|
+
},
|
103
|
+
"networking": {
|
104
|
+
"dhcp": "10.0.2.2",
|
105
|
+
"domain": "example.com",
|
106
|
+
"fqdn": "foo.example.com",
|
107
|
+
"hostname": "foo",
|
108
|
+
"interfaces": {
|
109
|
+
"eth0": {
|
110
|
+
"dhcp": "10.0.2.2",
|
111
|
+
"ip": "10.0.2.15",
|
112
|
+
"ip6": "fe80::a00:27ff:feea:2027",
|
113
|
+
"mac": "08:00:27:ea:20:27",
|
114
|
+
"mtu": 1500,
|
115
|
+
"netmask": "255.255.255.0",
|
116
|
+
"netmask6": "ffff:ffff:ffff:ffff::",
|
117
|
+
"network": "10.0.2.0",
|
118
|
+
"network6": "fe80::"
|
119
|
+
},
|
120
|
+
"lo": {
|
121
|
+
"ip": "127.0.0.1",
|
122
|
+
"ip6": "::1",
|
123
|
+
"mtu": 65536,
|
124
|
+
"netmask": "255.0.0.0",
|
125
|
+
"netmask6": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
|
126
|
+
"network": "127.0.0.0",
|
127
|
+
"network6": "::1"
|
128
|
+
}
|
129
|
+
},
|
130
|
+
"ip": "10.0.2.15",
|
131
|
+
"ip6": "fe80::a00:27ff:feea:2027",
|
132
|
+
"mac": "08:00:27:ea:20:27",
|
133
|
+
"mtu": 1500,
|
134
|
+
"netmask": "255.255.255.0",
|
135
|
+
"netmask6": "ffff:ffff:ffff:ffff::",
|
136
|
+
"network": "10.0.2.0",
|
137
|
+
"network6": "fe80::"
|
138
|
+
},
|
139
|
+
"os": {
|
140
|
+
"architecture": "i386",
|
141
|
+
"distro": {
|
142
|
+
"codename": "trusty",
|
143
|
+
"description": "Ubuntu 14.04.2 LTS",
|
144
|
+
"id": "Ubuntu",
|
145
|
+
"release": {
|
146
|
+
"full": "14.04",
|
147
|
+
"major": "14.04"
|
148
|
+
}
|
149
|
+
},
|
150
|
+
"family": "Debian",
|
151
|
+
"hardware": "i386",
|
152
|
+
"name": "Ubuntu",
|
153
|
+
"release": {
|
154
|
+
"full": "14.04",
|
155
|
+
"major": "14.04"
|
156
|
+
},
|
157
|
+
"selinux": {
|
158
|
+
"enabled": false
|
159
|
+
}
|
160
|
+
},
|
161
|
+
"partitions": {
|
162
|
+
"/dev/mapper/localhost--vg-root": {
|
163
|
+
"filesystem": "ext4",
|
164
|
+
"mount": "/",
|
165
|
+
"size": "0 bytes",
|
166
|
+
"size_bytes": 0,
|
167
|
+
"uuid": "c94f234c-f947-450d-aaaf-d32be1b7f27f"
|
168
|
+
},
|
169
|
+
"/dev/mapper/localhost--vg-swap_1": {
|
170
|
+
"filesystem": "swap",
|
171
|
+
"size": "0 bytes",
|
172
|
+
"size_bytes": 0,
|
173
|
+
"uuid": "5501b007-e44b-46cf-b22b-177428cbe5d6"
|
174
|
+
},
|
175
|
+
"/dev/sda1": {
|
176
|
+
"filesystem": "ext2",
|
177
|
+
"mount": "/boot",
|
178
|
+
"size": "243.00 MiB",
|
179
|
+
"size_bytes": 254803968,
|
180
|
+
"uuid": "3a97a5b0-ebd0-4ce6-ba62-d39b4fd0719e"
|
181
|
+
},
|
182
|
+
"/dev/sda5": {
|
183
|
+
"filesystem": "LVM2_member",
|
184
|
+
"size": "19.76 GiB",
|
185
|
+
"size_bytes": 21216886784,
|
186
|
+
"uuid": "vgfiUo-lVmS-57wx-qv4m-N3fR-efa0-iBI6Cn"
|
187
|
+
}
|
188
|
+
},
|
189
|
+
"path": "/usr/gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/lib/gems/1.8/bin/:/usr/local/bin:/root/.gem/ruby/2.1.0/bin:/usr/lib64/ruby/gems/1.9.1/gems/bundler-1.7.12/bin:/usr/lib64/ruby/gems/2.0.0/gems/bundler-1.7.12/bin:/usr/ruby/1.9/bin",
|
190
|
+
"processors": {
|
191
|
+
"count": 1,
|
192
|
+
"isa": "i386",
|
193
|
+
"models": [
|
194
|
+
"Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz"
|
195
|
+
],
|
196
|
+
"physicalcount": 1
|
197
|
+
},
|
198
|
+
"ruby": {
|
199
|
+
"platform": "i386-linux",
|
200
|
+
"sitedir": "/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0",
|
201
|
+
"version": "2.1.6"
|
202
|
+
},
|
203
|
+
"ssh": {
|
204
|
+
"dsa": {
|
205
|
+
"fingerprints": {
|
206
|
+
"sha1": "SSHFP 2 1 528b28369558620d8fb12d7bea179e437823154c",
|
207
|
+
"sha256": "SSHFP 2 2 5a7688dbb06e4b0c72e6e78ae4ca8b379620ba14b019d5b3ae5670936e1acdf4"
|
208
|
+
},
|
209
|
+
"key": "AAAAB3NzaC1kc3MAAACBAI8c8/RV/kAfEuo71eUt5O1BBbzk34v7b14bi3swzOnzJslJXt2KR/3Dy+8eazzkcw8nbmzZSHvcyo93yQ0LjsExXfG0EkzN7uiE840Fcpg5LFmeCHan0So3Cc1FLavcGu8N+RpWHYYLLmPjlQqPdHSS1rhhXdqKIoiTdlaocXD5AAAAFQCJ0mBV1SSayMNI6tTF4W0o1Y6+cQAAAIBWY05wbeTi/vFgkhH57X0/S7Kr86K3Q/BMz7ZmKF2XCzZW9LJ6Ou0T7tHKAr472DBwUm6IxGHoUXky0Q0+XDCVut9YLYXJK8L/P8SbGwhMfj1YPiv9uorECcrqJMB5W1GCFS+HIo4DvmKYzivcmpE25b/y0V1u5Oas9cQaNZnhxwAAAIBqvLMiEyQPpemji+p+p/9E3sdX6RMUeSHj7n3WSkRTdq09nZ0ewtH12LpbENCjoc4PFh02/qqdub0tjpbgJrMYgwJDADD/AsrdcDBd3gU7mDjyF8PFzWV9nEVYExu447svRt422OW6gkkJ6sn3fovBAvDaWy7OR5YYrg5JLp+/4A=="
|
210
|
+
},
|
211
|
+
"ecdsa": {
|
212
|
+
"fingerprints": {
|
213
|
+
"sha1": "SSHFP 3 1 505ac6e68fa78305f635f305e11fbb0cc597e8ad",
|
214
|
+
"sha256": "SSHFP 3 2 d5840c440b5f52a582589e3b2b583ecea53fd6618851dbcfce2e5cca7624f3c8"
|
215
|
+
},
|
216
|
+
"key": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJKYyLqXe/n2LFUbqMkwhLyOpg10LYOx/MpdgFXTxUB67AP4/GoX8zfz5Lb6fOidSJTlrzD5FB584JiRlEGUGLo="
|
217
|
+
},
|
218
|
+
"ed25519": {
|
219
|
+
"fingerprints": {
|
220
|
+
"sha1": "SSHFP 4 1 53784fee8fc968dca5c5d17e731716a012e59234",
|
221
|
+
"sha256": "SSHFP 4 2 95b82a785582818106bf403e53667fc559eeabf176f103a929a210a38e9c4e05"
|
222
|
+
},
|
223
|
+
"key": "AAAAC3NzaC1lZDI1NTE5AAAAIAAhP8P8zhiQrKmyV/U+e5M7nd5X+ZuIEYCPHDoza0rP"
|
224
|
+
},
|
225
|
+
"rsa": {
|
226
|
+
"fingerprints": {
|
227
|
+
"sha1": "SSHFP 1 1 4d3d498c7a3377c8f95ac713db4866c32199be51",
|
228
|
+
"sha256": "SSHFP 1 2 949c0790f27d5ef7e8b0c35ceabb23bdd50d81611093531c0354330a7234b833"
|
229
|
+
},
|
230
|
+
"key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPayGCFe5RUpJ8/UsH6gf+ecMRWo1dc20+HAy0bV4KalYWN5jUB/wrs41rdJRwMKWczgSDi2gFMsJ7q8Vjvpm2hUy+3H3/AEASRij99+37X1T4A6vPpT45EhTpS6JgGROii1Q2+9AJ/6BE6fSawymgR7jDx5QNLbKRy/FiwZAG+A0n29iUALeKqEZMd/1fU0hQCy/V+9V4DgRbHcJz4lKgc6nYrMymj8tUivTd8zm+CQov+YsUAdaXHSxIGVofnFQYXzbPqWGVV8S3fpwvrn/IY6paZ2F/lHoWombHwE271Bw863oWdkKpzP1nhjR3+Q1z++Tl2ZXT+rp6mhS9Pwv"
|
231
|
+
}
|
232
|
+
},
|
233
|
+
"system_uptime": {
|
234
|
+
"days": 0,
|
235
|
+
"hours": 0,
|
236
|
+
"seconds": 141,
|
237
|
+
"uptime": "0:02 hours"
|
238
|
+
},
|
239
|
+
"timezone": "PDT",
|
240
|
+
"virtual": "virtualbox"
|
241
|
+
}
|
@@ -0,0 +1,241 @@
|
|
1
|
+
{
|
2
|
+
"augeas": {
|
3
|
+
"version": "1.4.0"
|
4
|
+
},
|
5
|
+
"disks": {
|
6
|
+
"sda": {
|
7
|
+
"model": "VBOX HARDDISK",
|
8
|
+
"size": "20.00 GiB",
|
9
|
+
"size_bytes": 21474836480,
|
10
|
+
"vendor": "ATA"
|
11
|
+
}
|
12
|
+
},
|
13
|
+
"dmi": {
|
14
|
+
"bios": {
|
15
|
+
"release_date": "12/01/2006",
|
16
|
+
"vendor": "innotek GmbH",
|
17
|
+
"version": "VirtualBox"
|
18
|
+
},
|
19
|
+
"board": {
|
20
|
+
"manufacturer": "Oracle Corporation",
|
21
|
+
"product": "VirtualBox",
|
22
|
+
"serial_number": "0"
|
23
|
+
},
|
24
|
+
"chassis": {
|
25
|
+
"type": "Other"
|
26
|
+
},
|
27
|
+
"manufacturer": "innotek GmbH",
|
28
|
+
"product": {
|
29
|
+
"name": "VirtualBox",
|
30
|
+
"serial_number": "0",
|
31
|
+
"uuid": "6A78E712-50F6-4D39-87D3-CA35E538AB88"
|
32
|
+
}
|
33
|
+
},
|
34
|
+
"facterversion": "3.0.2",
|
35
|
+
"filesystems": "ext2,ext3,ext4,vfat",
|
36
|
+
"identity": {
|
37
|
+
"gid": 0,
|
38
|
+
"group": "root",
|
39
|
+
"uid": 0,
|
40
|
+
"user": "root"
|
41
|
+
},
|
42
|
+
"is_virtual": true,
|
43
|
+
"kernel": "Linux",
|
44
|
+
"kernelmajversion": "3.16",
|
45
|
+
"kernelrelease": "3.16.0-30-generic",
|
46
|
+
"kernelversion": "3.16.0",
|
47
|
+
"load_averages": {
|
48
|
+
"15m": 0.04,
|
49
|
+
"1m": 0.21,
|
50
|
+
"5m": 0.1
|
51
|
+
},
|
52
|
+
"memory": {
|
53
|
+
"swap": {
|
54
|
+
"available": "511.58 MiB",
|
55
|
+
"available_bytes": 536432640,
|
56
|
+
"capacity": "0.08%",
|
57
|
+
"total": "512.00 MiB",
|
58
|
+
"total_bytes": 536866816,
|
59
|
+
"used": "424.00 KiB",
|
60
|
+
"used_bytes": 434176
|
61
|
+
},
|
62
|
+
"system": {
|
63
|
+
"available": "419.82 MiB",
|
64
|
+
"available_bytes": 440209408,
|
65
|
+
"capacity": "14.28%",
|
66
|
+
"total": "489.74 MiB",
|
67
|
+
"total_bytes": 513531904,
|
68
|
+
"used": "69.93 MiB",
|
69
|
+
"used_bytes": 73322496
|
70
|
+
}
|
71
|
+
},
|
72
|
+
"mountpoints": {
|
73
|
+
"/": {
|
74
|
+
"available": "17.54 GiB",
|
75
|
+
"available_bytes": 18838560768,
|
76
|
+
"capacity": "6.83%",
|
77
|
+
"device": "/dev/mapper/localhost--vg-root",
|
78
|
+
"filesystem": "ext4",
|
79
|
+
"options": [
|
80
|
+
"rw",
|
81
|
+
"errors=remount-ro"
|
82
|
+
],
|
83
|
+
"size": "18.83 GiB",
|
84
|
+
"size_bytes": 20219142144,
|
85
|
+
"used": "1.29 GiB",
|
86
|
+
"used_bytes": 1380581376
|
87
|
+
},
|
88
|
+
"/boot": {
|
89
|
+
"available": "198.65 MiB",
|
90
|
+
"available_bytes": 208301056,
|
91
|
+
"capacity": "15.58%",
|
92
|
+
"device": "/dev/sda1",
|
93
|
+
"filesystem": "ext2",
|
94
|
+
"options": [
|
95
|
+
"rw"
|
96
|
+
],
|
97
|
+
"size": "235.32 MiB",
|
98
|
+
"size_bytes": 246755328,
|
99
|
+
"used": "36.67 MiB",
|
100
|
+
"used_bytes": 38454272
|
101
|
+
}
|
102
|
+
},
|
103
|
+
"networking": {
|
104
|
+
"dhcp": "10.0.2.2",
|
105
|
+
"domain": "example.com",
|
106
|
+
"fqdn": "foo.example.com",
|
107
|
+
"hostname": "foo",
|
108
|
+
"interfaces": {
|
109
|
+
"eth0": {
|
110
|
+
"dhcp": "10.0.2.2",
|
111
|
+
"ip": "10.0.2.15",
|
112
|
+
"ip6": "fe80::a00:27ff:feea:2027",
|
113
|
+
"mac": "08:00:27:ea:20:27",
|
114
|
+
"mtu": 1500,
|
115
|
+
"netmask": "255.255.255.0",
|
116
|
+
"netmask6": "ffff:ffff:ffff:ffff::",
|
117
|
+
"network": "10.0.2.0",
|
118
|
+
"network6": "fe80::"
|
119
|
+
},
|
120
|
+
"lo": {
|
121
|
+
"ip": "127.0.0.1",
|
122
|
+
"ip6": "::1",
|
123
|
+
"mtu": 65536,
|
124
|
+
"netmask": "255.0.0.0",
|
125
|
+
"netmask6": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
|
126
|
+
"network": "127.0.0.0",
|
127
|
+
"network6": "::1"
|
128
|
+
}
|
129
|
+
},
|
130
|
+
"ip": "10.0.2.15",
|
131
|
+
"ip6": "fe80::a00:27ff:feea:2027",
|
132
|
+
"mac": "08:00:27:ea:20:27",
|
133
|
+
"mtu": 1500,
|
134
|
+
"netmask": "255.255.255.0",
|
135
|
+
"netmask6": "ffff:ffff:ffff:ffff::",
|
136
|
+
"network": "10.0.2.0",
|
137
|
+
"network6": "fe80::"
|
138
|
+
},
|
139
|
+
"os": {
|
140
|
+
"architecture": "amd64",
|
141
|
+
"distro": {
|
142
|
+
"codename": "trusty",
|
143
|
+
"description": "Ubuntu 14.04.2 LTS",
|
144
|
+
"id": "Ubuntu",
|
145
|
+
"release": {
|
146
|
+
"full": "14.04",
|
147
|
+
"major": "14.04"
|
148
|
+
}
|
149
|
+
},
|
150
|
+
"family": "Debian",
|
151
|
+
"hardware": "x86_64",
|
152
|
+
"name": "Ubuntu",
|
153
|
+
"release": {
|
154
|
+
"full": "14.04",
|
155
|
+
"major": "14.04"
|
156
|
+
},
|
157
|
+
"selinux": {
|
158
|
+
"enabled": false
|
159
|
+
}
|
160
|
+
},
|
161
|
+
"partitions": {
|
162
|
+
"/dev/mapper/localhost--vg-root": {
|
163
|
+
"filesystem": "ext4",
|
164
|
+
"mount": "/",
|
165
|
+
"size": "0 bytes",
|
166
|
+
"size_bytes": 0,
|
167
|
+
"uuid": "c94f234c-f947-450d-aaaf-d32be1b7f27f"
|
168
|
+
},
|
169
|
+
"/dev/mapper/localhost--vg-swap_1": {
|
170
|
+
"filesystem": "swap",
|
171
|
+
"size": "0 bytes",
|
172
|
+
"size_bytes": 0,
|
173
|
+
"uuid": "5501b007-e44b-46cf-b22b-177428cbe5d6"
|
174
|
+
},
|
175
|
+
"/dev/sda1": {
|
176
|
+
"filesystem": "ext2",
|
177
|
+
"mount": "/boot",
|
178
|
+
"size": "243.00 MiB",
|
179
|
+
"size_bytes": 254803968,
|
180
|
+
"uuid": "3a97a5b0-ebd0-4ce6-ba62-d39b4fd0719e"
|
181
|
+
},
|
182
|
+
"/dev/sda5": {
|
183
|
+
"filesystem": "LVM2_member",
|
184
|
+
"size": "19.76 GiB",
|
185
|
+
"size_bytes": 21216886784,
|
186
|
+
"uuid": "vgfiUo-lVmS-57wx-qv4m-N3fR-efa0-iBI6Cn"
|
187
|
+
}
|
188
|
+
},
|
189
|
+
"path": "/usr/gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/lib/gems/1.8/bin/:/usr/local/bin:/root/.gem/ruby/2.1.0/bin:/usr/lib64/ruby/gems/1.9.1/gems/bundler-1.7.12/bin:/usr/lib64/ruby/gems/2.0.0/gems/bundler-1.7.12/bin:/usr/ruby/1.9/bin",
|
190
|
+
"processors": {
|
191
|
+
"count": 1,
|
192
|
+
"isa": "x86_64",
|
193
|
+
"models": [
|
194
|
+
"Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz"
|
195
|
+
],
|
196
|
+
"physicalcount": 1
|
197
|
+
},
|
198
|
+
"ruby": {
|
199
|
+
"platform": "x86_64-linux",
|
200
|
+
"sitedir": "/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0",
|
201
|
+
"version": "2.1.6"
|
202
|
+
},
|
203
|
+
"ssh": {
|
204
|
+
"dsa": {
|
205
|
+
"fingerprints": {
|
206
|
+
"sha1": "SSHFP 2 1 528b28369558620d8fb12d7bea179e437823154c",
|
207
|
+
"sha256": "SSHFP 2 2 5a7688dbb06e4b0c72e6e78ae4ca8b379620ba14b019d5b3ae5670936e1acdf4"
|
208
|
+
},
|
209
|
+
"key": "AAAAB3NzaC1kc3MAAACBAI8c8/RV/kAfEuo71eUt5O1BBbzk34v7b14bi3swzOnzJslJXt2KR/3Dy+8eazzkcw8nbmzZSHvcyo93yQ0LjsExXfG0EkzN7uiE840Fcpg5LFmeCHan0So3Cc1FLavcGu8N+RpWHYYLLmPjlQqPdHSS1rhhXdqKIoiTdlaocXD5AAAAFQCJ0mBV1SSayMNI6tTF4W0o1Y6+cQAAAIBWY05wbeTi/vFgkhH57X0/S7Kr86K3Q/BMz7ZmKF2XCzZW9LJ6Ou0T7tHKAr472DBwUm6IxGHoUXky0Q0+XDCVut9YLYXJK8L/P8SbGwhMfj1YPiv9uorECcrqJMB5W1GCFS+HIo4DvmKYzivcmpE25b/y0V1u5Oas9cQaNZnhxwAAAIBqvLMiEyQPpemji+p+p/9E3sdX6RMUeSHj7n3WSkRTdq09nZ0ewtH12LpbENCjoc4PFh02/qqdub0tjpbgJrMYgwJDADD/AsrdcDBd3gU7mDjyF8PFzWV9nEVYExu447svRt422OW6gkkJ6sn3fovBAvDaWy7OR5YYrg5JLp+/4A=="
|
210
|
+
},
|
211
|
+
"ecdsa": {
|
212
|
+
"fingerprints": {
|
213
|
+
"sha1": "SSHFP 3 1 505ac6e68fa78305f635f305e11fbb0cc597e8ad",
|
214
|
+
"sha256": "SSHFP 3 2 d5840c440b5f52a582589e3b2b583ecea53fd6618851dbcfce2e5cca7624f3c8"
|
215
|
+
},
|
216
|
+
"key": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJKYyLqXe/n2LFUbqMkwhLyOpg10LYOx/MpdgFXTxUB67AP4/GoX8zfz5Lb6fOidSJTlrzD5FB584JiRlEGUGLo="
|
217
|
+
},
|
218
|
+
"ed25519": {
|
219
|
+
"fingerprints": {
|
220
|
+
"sha1": "SSHFP 4 1 53784fee8fc968dca5c5d17e731716a012e59234",
|
221
|
+
"sha256": "SSHFP 4 2 95b82a785582818106bf403e53667fc559eeabf176f103a929a210a38e9c4e05"
|
222
|
+
},
|
223
|
+
"key": "AAAAC3NzaC1lZDI1NTE5AAAAIAAhP8P8zhiQrKmyV/U+e5M7nd5X+ZuIEYCPHDoza0rP"
|
224
|
+
},
|
225
|
+
"rsa": {
|
226
|
+
"fingerprints": {
|
227
|
+
"sha1": "SSHFP 1 1 4d3d498c7a3377c8f95ac713db4866c32199be51",
|
228
|
+
"sha256": "SSHFP 1 2 949c0790f27d5ef7e8b0c35ceabb23bdd50d81611093531c0354330a7234b833"
|
229
|
+
},
|
230
|
+
"key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPayGCFe5RUpJ8/UsH6gf+ecMRWo1dc20+HAy0bV4KalYWN5jUB/wrs41rdJRwMKWczgSDi2gFMsJ7q8Vjvpm2hUy+3H3/AEASRij99+37X1T4A6vPpT45EhTpS6JgGROii1Q2+9AJ/6BE6fSawymgR7jDx5QNLbKRy/FiwZAG+A0n29iUALeKqEZMd/1fU0hQCy/V+9V4DgRbHcJz4lKgc6nYrMymj8tUivTd8zm+CQov+YsUAdaXHSxIGVofnFQYXzbPqWGVV8S3fpwvrn/IY6paZ2F/lHoWombHwE271Bw863oWdkKpzP1nhjR3+Q1z++Tl2ZXT+rp6mhS9Pwv"
|
231
|
+
}
|
232
|
+
},
|
233
|
+
"system_uptime": {
|
234
|
+
"days": 0,
|
235
|
+
"hours": 0,
|
236
|
+
"seconds": 141,
|
237
|
+
"uptime": "0:02 hours"
|
238
|
+
},
|
239
|
+
"timezone": "PDT",
|
240
|
+
"virtual": "virtualbox"
|
241
|
+
}
|
data/facts/Vagrantfile
CHANGED
@@ -31,6 +31,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|
31
31
|
end
|
32
32
|
config.vm.define "debian-7-x86_64" do |host|
|
33
33
|
host.vm.box = "puppetlabs/debian-7.8-64-nocm"
|
34
|
+
host.vm.provision "shell", inline: "apt-get update && apt-get install -y ruby rubygems ruby-dev"
|
34
35
|
host.vm.provision "file", source: "Gemfile", destination: "Gemfile"
|
35
36
|
host.vm.provision "shell", path: "get_facts.sh"
|
36
37
|
host.vm.provision "shell", inline: "/sbin/shutdown -h now"
|
@@ -171,4 +172,27 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|
171
172
|
host.vm.provision "shell", path: "get_facts.sh"
|
172
173
|
host.vm.provision "shell", inline: "/sbin/shutdown -i S -g0 -y 'Bye' &"
|
173
174
|
end
|
175
|
+
config.vm.define "openbsd-5.7-x86_64" do |host|
|
176
|
+
host.vm.box = "bodgit/openbsd-5.7-amd64"
|
177
|
+
host.vm.synced_folder ".", "/vagrant", :nfs => true
|
178
|
+
host.vm.provision "shell", inline: <<-SCRIPT.gsub(/^ +/, '')
|
179
|
+
. ~/.profile
|
180
|
+
|
181
|
+
pkg_info -qe 'bash->=0' || pkg_add -I bash
|
182
|
+
ln -sf /usr/local/bin/bash /bin
|
183
|
+
|
184
|
+
pkg_info -qe 'ruby->=1.9.3' || pkg_add -I ruby-1.9.3.551p1
|
185
|
+
ln -sf /usr/local/bin/ruby19 /usr/local/bin/ruby
|
186
|
+
ln -sf /usr/local/bin/erb19 /usr/local/bin/erb
|
187
|
+
ln -sf /usr/local/bin/irb19 /usr/local/bin/irb
|
188
|
+
ln -sf /usr/local/bin/rdoc19 /usr/local/bin/rdoc
|
189
|
+
ln -sf /usr/local/bin/ri19 /usr/local/bin/ri
|
190
|
+
ln -sf /usr/local/bin/rake19 /usr/local/bin/rake
|
191
|
+
ln -sf /usr/local/bin/gem19 /usr/local/bin/gem
|
192
|
+
ln -sf /usr/local/bin/testrb19 /usr/local/bin/testrb
|
193
|
+
SCRIPT
|
194
|
+
host.vm.provision "file", source: "Gemfile", destination: "Gemfile"
|
195
|
+
host.vm.provision "shell", path: "get_facts.sh"
|
196
|
+
host.vm.provision "shell", inline: "/sbin/shutdown -h now"
|
197
|
+
end
|
174
198
|
end
|
data/facts/get_facts.sh
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
+
set -e
|
4
|
+
|
3
5
|
# Make Solaris use GNU tools by default
|
4
6
|
export PATH=/usr/gnu/bin:$PATH
|
5
7
|
|
@@ -7,10 +9,12 @@ export PATH=/usr/gnu/bin:$PATH
|
|
7
9
|
export PATH=$PATH:/var/lib/gems/1.8/bin/:/usr/local/bin:/root/.gem/ruby/2.1.0/bin:/usr/lib64/ruby/gems/1.9.1/gems/bundler-1.7.12/bin:/usr/lib64/ruby/gems/2.0.0/gems/bundler-1.7.12/bin:/usr/ruby/1.9/bin
|
8
10
|
|
9
11
|
# Install latest version of facter
|
10
|
-
gem install bundler --no-ri --no-rdoc
|
12
|
+
gem install bundler --no-ri --no-rdoc --no-format-executable
|
11
13
|
bundle install --path vendor/bundler
|
12
14
|
operatingsystem=$(bundle exec facter operatingsystem | tr '[:upper:]' '[:lower:]')
|
15
|
+
operatingsystemrelease=$(bundle exec facter operatingsystemrelease)
|
13
16
|
operatingsystemmajrelease=$(bundle exec facter operatingsystemmajrelease)
|
17
|
+
lsbdistcodename=$(bundle exec facter lsbdistcodename)
|
14
18
|
hardwaremodel=$(bundle exec facter hardwaremodel)
|
15
19
|
|
16
20
|
# Fix for FreeBSD
|
@@ -24,12 +28,57 @@ for version in 1.6.0 1.7.0 2.0.0 2.1.0 2.2.0 2.3.0 2.4.0; do
|
|
24
28
|
minor_version=$(echo $version | cut -c1-3)
|
25
29
|
output_dir="/vagrant/${minor_version}"
|
26
30
|
mkdir -p $output_dir
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
31
|
+
case "${operatingsystem}" in
|
32
|
+
archlinux|gentoo)
|
33
|
+
output_file="${output_dir}/${operatingsystem}-${hardwaremodel}.facts"
|
34
|
+
;;
|
35
|
+
openbsd)
|
36
|
+
output_file="${output_dir}/${operatingsystem}-${operatingsystemrelease}-${hardwaremodel}.facts"
|
37
|
+
;;
|
38
|
+
*)
|
39
|
+
output_file="${output_dir}/${operatingsystem}-${operatingsystemmajrelease}-${hardwaremodel}.facts"
|
40
|
+
;;
|
41
|
+
esac
|
32
42
|
echo $version | grep -q -E '^1\.' &&
|
33
43
|
FACTER_GEM_VERSION="~> ${version}" bundle exec facter -j | bundle exec ruby -e 'require "json"; jj JSON.parse gets' | tee $output_file ||
|
34
44
|
FACTER_GEM_VERSION="~> ${version}" bundle exec facter -j | tee $output_file
|
35
45
|
done
|
46
|
+
|
47
|
+
minor_version=3.0
|
48
|
+
output_dir="/vagrant/${minor_version}"
|
49
|
+
mkdir -p $output_dir
|
50
|
+
case "${operatingsystem}" in
|
51
|
+
archlinux|gentoo)
|
52
|
+
output_file="${output_dir}/${operatingsystem}-${hardwaremodel}.facts"
|
53
|
+
;;
|
54
|
+
openbsd)
|
55
|
+
output_file="${output_dir}/${operatingsystem}-${operatingsystemrelease}-${hardwaremodel}.facts"
|
56
|
+
;;
|
57
|
+
*)
|
58
|
+
output_file="${output_dir}/${operatingsystem}-${operatingsystemmajrelease}-${hardwaremodel}.facts"
|
59
|
+
;;
|
60
|
+
esac
|
61
|
+
|
62
|
+
case "${operatingsystem}" in
|
63
|
+
redhat)
|
64
|
+
case "${operatingsystemmajrelease}" in
|
65
|
+
5)
|
66
|
+
curl "https://yum.puppetlabs.com/puppetlabs-release-pc1-el-${operatingsystemmajrelease}.noarch.rpm" > /tmp/puppetlabs-release-pc1.rpm
|
67
|
+
rpm -ivh /tmp/puppetlabs-release-pc1.rpm ;;
|
68
|
+
*)
|
69
|
+
rpm -ivh "https://yum.puppetlabs.com/puppetlabs-release-pc1-el-${operatingsystemmajrelease}.noarch.rpm"
|
70
|
+
yum -y install puppet-agent
|
71
|
+
;;
|
72
|
+
esac
|
73
|
+
|
74
|
+
/opt/puppetlabs/bin/facter -j | tee $output_file
|
75
|
+
;;
|
76
|
+
debian|ubuntu)
|
77
|
+
[ $lsbdistcodename = "lucid" ] && exit # puppet-agent is not supported on lucid
|
78
|
+
wget "https://apt.puppetlabs.com/puppetlabs-release-pc1-${lsbdistcodename}.deb" -O /tmp/puppetlabs-release-pc1.deb
|
79
|
+
dpkg --install /tmp/puppetlabs-release-pc1.deb
|
80
|
+
apt-get update
|
81
|
+
apt-get -y install puppet-agent
|
82
|
+
/opt/puppetlabs/bin/facter -j | tee $output_file
|
83
|
+
;;
|
84
|
+
esac
|
data/lib/facterdb/version.rb
CHANGED
data/lib/facterdb.rb
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
require 'facter'
|
2
|
+
require 'jgrep'
|
2
3
|
|
3
4
|
module FacterDB
|
4
5
|
|
5
|
-
def get_os_facts
|
6
|
+
def self.get_os_facts(facter_version='*', filter=[])
|
6
7
|
facts_dir = File.expand_path(File.join(File.dirname(__FILE__), '../facts'))
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
filter_str = filter.map { |f| f.map { |k,v | "#{k}=#{v}" }.join(' and ') }.join(' or ')
|
9
|
+
|
10
|
+
jsons = Dir.glob("#{facts_dir}/#{facter_version}/*.facts").map { |f| File.read(f) }
|
11
|
+
json = "[#{jsons.join(',')}]\n"
|
12
|
+
JGrep.jgrep(json, filter_str)
|
12
13
|
end
|
13
14
|
end
|
data/spec/facterdb_spec.rb
CHANGED
@@ -3,9 +3,8 @@ require 'spec_helper'
|
|
3
3
|
describe 'FacterDB' do
|
4
4
|
|
5
5
|
describe '#get_os_facts' do
|
6
|
-
|
7
6
|
context 'without parameters' do
|
8
|
-
subject { get_os_facts() }
|
7
|
+
subject { FacterDB.get_os_facts() }
|
9
8
|
it "Should return an array of hashes with at least 1 element" do
|
10
9
|
expect(subject.class).to eq Array
|
11
10
|
expect(subject.size).not_to eq(0)
|