Coder Social home page Coder Social logo

nicklewis / puppetlabs-facts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from puppetlabs/puppetlabs-facts

0.0 1.0 0.0 126 KB

This module provides the facts task. This task allows you to discover facts about remote machines in your infrastructure.

License: Apache License 2.0

Ruby 73.51% Puppet 3.52% Shell 17.17% PowerShell 5.79%

puppetlabs-facts's Introduction

facts

Table of Contents

  1. Description
  2. Requirements
  3. Usage
  4. Reference - An under-the-hood peek at what the module is doing and how

Description

This module provides a collection of facts tasks and plans all of which retrieve facts from the specified nodes but each of them processes the retrieved facts differently. The provided plans are:

  • facts - retrieves the facts and then stores them in the inventory, returns a result set wrapping result objects for each specified node which in turn wrap the retrieved facts
  • facts::info - retrieves the facts and returns information about each node's OS compiled from the os fact value retrieved from that node

The provided tasks:

  • facts - retrieves the facts and without further processing returns a result set wrapping result objects for each specified node which in turn wrap the retrieved facts (this task is used by the above plans). This task relies on cross-platform task support; if unavailable, the individual implementations can be used instead.
  • facts::bash - bash implementation of fact gathering, used by the facts task.
  • facts::powershell - powershell implementation of fact gathering, used by the facts task.
  • facts::ruby - ruby implementation of fact gathering, used by the facts task.

puppet_agent module support: The puppet_agent::install_shell task uses the bash.sh implementation code to gather facts. When bash.sh is invoked with the positional argument platform or release only the requested fact is returned.

Example

root@y77tzpv6qxnx5at:~# ./bash.sh 
{
  "os": {
    "name": "Ubuntu",
    "release": {
      "full": "16.04",
      "major": "16",
      "minor": "04"
    },
    "family": "Debian"
  }
}
root@y77tzpv6qxnx5at:~# ./bash.sh "release"
16.04
root@y77tzpv6qxnx5at:~# ./bash.sh "platform"
Ubuntu

Requirements

This module is compatible with the version of Puppet Bolt it ships with.

Usage

To run the facts plan run

bolt plan run facts --nodes node1.example.com,node2.example.com

Parameters

All plans have only one parameter:

  • nodes - The nodes to retrieve the facts from.

Reference

The core functionality is implemented in the facts task, which provides implementations for the shell, powershell, and puppet-agent features. The powerhsell and bash implementations of the task compile and return information mimicking that provided by facter's os fact. When the puppet-agent feature is available the ruby implementation will return the result running facter --json on the target.

puppetlabs-facts's People

Contributors

donoghuc avatar mikaelsmith avatar lucywyman avatar m0dular avatar beechtom avatar adreyer avatar michaeltlombardi avatar nicklewis avatar tphoney avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.