brianshumate.hubot

Ansible Hubot

Build Status
Ansible Galaxy
Average time to resolve an issue
Percentage of issues still open

This is an Ansible role for Hubot, a fun chat robot designed to boost your team's productivity!

By default, this Hubot role uses the Slack adapter, but you can switch to another adapter like HipChat by changing the defaults/main.yml file, updating the hubot_adapter value, and adding the necessary environment variables.

Requirements

This role works on Ubuntu or CentOS Linux systems, and it's been tested with the following software versions:

  • Ansible: 2.2.0.0
  • Hubot: GitHub Master
  • Node.js: 6.9.1
  • CentOS: 6
  • Ubuntu: 14.04, 13.10, 13.04, 12.10, 12.04

Works with Ansible Galaxy

You can install this role using the ansible-galaxy command instead of cloning the git repository.

To install it, run:

ansible-galaxy install brianshumate.hubot

Ensure you have write access to /etc/ansible/roles/, or make your own path by creating a $HOME/.ansible.cfg file containing:

[defaults]
roles_path = <path_to_your_preferred_role_location>

Replace <path_to_your_preferred_role_location> with a directory you can write to.

Refer to the ansible-galaxy documentation for more details.

Role Variables

All role variables can be found in defaults/main.yml.

Name Default Value Description
hubot_admin vagrant OS username for Hubot admin
hubot_adapter slack Preferred chat adapter
hubot_node_version 0.10.36 Preferred Node.js version
hubot_dir path Hubot base directory
hubot_nvm_dir path Node Version Manager installation
hubot_node_dir path
hubot_global_node_packages list Global Node.js packages to install
hubot_all_dirs list Directories owned by Hubot admin
hubot_env list Environment variables for Hubot
hubot_identity hubot Bot name
hubot_owner "'Stephie Andretti stephie@example.com'" Bot owner
hubot_description "'A helpful chat robot'" Bot description
hubot_node_packages list Node.js dependency packages to install
hubot_external_scripts list External Hubot scripts
hubot_external_git_scripts list Git-based external Hubot scripts
hubot_custom_scripts list Scripts from files/scripts
hubot_git_scripts list Scripts to clone from Git
epel_repo_gpg_key path EPEL GPG key URL
epel_repo_url URL EPEL repository URL

Node Packages

The hubot_node_packages variable includes the following Node.js packages:

  • cheerio
  • chrono-node
  • clark
  • htmlparser
  • hubot-ascii-art
  • hubot-coin
  • hubot-calculator
  • hubot-hipchat-emoticons
  • hubot-{{ hubot_adapter }}
  • hubot-redis-brain
  • hubot-scripts
  • hubot-xkcd
  • hubot-youtube
  • lodash
  • moment
  • nodepie
  • soupselect
  • textspark

Recent Hubot scripts are also available as Node modules.

The hubot_centos_os_packages and hubot_ubuntu_os_packages variables list OS packages that Hubot needs; they should work fine as they are.

The hubot_os_packages variable includes these OS packages:

  • build-essential
  • curl
  • git-core
  • libssl-dev
  • libexpat1-dev
  • redis-server

Redis is used for the redis brain feature.

Scripts

To enable more Hubot scripts, add them to the hubot_node_packages and hubot_external_scripts variables.

Configuration

First, adjust the variables in defaults/main.yml as needed.

Then, copy the relevant templates/hubot_?.env.j2 to templates/_hubot_?.env.j2, replacing ? with your hubot_adapter value, and modify the environment variables for your Hubot instance.

Copy hosts.example to hosts and update it with the correct values for your Hubot host. Remember to change:

  • 0.0.0.0
  • ubuntu
  • ~/.ssh/hubot_id

Update the site.yml playbook if necessary, setting hubot_identity to your bot’s short username.

Example Playbook

Once configured, you can install and activate Hubot with the provided site.yml:

ansible-playbook -i hosts site.yml

You can also pass variables with the --extra-vars option:

ansible-playbook -i hosts site.yml --extra-vars "hubot_admin=penelope hubot_adapter=hipchat hubot_identity=penelope hubot_owner='Penelope <[email protected]>' hubot_description='A stunning mermaid bot'"

Test the role

You can test this role using Molecule.

The molecule configuration is in the molecule.yml file at the root of the role. This role is tested with Ubuntu Trusty 64 and CentOS 7, but you can add more platforms if needed.

To set up the test environment, run:

mkvirtualenv -p $(which python2) molecule
pip install molecule ansible

To test the role, execute molecule test --platform trusty64 or molecule test --platform centos7.

Dependencies

None

License

Apache 2

Author Information

Brian Shumate

Contributors

See CONTRIBUTERS.MD

Informazioni sul progetto

Role for Hubot, a delightful chat bot

Installa
ansible-galaxy install brianshumate.hubot
Licenza
other
Download
923
Proprietario
Art ⁂ Data ⁂ Boards ⁂ Water