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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7907fefb28daf1be7fbfc7e7bb862ba8c3f83960
4
- data.tar.gz: 5312c36ad83ae276fb90a781c7c9ba0ee724a07e
3
+ metadata.gz: 38b6cc58132c293138599dee9c30da298b6a27e5
4
+ data.tar.gz: ef1a14a36adabf3a7c19874475ee8603e12b7827
5
5
  SHA512:
6
- metadata.gz: 1ab4d6459d94c5db122e88c0094ff3ffed8b9f2269514ca82af1127a435d48cb99a65096d91806eafec810a8683e73ee5c5f7fce1dcdf8128c8308574513848f
7
- data.tar.gz: 07e5967d4306a990e4dd5f5f20a24e6bc37bfee1e4a50bf98c3771bfad0e02ecc9358224a1ec100ef0a9f996f3099d15b80cec7b2a2a1a7210f35456180abe89
6
+ metadata.gz: 151d35eae868ac8f9124ab654e00a17f61aaa6aaef4b5ea14f40be82b0568fc460ffa9c8b2dfda0f21c7d7bcc66d963978d797e9ea96239a575dcc09df3e13d1
7
+ data.tar.gz: eb0081f76d68ceaec37dba2081713727fb26deee709092cd0e0f6337ef55cfc06b1b01e6336383c0107d266d8ecb64cb843dd69faa0b420d1a130de76c074f74
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
+ *.gem
data/README.md CHANGED
@@ -1,12 +1,30 @@
1
+ [![Build Status](https://travis-ci.org/declarativesystems/puppet_factset.svg?branch=master)](https://travis-ci.org/declarativesystems/puppet_factset)
1
2
  # PuppetFactset
2
3
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/puppet_factset`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Delete this and the text above, and describe your gem
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
- ## Installation
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
- Add this line to your application's Gemfile:
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
- TODO: Write usage instructions here
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
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
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
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
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/[USERNAME]/puppet_factset.
36
-
77
+ Bug reports and pull requests are welcome on GitHub at https://github.com/declarativesystems/puppet_factset.
@@ -1,3 +1,3 @@
1
1
  module PuppetFactset
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -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/GeoffWilliams/puppet_factset"
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.1
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-31 00:00:00.000000000 Z
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/GeoffWilliams/puppet_factset
97
+ homepage: https://github.com/declarativesystems/puppet_factset
98
98
  licenses: []
99
99
  metadata: {}
100
100
  post_install_message: