Forge Home

http

This module uses wiccian magic to POST and GET shit from the interwebs

13,471 downloads

13,093 latest version

2.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.1.3 (latest)
  • 0.1.2
  • 0.1.1
  • 0.1.0 (deleted)
released Apr 2nd 2015
This version is compatible with:
  • Puppet Enterprise >3.2.0 <4.0.0
  • Puppet >3.0.0 <4.0.0
  • ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'malnick-http', '0.1.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add malnick-http
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install malnick-http --version 0.1.3

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

malnick/http — version 0.1.3 Apr 2nd 2015

puppet-http

HTTP Provider

Provider will run a simple query against a webhook. For example, you'd like to run a GET request on http://localhost:8080/this:

GET

http { 'this':
  ensure      => get,
  port        => '8080',
  fqdn        => 'localhost', # Do not place the http://, this currently done by the provider. Will update for https support soon.
}

This is nice if you have a webhook running somewhere to execute a certain command, and you'd like to hit that hook each time you run puppet on a specific node.

Or POST - All data is mutated to JSON

http { 'status':
  ensure  => post,
  port    => '1015',
  fqdn    => 'localhost',
  data    => {
    'hostname'          => $::fqdn,
    'some_data_key'     => '1.2.3',
    'some_other_data'   => 'ImImportant'
  }
}

Listener Defined Type

This module also provides a simple webhook erb template that sets up a listener:

include http
http::listener {'puppet':
  port => '6969',
  routes            => { 
    'run_puppet'  => {
      'method'  => 'get',
      'command' => "su - peadmin -c 'mco puppet runonce'"
    },
    'test'        => {
      'method'  => 'get',
      'command' => 'echo fuckitshipit',
    },
  }
}

Listener Defined Type Parameters

ssl_enable

cert_path

key_path

port

bind_address

rack_env

command

http_method

Big fucking todo list

  1. https support for webhook provider
  2. more listener options:
    1. more than one route per webhook
    2. stricter security; github token verification
  3. put method for provider
  4. other shit I didn't do this sunday