puppet_factset 0.0.1 → 0.1.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/.gitignore +1 -0
- data/README.md +50 -9
- data/lib/puppet_factset/version.rb +1 -1
- data/puppet_factset.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38b6cc58132c293138599dee9c30da298b6a27e5
|
4
|
+
data.tar.gz: ef1a14a36adabf3a7c19874475ee8603e12b7827
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 151d35eae868ac8f9124ab654e00a17f61aaa6aaef4b5ea14f40be82b0568fc460ffa9c8b2dfda0f21c7d7bcc66d963978d797e9ea96239a575dcc09df3e13d1
|
7
|
+
data.tar.gz: eb0081f76d68ceaec37dba2081713727fb26deee709092cd0e0f6337ef55cfc06b1b01e6336383c0107d266d8ecb64cb843dd69faa0b420d1a130de76c074f74
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,12 +1,30 @@
|
|
1
|
+
[](https://travis-ci.org/declarativesystems/puppet_factset)
|
1
2
|
# PuppetFactset
|
2
3
|
|
3
|
-
|
4
|
+
This gem provides the output of [Facter](https://docs.puppet.com/facter/3.6/) on several representative test systems which makes a complete set of OS specific facts (AKA factsets) available to programs such as [Onceover](https://github.com/dylanratcliffe/onceover) and [PDQTest](https://github.com/declarativesystems/pdqtest). The aim here is to provide a shared, reusable and small library providing easy access to facter output on as many platforms as possible.
|
4
5
|
|
5
|
-
|
6
|
+
## Adding new platforms
|
7
|
+
To create support for additional platforms all we need to do is log onto a real machine that has puppet installed and run:
|
6
8
|
|
7
|
-
|
9
|
+
```shell
|
10
|
+
puppet facts > OSNAME-OSVERSION-ARCH.json
|
11
|
+
```
|
12
|
+
|
13
|
+
Where:
|
14
|
+
|
15
|
+
* OSNAME is the Operating System name, eg `Debian`
|
16
|
+
* OSVERSION is the Operating System versoin number, eg `7.8`
|
17
|
+
* ARCH indicates the CPU architecture, eg `32`, `64`, `powerpc`
|
18
|
+
|
19
|
+
`puppet facts` will give raw json output of every fact which puppet knows about.
|
8
20
|
|
9
|
-
|
21
|
+
Once we have our factset all we need to do is copy it into `res/factset/` inside this git repository and commit it to version control. To share your new platform support with the world, please create a [Pull Request](https://help.github.com/articles/about-pull-requests/).
|
22
|
+
|
23
|
+
Factsets are named based on their filename, not the name of the server they came from/
|
24
|
+
|
25
|
+
|
26
|
+
## Installation
|
27
|
+
`puppet_factset` is intended to be used as a library and provides no executable. To use in your own application, add this line to your application's Gemfile:
|
10
28
|
|
11
29
|
```ruby
|
12
30
|
gem 'puppet_factset'
|
@@ -21,16 +39,39 @@ Or install it yourself as:
|
|
21
39
|
$ gem install puppet_factset
|
22
40
|
|
23
41
|
## Usage
|
42
|
+
* `puppet_factset` provides a minimal API to obtain fact information, see below
|
43
|
+
* Dependencies are deliberately kept small/absent
|
24
44
|
|
25
|
-
|
45
|
+
### Factset Directory
|
46
|
+
To obtain the real filesystem directory containing the factset files (`res/factset`):
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
require 'puppet_factset'
|
50
|
+
factset_dir = PuppetFactset::factset_dir
|
51
|
+
```
|
52
|
+
|
53
|
+
### Hash of facts
|
54
|
+
To obtain a representitive hash of facts for a given system:
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
require 'puppet_factset'
|
58
|
+
fact_hash = PuppetFactset::factset_hash(system_name)
|
59
|
+
```
|
60
|
+
|
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
|
+
* If required system is absent a `RuntimeError` will be raised
|
26
63
|
|
27
64
|
## Development
|
28
65
|
|
29
|
-
|
66
|
+
* RSpec tests are provided, please ensure these pass before and after adding any ruby code to the project
|
67
|
+
* If adding new functionality, please write an acommpanying testcase
|
68
|
+
* To run tests: `bundle install && bundle exec rake spec`
|
30
69
|
|
31
|
-
|
70
|
+
## Authors
|
71
|
+
* [Dylan Ratcliffe](https://github.com/dylanratcliffe)
|
72
|
+
* [Geoff Williams](https://github.com/geoffwilliams)
|
73
|
+
* [Jesse Reynolds](https://github.com/jessereynolds)
|
32
74
|
|
33
75
|
## Contributing
|
34
76
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
36
|
-
|
77
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/declarativesystems/puppet_factset.
|
data/puppet_factset.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["geoff@geoffwilliams.me.uk"]
|
11
11
|
|
12
12
|
spec.summary = %q{Sample factsets for puppet testing. A factset is a representative sample of the set of facts for a particular OS}
|
13
|
-
spec.homepage = "https://github.com/
|
13
|
+
spec.homepage = "https://github.com/declarativesystems/puppet_factset"
|
14
14
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
16
16
|
f.match(%r{^(test|spec|features)/})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet_factset
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geoff Williams
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-03
|
13
|
+
date: 2017-04-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -94,7 +94,7 @@ files:
|
|
94
94
|
- res/factset/Windows_Server-2012r2-64.json
|
95
95
|
- res/factset/solaris-10_u9-sparc-64.json
|
96
96
|
- res/factset/solaris-11.2-sparc-64.json
|
97
|
-
homepage: https://github.com/
|
97
|
+
homepage: https://github.com/declarativesystems/puppet_factset
|
98
98
|
licenses: []
|
99
99
|
metadata: {}
|
100
100
|
post_install_message:
|