simp-rspec-puppet-facts 1.0.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +97 -3
- data/facts/1.6/centos-6-x86_64.facts +0 -0
- data/facts/1.6/centos-7-x86_64.facts +0 -0
- data/facts/1.6/redhat-6-x86_64.facts +0 -0
- data/facts/1.6/redhat-7-x86_64.facts +0 -0
- data/facts/1.7/centos-6-x86_64.facts +104 -0
- data/facts/1.7/centos-7-x86_64.facts +102 -0
- data/facts/1.7/redhat-6-x86_64.facts +107 -0
- data/facts/1.7/redhat-7-x86_64.facts +102 -0
- data/facts/2.0/centos-6-x86_64.facts +200 -0
- data/facts/2.0/centos-7-x86_64.facts +194 -0
- data/facts/2.0/redhat-6-x86_64.facts +196 -0
- data/facts/2.0/redhat-7-x86_64.facts +195 -0
- data/facts/2.1/centos-6-x86_64.facts +212 -0
- data/facts/2.1/centos-7-x86_64.facts +212 -0
- data/facts/2.1/redhat-6-x86_64.facts +208 -0
- data/facts/2.1/redhat-7-x86_64.facts +213 -0
- data/facts/2.2/centos-6-x86_64.facts +235 -0
- data/facts/2.2/centos-7-x86_64.facts +235 -0
- data/facts/2.2/redhat-6-x86_64.facts +231 -0
- data/facts/2.2/redhat-7-x86_64.facts +236 -0
- data/facts/2.3/centos-6-x86_64.facts +236 -0
- data/facts/2.3/centos-7-x86_64.facts +236 -0
- data/facts/2.3/redhat-6-x86_64.facts +232 -0
- data/facts/2.3/redhat-7-x86_64.facts +237 -0
- data/facts/2.4/centos-6-x86_64.facts +236 -0
- data/facts/2.4/centos-7-x86_64.facts +236 -0
- data/facts/2.4/redhat-6-x86_64.facts +232 -0
- data/facts/2.4/redhat-7-x86_64.facts +237 -0
- data/facts/3.0/centos-6-x86_64.facts +339 -0
- data/facts/3.0/centos-7-x86_64.facts +343 -0
- data/facts/3.0/redhat-6-x86_64.facts +338 -0
- data/facts/3.0/redhat-7-x86_64.facts +348 -0
- data/facts/3.1/centos-6-x86_64.facts +368 -0
- data/facts/3.1/centos-7-x86_64.facts +372 -0
- data/facts/3.1/redhat-6-x86_64.facts +367 -0
- data/facts/3.1/redhat-7-x86_64.facts +377 -0
- data/facts/Gemfile +11 -0
- data/facts/Vagrantfile +34 -0
- data/facts/get_facts.sh +35 -0
- data/lib/simp/rspec-puppet-facts.rb +100 -40
- data/lib/simp/version.rb +4 -0
- data/spec/fixtures/metadata.json +2 -2
- data/spec/simp_rspec_puppet_facts_spec.rb +120 -51
- data/spec/spec_helper.rb +0 -6
- metadata +107 -70
@@ -0,0 +1,377 @@
|
|
1
|
+
{
|
2
|
+
"acpid_enabled": true,
|
3
|
+
"augeas": {
|
4
|
+
"version": "1.4.0"
|
5
|
+
},
|
6
|
+
"boot_dir_uuid": "26ae70e9-4393-4187-b8c5-f2eaa52a4fb5",
|
7
|
+
"cmdline": {
|
8
|
+
"BOOT_IMAGE": "/vmlinuz-3.10.0-327.el7.x86_64",
|
9
|
+
"root": "/dev/mapper/rhel-root",
|
10
|
+
"ro": null,
|
11
|
+
"crashkernel": "auto",
|
12
|
+
"rd.lvm.lv": "rhel/swap",
|
13
|
+
"rhgb": null,
|
14
|
+
"quiet": null,
|
15
|
+
"LANG": "en_US.UTF-8"
|
16
|
+
},
|
17
|
+
"cpuinfo": {
|
18
|
+
"processor0": {
|
19
|
+
"vendor_id": "GenuineIntel",
|
20
|
+
"cpu_family": "6",
|
21
|
+
"model": "61",
|
22
|
+
"model_name": "Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz",
|
23
|
+
"stepping": "4",
|
24
|
+
"microcode": "0x19",
|
25
|
+
"cpu_MHz": "3092.884",
|
26
|
+
"cache_size": "4096 KB",
|
27
|
+
"physical_id": "0",
|
28
|
+
"siblings": "1",
|
29
|
+
"core_id": "0",
|
30
|
+
"cpu_cores": "1",
|
31
|
+
"apicid": "0",
|
32
|
+
"initial_apicid": "0",
|
33
|
+
"fpu": "yes",
|
34
|
+
"fpu_exception": "yes",
|
35
|
+
"cpuid_level": "20",
|
36
|
+
"wp": "yes",
|
37
|
+
"flags": [
|
38
|
+
"fpu",
|
39
|
+
"vme",
|
40
|
+
"de",
|
41
|
+
"pse",
|
42
|
+
"tsc",
|
43
|
+
"msr",
|
44
|
+
"pae",
|
45
|
+
"mce",
|
46
|
+
"cx8",
|
47
|
+
"apic",
|
48
|
+
"sep",
|
49
|
+
"mtrr",
|
50
|
+
"pge",
|
51
|
+
"mca",
|
52
|
+
"cmov",
|
53
|
+
"pat",
|
54
|
+
"pse36",
|
55
|
+
"clflush",
|
56
|
+
"mmx",
|
57
|
+
"fxsr",
|
58
|
+
"sse",
|
59
|
+
"sse2",
|
60
|
+
"syscall",
|
61
|
+
"nx",
|
62
|
+
"rdtscp",
|
63
|
+
"lm",
|
64
|
+
"constant_tsc",
|
65
|
+
"rep_good",
|
66
|
+
"nopl",
|
67
|
+
"xtopology",
|
68
|
+
"nonstop_tsc",
|
69
|
+
"pni",
|
70
|
+
"pclmulqdq",
|
71
|
+
"monitor",
|
72
|
+
"ssse3",
|
73
|
+
"cx16",
|
74
|
+
"sse4_1",
|
75
|
+
"sse4_2",
|
76
|
+
"movbe",
|
77
|
+
"popcnt",
|
78
|
+
"aes",
|
79
|
+
"xsave",
|
80
|
+
"avx",
|
81
|
+
"rdrand",
|
82
|
+
"hypervisor",
|
83
|
+
"lahf_lm",
|
84
|
+
"abm",
|
85
|
+
"3dnowprefetch",
|
86
|
+
"rdseed"
|
87
|
+
],
|
88
|
+
"bogomips": "6185.76",
|
89
|
+
"clflush_size": "64",
|
90
|
+
"cache_alignment": "64",
|
91
|
+
"address_sizes": "39 bits physical, 48 bits virtual",
|
92
|
+
"power_management": "power management"
|
93
|
+
}
|
94
|
+
},
|
95
|
+
"defaultgateway": "10.0.2.2",
|
96
|
+
"defaultgatewayiface": "enp0s3",
|
97
|
+
"disks": {
|
98
|
+
"sda": {
|
99
|
+
"model": "VBOX HARDDISK",
|
100
|
+
"size": "36.00 GiB",
|
101
|
+
"size_bytes": 38654705664,
|
102
|
+
"vendor": "ATA"
|
103
|
+
}
|
104
|
+
},
|
105
|
+
"dmi": {
|
106
|
+
"bios": {
|
107
|
+
"release_date": "12/01/2006",
|
108
|
+
"vendor": "innotek GmbH",
|
109
|
+
"version": "VirtualBox"
|
110
|
+
},
|
111
|
+
"board": {
|
112
|
+
"manufacturer": "Oracle Corporation",
|
113
|
+
"product": "VirtualBox",
|
114
|
+
"serial_number": "0"
|
115
|
+
},
|
116
|
+
"chassis": {
|
117
|
+
"type": "Other"
|
118
|
+
},
|
119
|
+
"manufacturer": "innotek GmbH",
|
120
|
+
"product": {
|
121
|
+
"name": "VirtualBox",
|
122
|
+
"serial_number": "0",
|
123
|
+
"uuid": "34D3157B-EE15-4BB7-80B4-1CAB1D14262F"
|
124
|
+
}
|
125
|
+
},
|
126
|
+
"facterversion": "3.1.1",
|
127
|
+
"filesystems": "xfs",
|
128
|
+
"fips_enabled": true,
|
129
|
+
"fullrun": "false",
|
130
|
+
"gdm_version": "0.0.0",
|
131
|
+
"grub_version": "2.02~beta2",
|
132
|
+
"has_tpm": true,
|
133
|
+
"identity": {
|
134
|
+
"gid": 0,
|
135
|
+
"group": "root",
|
136
|
+
"uid": 0,
|
137
|
+
"user": "root"
|
138
|
+
},
|
139
|
+
"init_systems": [
|
140
|
+
"rc",
|
141
|
+
"systemd",
|
142
|
+
"sysv"
|
143
|
+
],
|
144
|
+
"ipv6_enabled": true,
|
145
|
+
"is_pe": true,
|
146
|
+
"is_virtual": true,
|
147
|
+
"kernel": "Linux",
|
148
|
+
"kernelmajversion": "3.10",
|
149
|
+
"kernelrelease": "3.10.0-327.el7.x86_64",
|
150
|
+
"kernelversion": "3.10.0",
|
151
|
+
"load_averages": {
|
152
|
+
"15m": 0.02,
|
153
|
+
"1m": 0.25,
|
154
|
+
"5m": 0.06
|
155
|
+
},
|
156
|
+
"memory": {
|
157
|
+
"swap": {
|
158
|
+
"available": "1.00 GiB",
|
159
|
+
"available_bytes": 1073737728,
|
160
|
+
"capacity": "0%",
|
161
|
+
"total": "1.00 GiB",
|
162
|
+
"total_bytes": 1073737728,
|
163
|
+
"used": "0 bytes",
|
164
|
+
"used_bytes": 0
|
165
|
+
},
|
166
|
+
"system": {
|
167
|
+
"available": "361.91 MiB",
|
168
|
+
"available_bytes": 379490304,
|
169
|
+
"capacity": "26.00%",
|
170
|
+
"total": "489.04 MiB",
|
171
|
+
"total_bytes": 512798720,
|
172
|
+
"used": "127.13 MiB",
|
173
|
+
"used_bytes": 133308416
|
174
|
+
}
|
175
|
+
},
|
176
|
+
"mountpoints": {
|
177
|
+
"/": {
|
178
|
+
"available": "33.15 GiB",
|
179
|
+
"available_bytes": 35590717440,
|
180
|
+
"capacity": "3.78%",
|
181
|
+
"device": "/dev/mapper/rhel-root",
|
182
|
+
"filesystem": "xfs",
|
183
|
+
"options": [
|
184
|
+
"rw",
|
185
|
+
"relatime",
|
186
|
+
"attr2",
|
187
|
+
"inode64",
|
188
|
+
"noquota"
|
189
|
+
],
|
190
|
+
"size": "34.45 GiB",
|
191
|
+
"size_bytes": 36988276736,
|
192
|
+
"used": "1.30 GiB",
|
193
|
+
"used_bytes": 1397559296
|
194
|
+
},
|
195
|
+
"/boot": {
|
196
|
+
"available": "371.55 MiB",
|
197
|
+
"available_bytes": 389595136,
|
198
|
+
"capacity": "25.19%",
|
199
|
+
"device": "/dev/sda1",
|
200
|
+
"filesystem": "xfs",
|
201
|
+
"options": [
|
202
|
+
"rw",
|
203
|
+
"relatime",
|
204
|
+
"attr2",
|
205
|
+
"inode64",
|
206
|
+
"noquota"
|
207
|
+
],
|
208
|
+
"size": "496.67 MiB",
|
209
|
+
"size_bytes": 520794112,
|
210
|
+
"used": "125.12 MiB",
|
211
|
+
"used_bytes": 131198976
|
212
|
+
}
|
213
|
+
},
|
214
|
+
"networking": {
|
215
|
+
"dhcp": "10.0.2.2",
|
216
|
+
"domain": "example.com",
|
217
|
+
"fqdn": "foo.example.com",
|
218
|
+
"hostname": "foo",
|
219
|
+
"interfaces": {
|
220
|
+
"enp0s3": {
|
221
|
+
"bindings": [
|
222
|
+
{
|
223
|
+
"address": "10.0.2.15",
|
224
|
+
"netmask": "255.255.255.0",
|
225
|
+
"network": "10.0.2.0"
|
226
|
+
}
|
227
|
+
],
|
228
|
+
"bindings6": [
|
229
|
+
{
|
230
|
+
"address": "fe80::a00:27ff:fefb:4e9e",
|
231
|
+
"netmask": "ffff:ffff:ffff:ffff::",
|
232
|
+
"network": "fe80::"
|
233
|
+
}
|
234
|
+
],
|
235
|
+
"dhcp": "10.0.2.2",
|
236
|
+
"ip": "10.0.2.15",
|
237
|
+
"ip6": "fe80::a00:27ff:fefb:4e9e",
|
238
|
+
"mac": "08:00:27:fb:4e:9e",
|
239
|
+
"mtu": 1500,
|
240
|
+
"netmask": "255.255.255.0",
|
241
|
+
"netmask6": "ffff:ffff:ffff:ffff::",
|
242
|
+
"network": "10.0.2.0",
|
243
|
+
"network6": "fe80::"
|
244
|
+
},
|
245
|
+
"lo": {
|
246
|
+
"bindings": [
|
247
|
+
{
|
248
|
+
"address": "127.0.0.1",
|
249
|
+
"netmask": "255.0.0.0",
|
250
|
+
"network": "127.0.0.0"
|
251
|
+
}
|
252
|
+
],
|
253
|
+
"bindings6": [
|
254
|
+
{
|
255
|
+
"address": "::1",
|
256
|
+
"netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
|
257
|
+
"network": "::1"
|
258
|
+
}
|
259
|
+
],
|
260
|
+
"ip": "127.0.0.1",
|
261
|
+
"ip6": "::1",
|
262
|
+
"mtu": 65536,
|
263
|
+
"netmask": "255.0.0.0",
|
264
|
+
"netmask6": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
|
265
|
+
"network": "127.0.0.0",
|
266
|
+
"network6": "::1"
|
267
|
+
}
|
268
|
+
},
|
269
|
+
"ip": "10.0.2.15",
|
270
|
+
"ip6": "fe80::a00:27ff:fefb:4e9e",
|
271
|
+
"mac": "08:00:27:fb:4e:9e",
|
272
|
+
"mtu": 1500,
|
273
|
+
"netmask": "255.255.255.0",
|
274
|
+
"netmask6": "ffff:ffff:ffff:ffff::",
|
275
|
+
"network": "10.0.2.0",
|
276
|
+
"network6": "fe80::",
|
277
|
+
"primary": "enp0s3"
|
278
|
+
},
|
279
|
+
"openldap_arch": "i386",
|
280
|
+
"os": {
|
281
|
+
"architecture": "x86_64",
|
282
|
+
"family": "RedHat",
|
283
|
+
"hardware": "x86_64",
|
284
|
+
"name": "RedHat",
|
285
|
+
"release": {
|
286
|
+
"full": "7.2",
|
287
|
+
"major": "7",
|
288
|
+
"minor": "2"
|
289
|
+
},
|
290
|
+
"selinux": {
|
291
|
+
"enabled": false
|
292
|
+
}
|
293
|
+
},
|
294
|
+
"partitions": {
|
295
|
+
"/dev/mapper/rhel-root": {
|
296
|
+
"filesystem": "xfs",
|
297
|
+
"mount": "/",
|
298
|
+
"size": "34.46 GiB",
|
299
|
+
"size_bytes": 37006344192,
|
300
|
+
"uuid": "c7df9cee-11aa-4924-bb97-a6e5609074e4"
|
301
|
+
},
|
302
|
+
"/dev/mapper/rhel-swap": {
|
303
|
+
"filesystem": "swap",
|
304
|
+
"size": "1.00 GiB",
|
305
|
+
"size_bytes": 1073741824,
|
306
|
+
"uuid": "12e4d10a-0215-40f4-999c-cdda69a81e0e"
|
307
|
+
},
|
308
|
+
"/dev/sda1": {
|
309
|
+
"filesystem": "xfs",
|
310
|
+
"mount": "/boot",
|
311
|
+
"size": "500.00 MiB",
|
312
|
+
"size_bytes": 524288000,
|
313
|
+
"uuid": "26ae70e9-4393-4187-b8c5-f2eaa52a4fb5"
|
314
|
+
},
|
315
|
+
"/dev/sda2": {
|
316
|
+
"filesystem": "LVM2_member",
|
317
|
+
"size": "35.51 GiB",
|
318
|
+
"size_bytes": 38129369088,
|
319
|
+
"uuid": "TZpq2a-lF1X-0AhR-39lC-OG8V-Mbox-dyhox3"
|
320
|
+
}
|
321
|
+
},
|
322
|
+
"path": "/opt/puppetlabs/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin",
|
323
|
+
"processors": {
|
324
|
+
"count": 1,
|
325
|
+
"isa": "x86_64",
|
326
|
+
"models": [
|
327
|
+
"Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz"
|
328
|
+
],
|
329
|
+
"physicalcount": 1
|
330
|
+
},
|
331
|
+
"puppet_ruby_dir": "/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet",
|
332
|
+
"radius_version": "unknown",
|
333
|
+
"reboot_required": true,
|
334
|
+
"root_home": "/root",
|
335
|
+
"ruby": {
|
336
|
+
"platform": "x86_64-linux",
|
337
|
+
"sitedir": "/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0",
|
338
|
+
"version": "2.1.7"
|
339
|
+
},
|
340
|
+
"runlevel": "3",
|
341
|
+
"shmall": "18446744073692774399",
|
342
|
+
"ssh": {
|
343
|
+
"ecdsa": {
|
344
|
+
"fingerprints": {
|
345
|
+
"sha1": "SSHFP 3 1 d44325c8395220c069b904fb775545ea172028a9",
|
346
|
+
"sha256": "SSHFP 3 2 a60f5d46c5f1aae180628f668b5c2f253d5134911dac877de0746563659e964a"
|
347
|
+
},
|
348
|
+
"key": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFfbV5ASN7bH9k8g3xRPTnWgtJZ34JEJuA5cLPVXOFtx9RVa1JRDMkhReLCNoYebvFNqZR/jyILoGd8zonv0HpE="
|
349
|
+
},
|
350
|
+
"ed25519": {
|
351
|
+
"fingerprints": {
|
352
|
+
"sha1": "SSHFP 4 1 d8809518ff1125aa291eb2c91c1ec5a6c3c64a4a",
|
353
|
+
"sha256": "SSHFP 4 2 45e26effcb888f15104870cc1c5182068f68966513ec452c8478c7ee2fad7029"
|
354
|
+
},
|
355
|
+
"key": "AAAAC3NzaC1lZDI1NTE5AAAAIEH9zW3/vlU6ToqjIGoRKBxBJCKad7f4/A4cqe+QddYO"
|
356
|
+
},
|
357
|
+
"rsa": {
|
358
|
+
"fingerprints": {
|
359
|
+
"sha1": "SSHFP 1 1 d9ef3f8744fb5c16b18285bf1bc3d8dc466a9061",
|
360
|
+
"sha256": "SSHFP 1 2 9489100f59197122bb05f1cc36e786de0dae1f2bef8148ad1eca98e5c068147f"
|
361
|
+
},
|
362
|
+
"key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQCske477GChfDYp42V41KDzWPm4tFaizuv6pgDX5ta+Mmx+aIzH8sHqEJI8CHbueD4RPcewrVhuCKjVp/8L9Ei+Fvix45Hu5SFcGMsNnYU0xIZ7DIPMmrYxfaN7LOv7mpNQuRgteOSiEsVtBbBnITnnOsmSFS325cg1exEhO714w6Zrq2Ba2iE1iIsbI+B5i5MCmRtxx8lXf7mm26dzwLgzEehyVSunDrsNSLOSKe2ak/fPwuANozePIFaBPAnzbqdC0vlZhPIXS4Es5FGkBWjURGC3sgkMRhIwVl1JKCID1ShBIwF5iS3TrLFBN1KswpULNeWS+BKwZ3a7XNedtxvB"
|
363
|
+
}
|
364
|
+
},
|
365
|
+
"system_uptime": {
|
366
|
+
"days": 0,
|
367
|
+
"hours": 0,
|
368
|
+
"seconds": 37,
|
369
|
+
"uptime": "0:00 hours"
|
370
|
+
},
|
371
|
+
"timezone": "EDT",
|
372
|
+
"tmp_mount_dev_shm": "rw,nosuid,nodev",
|
373
|
+
"tmp_mount_fstype_dev_shm": "tmpfs",
|
374
|
+
"tmp_mount_path_dev_shm": "tmpfs",
|
375
|
+
"uid_min": "1000",
|
376
|
+
"virtual": "virtualbox"
|
377
|
+
}
|
data/facts/Gemfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
puppetversion = ENV.key?('PUPPET_VERSION') ? "#{ENV['PUPPET_VERSION']}" : ['~>3']
|
2
|
+
source ENV['GEM_SOURCE'] || "https://rubygems.org"
|
3
|
+
|
4
|
+
gem 'json', :require => false
|
5
|
+
gem 'puppet', puppetversion, :require => false
|
6
|
+
|
7
|
+
if facterversion = ENV['FACTER_GEM_VERSION']
|
8
|
+
gem 'facter', facterversion, :require => false
|
9
|
+
else
|
10
|
+
gem 'facter', :require => false
|
11
|
+
end
|
data/facts/Vagrantfile
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
5
|
+
VAGRANTFILE_API_VERSION = "2"
|
6
|
+
|
7
|
+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
8
|
+
|
9
|
+
config.vm.hostname = "foo.example.com"
|
10
|
+
config.vm.define "redhat-6-x86_64" do |host|
|
11
|
+
host.vm.box = "anandbitra/redhat-6.5"
|
12
|
+
host.vm.provision "file", source: "Gemfile", destination: "Gemfile"
|
13
|
+
host.vm.provision "shell", path: "get_facts.sh", args: "6"
|
14
|
+
host.vm.provision "shell", inline: "/sbin/shutdown -h now"
|
15
|
+
end
|
16
|
+
config.vm.define "redhat-6-x86_64" do |host|
|
17
|
+
host.vm.box = "mrlesmithjr/rhel-7"
|
18
|
+
host.vm.provision "file", source: "Gemfile", destination: "Gemfile"
|
19
|
+
host.vm.provision "shell", path: "get_facts.sh", args: "7"
|
20
|
+
host.vm.provision "shell", inline: "/sbin/shutdown -h now"
|
21
|
+
end
|
22
|
+
config.vm.define "centos-6-x86_64" do |host|
|
23
|
+
host.vm.box = "puppetlabs/centos-6.6-64-nocm"
|
24
|
+
host.vm.provision "file", source: "Gemfile", destination: "Gemfile"
|
25
|
+
host.vm.provision "shell", path: "get_facts.sh", args: "6"
|
26
|
+
host.vm.provision "shell", inline: "/sbin/shutdown -h now"
|
27
|
+
end
|
28
|
+
config.vm.define "centos-7-x86_64" do |host|
|
29
|
+
host.vm.box = "puppetlabs/centos-7.0-64-nocm"
|
30
|
+
host.vm.provision "file", source: "Gemfile", destination: "Gemfile"
|
31
|
+
host.vm.provision "shell", path: "get_facts.sh", args: "7"
|
32
|
+
host.vm.provision "shell", inline: "/sbin/shutdown -h now"
|
33
|
+
end
|
34
|
+
end
|
data/facts/get_facts.sh
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
operatingsystemmajrelease=$1
|
3
|
+
|
4
|
+
export PATH=/opt/puppetlabs/bin:$PATH
|
5
|
+
export FACTERLIB=`ls -1d /vagrant/modules/*/lib/facter | tr '\n' ':'`
|
6
|
+
|
7
|
+
yum install epel-release -y
|
8
|
+
wget "https://yum.puppetlabs.com/puppetlabs-release-pc1-el-${operatingsystemmajrelease}.noarch.rpm" -O /tmp/puppetlabs-release-pc1.rpm
|
9
|
+
rpm -ivh /tmp/puppetlabs-release-pc1.rpm
|
10
|
+
|
11
|
+
# Capture data for (c)facter 3.X
|
12
|
+
for puppet_agent_version in 1.2.2 1.2.7; do
|
13
|
+
yum install -y puppet-agent-${puppet_agent_version} rubygems git ruby-devel
|
14
|
+
output_file="/vagrant/$(facter --version | cut -c1-3)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
|
15
|
+
mkdir -p $(dirname ${output_file})
|
16
|
+
facter -j | tee ${output_file}
|
17
|
+
done
|
18
|
+
|
19
|
+
operatingsystem=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
|
20
|
+
operatingsystemmajrelease=$(facter operatingsystemmajrelease)
|
21
|
+
hardwaremodel=$(facter hardwaremodel)
|
22
|
+
|
23
|
+
PATH=/opt/puppetlabs/puppet/bin:$PATH
|
24
|
+
gem install bundler --no-ri --no-rdoc --no-format-executable
|
25
|
+
bundle install --path vendor/bundler
|
26
|
+
|
27
|
+
# Capture data for ruby-based facters
|
28
|
+
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
|
29
|
+
FACTER_GEM_VERSION="~> ${version}" bundle update
|
30
|
+
output_file="/vagrant/$(bundle exec facter --version | cut -c1-3)/${operatingsystem}-${operatingsystemmajrelease}-${hardwaremodel}.facts"
|
31
|
+
mkdir -p $(dirname $output_file)
|
32
|
+
echo $version | grep -q -E '^1\.' &&
|
33
|
+
FACTER_GEM_VERSION="~> ${version}" bundle exec facter -j | bundle exec ruby -e 'require "json"; jj JSON.parse gets' | tee $output_file ||
|
34
|
+
FACTER_GEM_VERSION="~> ${version}" bundle exec facter -j | tee $output_file
|
35
|
+
done
|