puppet_factset 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -1
- data/lib/puppet_factset.rb +7 -0
- data/lib/puppet_factset/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0754749c4c870dcded710129b236ad4ea27af8f
|
4
|
+
data.tar.gz: 69547a6d57eff94c09409cab141c5593353da983
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3a9ae9415a6d3fe4171f674c7c5c621d9ec5d513b610943b0f85ea8abbdf0e6492478115e5dad1ca4fe7f133e654190905fbfd3cf429fcdf343b79ae4660fb0
|
7
|
+
data.tar.gz: eba0d2c2464e03a5c072d7008f55cd2c556d9fa4946e467d3c1d4ed9483335655b894f320d2cf5aee92fb6634243a686ebd6c0bc0f47b73f3c87b67e69471232
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ puppet facts > OSNAME-OSVERSION-ARCH.json
|
|
13
13
|
Where:
|
14
14
|
|
15
15
|
* OSNAME is the Operating System name, eg `Debian`
|
16
|
-
* OSVERSION is the Operating System
|
16
|
+
* OSVERSION is the Operating System version number, eg `7.8`
|
17
17
|
* ARCH indicates the CPU architecture, eg `32`, `64`, `powerpc`
|
18
18
|
|
19
19
|
`puppet facts` will give raw json output of every fact which puppet knows about.
|
@@ -61,6 +61,14 @@ fact_hash = PuppetFactset::factset_hash(system_name)
|
|
61
61
|
* `system_name` needs to correspond to a file in the factset dir, eg use 'Debian-7.8-64' to access the `'Debian-7.8-64.json'` file.
|
62
62
|
* If required system is absent a `RuntimeError` will be raised
|
63
63
|
|
64
|
+
### Available Factsets
|
65
|
+
To obtain the list of available factsets suitable for use with `factset_hash`:
|
66
|
+
|
67
|
+
```ruby
|
68
|
+
require 'puppet_factset'
|
69
|
+
factsets = PuppetFactset::factsets
|
70
|
+
```
|
71
|
+
|
64
72
|
## Development
|
65
73
|
|
66
74
|
* RSpec tests are provided, please ensure these pass before and after adding any ruby code to the project
|
data/lib/puppet_factset.rb
CHANGED
@@ -14,4 +14,11 @@ module PuppetFactset
|
|
14
14
|
# The facts are tucked away inside the 'values' element so just return that
|
15
15
|
data["values"]
|
16
16
|
end
|
17
|
+
|
18
|
+
# List the available factsets
|
19
|
+
def self.factsets()
|
20
|
+
Dir.glob(File.join(factset_dir, '*.json')).map { |f|
|
21
|
+
File.basename(f).gsub('.json','')
|
22
|
+
}
|
23
|
+
end
|
17
24
|
end
|