Coder Social home page Coder Social logo

puppet-hubot's Introduction

What is it?

A puppet module that installs and manages a hubot bot.

There are two methods of configuring hubot, setting the available parameters (useful for trying it out/simple configs) and storing your config and scripts in git. Instructions below as well on migrating from parameter config to repo configuration.

Configuring via Puppet

This method is great for giving hubot a try to figure out what it's all about and maintaining a simple configuration. If you want to be able to run hubot with only the shell adapter, no configuration is required other than including this class and then running /opt/hubot/hubot/bin/hubot (that's a lot of hubots) and interact with him on the shell.

To move hubot to something a bit more useful you will want to configure an adapter for it to connect to some form of chat. This will require setting the adapter parameter and will likely require you to also set some environment variables via the env_export parameter. You may also need to add some npm dependencies for your adapter via the dependencies parameter.

At this point you should be on your way!

Custom scripts can be installed via the hubot::script definition as well.

Simple config with the hipchat adapter:

class { 'hubot':
  adapter       => 'hipchat',
  build_deps    => [ 'libxml2-devel', 'gcc-c++' ],
  env_export    => { 'HUBOT_LOG_LEVEL'        => 'DEBUG',
                     'HUBOT_HIPCHAT_ROOMS'    => '[email protected],[email protected]',
                     'HUBOT_HIPCHAT_JID'      => '[email protected]',
                     'HUBOT_HIPCHAT_PASSWORD' => 'hubot_pass'
                    },
  dependencies  => { "hubot" => ">= 2.6.0 < 3.0.0", "hubot-scripts" => ">= 2.5.0 < 3.0.0", "hubot-hipchat" => "~2.5.1-5" },
}

Configuring via git

This method is more customizable since you can configure hubot by editing the actual configuration files. When using this method a few additional dependencies are required, a class git which needs to ensure the git binary is available and puppetlabs/vcsrepo. Both dependencies (as tested) are documented in the Modulefile, but commented out as they are optional. The git dependency should be very flexible, the vcsrepo dependency likely is harder to replace with another module.

To configure hubot from a git repo, simply set the git_source parameter. If your git repo is accessible via SSH you may also need to set the ssh_privateykey or ssh_privatekey_file to configure the id_rsa file for the hubot user. By default the auto_accept_host_key parameter is set to true which will disable StrictHostKeyChecking for the hubot user - this may not be ideal in your environment. If disabled and syncing via SSH, you will need to ensure the git host key is trusted by some other means.

Getting up and running:

class { 'hubot':
  git_source          => '[email protected]:hubot',
  ssh_privatekey_file => 'puppet:///data/ssh/hubot_id_rsa',
 }

Build dependencies

Frequently NPM modules require additional packages in order to compile the module. In this case you can include any additional dependencies with the build_deps parameter.

Migrating from parameters to git

This assumes basic knowledge of git and an understanding of why you are doing this. All paths are based on the module defaults.

puppet agent --disable
cd /opt/hubot/hubot
git init
git add .
git remote add origin <git_source>
git push origin master
--- Update your puppet config to specify this new git_source and any SSH parameters needed
puppet agent --enable

Puppet will now keep hubot up to date based on this git repo and restart the service whenever it is updated.

Known Issues:

Only tested on Ubuntu 14.04 but should be flexible. Feedback/PRs appreciated!

License:

Released under the Apache 2.0 licence

Contribute:

  • Fork it
  • Create a topic branch
  • Improve/fix (with spec tests)
  • Push new topic branch
  • Submit a PR

puppet-hubot's People

Contributors

jlambert121 avatar frozenfoxx avatar iax7 avatar andyroyle avatar cyberkov avatar joshbeard avatar bilco105 avatar brandonweeks avatar genebean avatar jfryman avatar segfaultax avatar pcfens avatar

Watchers

James Cloos avatar Cyril Pinkham 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.