http

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

malnick

malnick

11,942 downloads

11,726 latest version

2.6 quality score

Version information

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

Start using this module

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