All Projects → github → octofacts

github / octofacts

Licence: MIT license
Automate creation and maintenance of complete fact sets for rspec-puppet tests

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to octofacts

sonar-puppet
SonarQube plugin for Puppet code.
Stars: ✭ 27 (+28.57%)
Mutual labels:  puppet
aco-oracle java
Puppet module to install Oracle Java on Linux systems
Stars: ✭ 13 (-38.1%)
Mutual labels:  puppet
puppet-prometheus
Puppet module for prometheus
Stars: ✭ 56 (+166.67%)
Mutual labels:  puppet
puppet-puppetserver
Puppet module for puppetserver
Stars: ✭ 21 (+0%)
Mutual labels:  puppet
standalone-configuration-management
Basic examples of how to use each of chef, puppet, salt and ansible as standalone configuration management systems.
Stars: ✭ 14 (-33.33%)
Mutual labels:  puppet
puppet-mrepo
Puppet module for creating and managing RPM based repository mirrors.
Stars: ✭ 17 (-19.05%)
Mutual labels:  puppet
puppet-logstash
Puppet module to manage Logstash
Stars: ✭ 193 (+819.05%)
Mutual labels:  puppet
puppet-pkgng
A Puppet package provider for FreeBSD's PkgNG package manager.
Stars: ✭ 39 (+85.71%)
Mutual labels:  puppet
puppet-icinga2
Puppet module to manage Icinga 2
Stars: ✭ 61 (+190.48%)
Mutual labels:  puppet
puppet-network
Types and providers to manage network interfaces
Stars: ✭ 69 (+228.57%)
Mutual labels:  puppet
puppet-vault
Puppet module to manage Vault (https://vaultproject.io)
Stars: ✭ 41 (+95.24%)
Mutual labels:  puppet
puppet-confluent
Puppet Module for installing and configuring the Confluent Platform
Stars: ✭ 14 (-33.33%)
Mutual labels:  puppet
blogr-pve
Puppet provisioning of HA failover/cluster environment implemented in Proxmox Virtual Environment and Linux boxes.
Stars: ✭ 28 (+33.33%)
Mutual labels:  puppet
biemond-oradb
Puppet Oracle Database Module
Stars: ✭ 59 (+180.95%)
Mutual labels:  puppet
polscan
Zero-setup SSH-based scanner with extensive visualizations for Debian server inventory, policy compliance and vulnerabilities
Stars: ✭ 57 (+171.43%)
Mutual labels:  puppet
puppet-stash
A puppet module to install atlassian stash
Stars: ✭ 19 (-9.52%)
Mutual labels:  puppet
puppet-poudriere
A Puppet module for managing Poudriere, the PkgNG build system.
Stars: ✭ 13 (-38.1%)
Mutual labels:  puppet
puppet-kibana
Kibana Puppet module by Elastic.
Stars: ✭ 17 (-19.05%)
Mutual labels:  puppet
packer-vagrant-builder
Build Solaris,CentOS or Ubuntu Vagrant box with puppet rpm's
Stars: ✭ 49 (+133.33%)
Mutual labels:  puppet
grpc
gRPC Service & Protocol Buffers for Wechaty Puppet
Stars: ✭ 20 (-4.76%)
Mutual labels:  puppet

octofacts

octofacts is a tool that enables Puppet developers to provide complete sets of facts for rspec-puppet tests. It works by saving facts from actual hosts as fixture files, and then presenting a straightforward programming interface to select and manipulate those facts within tests. Using nearly real-life facts is a good way to ensure that rspec-puppet tests match production as closely as possible.

octofacts is actively used in production at GitHub. This project is actively maintained by the original authors and the rest of the Site Reliability Engineering team at GitHub.

Overview

The octofacts project is distributed with two components:

  • The octofacts gem is called within your rspec-puppet tests, to provide facts from indexed fact fixture files in your repository. This allows you to replace a hard-coded let (:facts) { ... } hash with more realistic facts from recent production runs.

  • The octofacts-updater gem is a utility to maintain the indexed fact fixture files consumed by octofacts. It pulls facts from a data source (e.g. PuppetDB, fact caches, or SSH), indexes your facts, and can even create Pull Requests on GitHub to update those fixture files for you.

Requirements

To use octofacts in your rspec-puppet tests, those tests must be executed with Ruby 2.1 or higher and rspec-puppet 2.3.2 or higher, and executed on a Unix-like operating system. We explicitly test octofacts with Linux and Mac OS, but do not test under Windows.

To use octofacts-updater, we recommend using PuppetDB, and if you do you'll need version 3.0 or higher.

Example

Once you complete the initial setup and generate fact fixtures, you'll be able to use code like this in your rspec-puppet tests:

describe "modulename::classname" do
  let(:node) { "fake-node.example.net" }
  let(:facts) { Octofacts.from_index(app: "my_app_name", role: "my_role_name") }

  it "should do whatever..."
    ...
  end
end

Installation and use

The basics:

More advanced usage:

Contributing

Please see our contributing document if you would like to participate!

We would specifically appreciate contributions in these areas:

  • Any updates you make to make octofacts compatible with your site -- there are probably assumptions made from the original environment that need to be more flexible.
  • Any interesting anonymization plugins you write for octofacts-updater -- you may place these in the contrib/plugins directory.

Getting help

If you have a problem or suggestion, please open an issue in this repository, and we will do our best to help. Please note that this project adheres to its Code of Conduct.

License

octofacts is licensed under the MIT license.

Authors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].