├── version.txt ├── tests ├── inventory ├── test.yml └── test_hubot.py ├── templates ├── hubot-scripts.json.j2 ├── external-scripts.json.j2 ├── hubot.service.j2 ├── hubot.env.j2 ├── hubot.conf.j2 ├── start-hubot.sh.j2 └── hubot.init.j2 ├── .gitignore ├── examples ├── vagrant_hosts ├── hosts.example ├── site.yml ├── Vagrantfile └── README_VAGRANT.md ├── molecule.yml ├── meta └── main.yml ├── tasks ├── install_packages_Debian.yml ├── install_packages_RedHat.yml └── main.yml ├── handlers └── main.yml ├── LICENSE ├── files └── scripts │ ├── caseofmondays.coffee │ ├── dogatcomputer.coffee │ └── ignoreme.coffee ├── playbook.yml ├── .travis.yml ├── CONTRIBUTORS.md ├── CHANGELOG.md ├── defaults └── main.yml └── README.md /version.txt: -------------------------------------------------------------------------------- 1 | v1.8.1 2 | -------------------------------------------------------------------------------- /tests/inventory: -------------------------------------------------------------------------------- 1 | localhost -------------------------------------------------------------------------------- /templates/hubot-scripts.json.j2: -------------------------------------------------------------------------------- 1 | {{ hubot_scripts | to_nice_json }} 2 | -------------------------------------------------------------------------------- /templates/external-scripts.json.j2: -------------------------------------------------------------------------------- 1 | {{ hubot_external_scripts | to_nice_json }} -------------------------------------------------------------------------------- /tests/test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: localhost 3 | remote_user: root 4 | become: yes 5 | become_user: root 6 | roles: 7 | - ansible-hubot 8 | -------------------------------------------------------------------------------- /tests/test_hubot.py: -------------------------------------------------------------------------------- 1 | def test_hubot_running_and_enabled(Service): 2 | hubot = Service("hubot") 3 | assert hubot.is_running 4 | assert hubot.is_enabled 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .bundle 2 | .cache 3 | .DS_Store 4 | .molecule 5 | .vagrant 6 | *.retry 7 | cs 8 | hosts 9 | meta/.galaxy_install_info 10 | node_modules 11 | npm-debug.log 12 | yobot.yml 13 | site_lt.yml 14 | -------------------------------------------------------------------------------- /examples/vagrant_hosts: -------------------------------------------------------------------------------- 1 | # 2 | # File: vagrant_hosts - Inventory file for Hubot role on Vagrant VM 3 | 4 | [hubot] 5 | 10.1.1.42 hubot_admin=vagrant ansible_ssh_user=vagrant ansible_ssh_private_key_file=./.vagrant/machines/hubot/virtualbox/private_key 6 | -------------------------------------------------------------------------------- /templates/hubot.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Hubot 3 | 4 | [Service] 5 | EnvironmentFile={{ hubot_dir }}/{{ hubot_identity }}.env 6 | User={{ hubot_admin }} 7 | ExecStart={{ hubot_dir }}/bin/start-hubot 8 | 9 | [Install] 10 | WantedBy=multi-user.target 11 | -------------------------------------------------------------------------------- /templates/hubot.env.j2: -------------------------------------------------------------------------------- 1 | # 2 | # File: hubot.env - Hubot variables for HipChat and more 3 | # 4 | 5 | {% for key, value in hubot_env.iteritems() -%} 6 | {{ key }}={{ value }} 7 | {% endfor %} 8 | 9 | export {% for key, value in hubot_env.iteritems() -%}{{ key }}{{- ' ' if not loop.last else '' }}{% endfor %} 10 | -------------------------------------------------------------------------------- /templates/hubot.conf.j2: -------------------------------------------------------------------------------- 1 | # 2 | # File: hubot.conf - Upstart configuration script for Hubot 3 | # 4 | # FIXME: This could use some improvement 5 | 6 | description "hubot" 7 | 8 | start on filesystem or runlevel [2345] 9 | stop on runlevel [!2345] 10 | respawn 11 | respawn limit 5 60 12 | 13 | script 14 | exec sudo -i -u {{ hubot_admin }} {{ hubot_dir }}/bin/start-hubot 15 | end script 16 | -------------------------------------------------------------------------------- /molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: molecule.yml - Molecule role testing 3 | 4 | ansible: 5 | config_file: .molecule/ansible.cfg 6 | 7 | vagrant: 8 | platforms: 9 | - name: trusty64 10 | box: ubuntu/trusty64 11 | - name: centos7 12 | box: centos/7 13 | 14 | providers: 15 | - name: virtualbox 16 | type: virtualbox 17 | 18 | instances: 19 | - name: brianshumate-hubot-01 20 | -------------------------------------------------------------------------------- /meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: Brian Shumate 4 | description: "Role for Hubot, a delightful chat bot" 5 | company: 6 | license: Apache 2 7 | min_ansible_version: 1.9 8 | platforms: 9 | - name: EL 10 | versions: 11 | - 6 12 | - 7 13 | - name: Ubuntu 14 | versions: 15 | - precise 16 | - quantal 17 | - raring 18 | - saucy 19 | - trusty 20 | galaxy_tags: 21 | - networking 22 | dependencies: [] 23 | -------------------------------------------------------------------------------- /templates/start-hubot.sh.j2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # File: start-hubot.sh.j2 - A startup script template for Hubot 4 | # 5 | 6 | # Start Hubot in the background 7 | 8 | source {{ hubot_nvm_dir }}/nvm.sh 9 | nvm use {{ hubot_node_version }} 10 | 11 | cd {{ hubot_dir }} 12 | source {{ hubot_identity }}.env 13 | 14 | bin/hubot --adapter {{ hubot_adapter }} {% if hubot_alias is defined %}--alias {{ hubot_alias }} {% endif %}>> {{ hubot_dir }}/log/hubot.log 2>&1 15 | -------------------------------------------------------------------------------- /examples/hosts.example: -------------------------------------------------------------------------------- 1 | # 2 | # File: hosts - Inventory file for Hubot role 3 | # 4 | # NB: Change '0.0.0.0' to appropriate hostname or IP address of Hubot server 5 | # Note that the private key reference and localhost entry are required for 6 | # EC2 instance use 7 | 8 | [localhost] 9 | 127.0.0.1 ansible_python_interpreter=~/.virtualenvs/ansible/bin/python 10 | 11 | [hubot] 12 | 0.0.0.0 hubot_admin=ubuntu ansible_ssh_user=ubuntu ansible_ssh_private_key_file=~/.ssh/hubot_id 13 | -------------------------------------------------------------------------------- /tasks/install_packages_Debian.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: tasks/install_packages_Debian.yml - OS packages for Debian 3 | 4 | - name: Install Debian packages 5 | become: True 6 | become_user: root 7 | apt: name={{ item }} state=present update_cache=yes cache_valid_time=86400 8 | with_items: 9 | - build-essential 10 | - curl 11 | - expat 12 | - git 13 | - libicu-dev 14 | - openssl 15 | - redis-server 16 | 17 | - set_fact: 18 | redis_server: redis-server 19 | -------------------------------------------------------------------------------- /handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File handlers/main.yml Handlers for Hubot role 3 | 4 | - name: enable hubot 5 | become: True 6 | become_user: root 7 | service: name=hubot enabled=true 8 | 9 | - name: restart hubot 10 | become: True 11 | become_user: root 12 | service: name=hubot state=restarted 13 | 14 | - name: start hubot 15 | become: True 16 | become_user: root 17 | service: name=hubot state=started 18 | 19 | - name: stop hubot 20 | become: True 21 | become_user: root 22 | service: name=hubot state=stopped 23 | -------------------------------------------------------------------------------- /examples/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: site.yml - Hubot playbook for Vagrant based instance 3 | 4 | - name: Hubot special variables 5 | hosts: hubot 6 | 7 | - name: Hubot activate! 8 | hosts: hubot 9 | gather_facts: True 10 | become: True 11 | become_user: root 12 | roles: 13 | - { role: brianshumate.hubot, 14 | hubot_adapter: slack, 15 | hubot_admin: vagrant, 16 | hubot_owner: "'Stephie Andretti '", 17 | hubot_identity: griptape, 18 | hubot_description: Awesomeness 19 | } 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | ansible-hubot 2 | 3 | Copyright 2014 Brian Shumate 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | -------------------------------------------------------------------------------- /files/scripts/caseofmondays.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Looks like someone has a case of the Mondays 3 | # 4 | # Dependencies: 5 | # None 6 | # 7 | # Configuration: 8 | # None 9 | # 10 | # Commands: 11 | # hubot case of the mondays 12 | # 13 | # Notes: 14 | # "No. No, man. Shit no, man. I believe you'd get your ass kicked sayin' 15 | # something like that, man." 16 | # 17 | # Author: 18 | # Brian Shumate 19 | 20 | mondays = [ 21 | "http://i.imgur.com/8n4hlQE.jpg" 22 | ] 23 | 24 | module.exports = (robot) -> 25 | robot.hear /case of the mondays/i, (msg)-> 26 | msg.send msg.random mondays 27 | -------------------------------------------------------------------------------- /files/scripts/dogatcomputer.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Displays a "I Have No Idea What I'm Doing" image 3 | # 4 | # Dependencies: 5 | # None 6 | # 7 | # Configuration: 8 | # None 9 | # 10 | # Commands: 11 | # hubot no idea 12 | # 13 | # Notes: 14 | # No idea... 15 | # 16 | # Author: 17 | # Brian Shumate 18 | 19 | noidea = "http://i.imgur.com/hmTeehN.jpg" 20 | 21 | module.exports = (robot) -> 22 | robot.hear /(dunno|I don\'t know|beats me|no idea)/i, (msg)-> 23 | r = Math.random() 24 | if r <= 0.10 25 | msg.send noidea 26 | 27 | robot.respond /dunno|I don\'t know|beats me|no idea/i, (msg) -> 28 | msg.send noidea 29 | -------------------------------------------------------------------------------- /playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: test_playbook.yml - Test playbook 3 | 4 | - name: Test the hubot role 5 | hosts: all 6 | vars: 7 | # Hubot. 8 | hubot_admin: hubot 9 | hubot_adapter: hipchat 10 | hubot_owner: "'Rémy Greinhofer '" 11 | hubot_description: 'A stunning mermaid bot...Wait, WHAT...' 12 | 13 | hubot_env: 14 | # General Hubot stuff 15 | HUBOT_LOG_LEVEL: "debug" 16 | 17 | hubot_external_scripts: 18 | - hubot-help 19 | - hubot-calculator 20 | 21 | pre_tasks: 22 | # Ensure there is a hubot user. 23 | - user: name="{{ hubot_admin }}" comment="Hubot admin user" 24 | 25 | roles: 26 | - ansible-hubot 27 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: python 3 | python: "2.7" 4 | 5 | # Use the new container infrastructure 6 | sudo: false 7 | 8 | # Install ansible 9 | addons: 10 | apt: 11 | packages: 12 | - python-pip 13 | 14 | install: 15 | # Install ansible 16 | - pip install ansible 17 | 18 | # Check ansible version 19 | - ansible --version 20 | 21 | # Create ansible.cfg with correct roles_path 22 | # - printf '[defaults]\nroles_path=../' > ansible.cfg 23 | 24 | script: 25 | # Basic role syntax check 26 | - ANSIBLE_ROLES_PATH=.. ansible-playbook -i tests/inventory tests/test.yml --syntax-check 27 | 28 | notifications: 29 | webhooks: https://galaxy.ansible.com/api/v1/notifications/ 30 | 31 | -------------------------------------------------------------------------------- /files/scripts/ignoreme.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Displays Venture Bros IGNORE ME! image 3 | # 4 | # Dependencies: 5 | # None 6 | # 7 | # Configuration: 8 | # None 9 | # 10 | # Commands: 11 | # hubot ignore me 12 | # 13 | # Notes: 14 | # None 15 | # 16 | # Author: 17 | # Brian Shumate 18 | 19 | ignore = [ 20 | "http://3.bp.blogspot.com/-DFLMK7ffcJM/Tbjn752gOFI/AAAAAAAAAsk/qa7D5ZdQDgM/s1600/1301856749331.jpg", 21 | "http://venturebrosblog.com/wp-content/uploads/2011/02/venture-bros-ignore-me1.jpg", 22 | "http://memedepot.com/uploads/2000/2159_1272950412470.jpg" 23 | ] 24 | 25 | module.exports = (robot) -> 26 | robot.hear /ignore me/i, (msg)-> 27 | msg.send msg.random ignore 28 | -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | # CONTRIBUTORS 2 | 3 | ``` 4 | ________ _____ _ ____ ______ __ 5 | /_ __/ // / _ | / |/ / //_/ __/ / / 6 | / / / _ / __ |/ / ,< _\ \ /_/ 7 | /_/ /_//_/_/ |_/_/|_/_/|_/___/ (_) 8 | ``` 9 | 10 | Much thanks to these fine folks for contributing to the role: 11 | 12 | * [Mikko Ohtamaa](https://github.com/miohtama) 13 | * [Galaczi Endre Elek](https://github.com/chiller) 14 | * [Joe Stewart](https://github.com/joestewart) 15 | * [Rémy Greinhofer](https://github.com/rgreinho) 16 | * [Craig R Webster](https://github.com/craigw) 17 | * [Emanuelis](https://github.com/emanuelis) 18 | 19 | If you want to contribute, please file an issue or pull request at the 20 | [GitHub project repository](https://github.com/brianshumate/ansible-hubot) 21 | -------------------------------------------------------------------------------- /tasks/install_packages_RedHat.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: tasks/install_packages_RedHat.yml - OS packages for Red Hat 3 | 4 | - name: Install EPEL repo. 5 | become: True 6 | become_user: root 7 | yum: 8 | name: "{{ epel_repo_url }}" 9 | state: present 10 | register: result 11 | until: '"failed" not in result' 12 | retries: 5 13 | delay: 10 14 | when: ansible_pkg_mgr == 'yum' 15 | 16 | - name: Import EPEL GPG key 17 | become: True 18 | become_user: root 19 | rpm_key: 20 | key: "{{ epel_repo_gpg_key }}" 21 | state: present 22 | 23 | - name: install Development tools package group 24 | become: True 25 | become_user: root 26 | yum: name="@Development tools" state=present 27 | when: ansible_pkg_mgr == 'yum' 28 | changed_when: False 29 | 30 | - name: Install RedHat packages 31 | become: True 32 | become_user: root 33 | yum: name={{ item }} state=present 34 | when: ansible_pkg_mgr == 'yum' 35 | with_items: 36 | - curl 37 | - git 38 | - libicu-devel 39 | - libselinux-python 40 | - openssl-devel 41 | - expat-devel 42 | - redis 43 | 44 | - set_fact: 45 | redis_server: redis 46 | -------------------------------------------------------------------------------- /examples/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # Vagrantfile for bootstrapping a Hubot instance on Mac OS X with Vagrant 5 | # provider and Ansible provisioiner on Ubuntu virtual machine 6 | 7 | VAGRANTFILE_API_VERSION = "2" 8 | BOX_MEM = ENV['BOX_MEM'] || "1536" 9 | BOX_NAME = ENV['BOX_NAME'] || "ubuntu/trusty64" 10 | BOT_HOST = ENV['BOT_HOST'] || "vagrant_hosts" 11 | PLAYBOOK = ENV['PLAYBOOK'] || "site.yml" 12 | 13 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 14 | config.vm.define :hubot do |hubot_config| 15 | hubot_config.vm.box = BOX_NAME 16 | hubot_config.vm.network :private_network, ip: "10.1.1.42" 17 | hubot_config.vm.hostname = "hubot.local" 18 | hubot_config.ssh.forward_agent = true 19 | hubot_config.vm.provider "virtualbox" do |v| 20 | v.name = "hubot" 21 | v.customize ["modifyvm", :id, "--memory", BOX_MEM] 22 | v.customize ["modifyvm", :id, "--ioapic", "on"] 23 | v.customize ["modifyvm", :id, "--cpus", "1"] 24 | v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] 25 | v.customize ["modifyvm", :id, "--natdnsproxy1", "on"] 26 | end 27 | hubot_config.vm.provision :ansible do |ansible| 28 | ansible.inventory_path = BOT_HOST 29 | ansible.playbook = PLAYBOOK 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /templates/hubot.init.j2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # couchbot 3 | # chkconfig: 345 20 80 4 | # description: hubot 5 | # processname: hubot 6 | 7 | DAEMON={{ hubot_dir }}/bin/start-hubot 8 | NAME={{ hubot_identity }} 9 | USER={{ hubot_admin }} 10 | DESC={{ hubot_identity }} 11 | LOG=/var/log/hubot.log 12 | PIDFILE=/var/run/$NAME.pid 13 | SCRIPTNAME=/etc/init.d/$NAME 14 | 15 | case "$1" in 16 | start) 17 | printf "%-50s" "Starting $DESC..." 18 | if [ ! -e $LOG ]; then touch $LOG && chown {{ hubot_admin }} $LOG 19 | fi 20 | source {{ hubot_dir }}/{{ hubot_identity }}.env 21 | PID=`runuser -c "$DAEMON" - $USER >> $LOG 2>&1 & echo $!` 22 | echo "Saving PID" $PID " to " $PIDFILE 23 | if [ -z $PID ]; then 24 | printf "%s\n" "Fail" 25 | else 26 | echo $PID > $PIDFILE 27 | printf "%s\n" "Ok" 28 | fi 29 | ;; 30 | status) 31 | printf "%-50s" "Checking $DESC..." 32 | if [ -f $PIDFILE ]; then 33 | PID=`cat $PIDFILE` 34 | if [ -z "`ps axf | grep ${PID} | grep -v grep`" ]; then 35 | printf "%s\n" "Process dead but pidfile exists" 36 | else 37 | echo "Running" 38 | fi 39 | else 40 | printf "%s\n" "Service not running" 41 | fi 42 | ;; 43 | stop) 44 | printf "%-50s" "Stopping $DESC" 45 | PID=`cat $PIDFILE` 46 | if [ -f $PIDFILE ]; then 47 | kill $PID 48 | printf "%s\n" "Ok" 49 | rm -f $PIDFILE 50 | else 51 | printf "%s\n" "pidfile not found" 52 | fi 53 | ;; 54 | 55 | restart) 56 | $0 stop 57 | $0 start 58 | ;; 59 | 60 | *) 61 | echo "Usage: $0 {status|start|stop|restart}" 62 | exit 1 63 | esac 64 | -------------------------------------------------------------------------------- /examples/README_VAGRANT.md: -------------------------------------------------------------------------------- 1 | # Ansible Hubot with Vagrant 2 | 3 | This is a role for [Hubot](http://hubot.github.com/), the wonderful chatting 4 | robot that is sure to bring your team much delight and various values of 5 | increased productivity. 6 | 7 | This Hubot role connects to Slack by default, but it can also connect to 8 | HipChat by editing `examples/site.yml`, updating the value of 9 | *hubot_adapter*, and editing the appropriate HipChat environment variables in 10 | `defaults/main.yml`. 11 | 12 | ## Requirements 13 | 14 | This Hubot role requires a Debian or RHEL based Linux host and is tested to 15 | function on Ubuntu with the following specific software versions: 16 | 17 | * Ansible: 2.2.0.0 18 | * VirtualBox: 5.1.10 19 | * Vagrant: 1.9.0 20 | * Hubot: GitHub Master 21 | * Node.js: 6.9.1 22 | * CentOS/RHEL 6 23 | * Ubuntu: 14.04, 13.10, 13.04, 12.10, 12.04 24 | 25 | ## Hubot Acclimate! 26 | 27 | Follow these directions for a Hubot development deployment on an Ubuntu 28 | virtual machine with VirtualBox and Vagrant. 29 | 30 | Ensure the following are installed: 31 | 32 | * [VirtualBox](https://www.virtualbox.org/) 33 | * [Vagrant](http://www.vagrantup.com/) 34 | * [Ansible](http://www.ansibleworks.com/docs/intro_installation.html) 35 | 36 | These tools are optional, but highly recommended: 37 | 38 | * [Virtualenv](http://www.virtualenv.org/) 39 | * [Virtualenv Wrapper](https://bitbucket.org/dhellmann/virtualenvwrapper/) 40 | 41 | ### Hubot Configurate! 42 | 43 | Visit the variables defined in `defaults/main.yml` for minimal configuration: 44 | 45 | You can find more information in the main project [README](README.md) 46 | about these variables. 47 | 48 | Update the `examples/site.yml` playbook if you plan to use it and set 49 | the following values: 50 | 51 | * `hubot_adapter`: Adapter for your chat service (default is 'slack') 52 | * `hubot_admin`: Operating system username of your bot owner 53 | * `hubot_owner`: Hubot admin, ex: ("'Stephie Andretti '") 54 | * `hubot_identity`: Short username for your bot 55 | * `hubot_description`: A description for your bot 56 | 57 | ### Hubot Activate! 58 | 59 | After configuring your Hubot's environment variables, you should be able to 60 | bootstrap the bot using a virtualenv with commands like following: 61 | 62 | ``` 63 | mkvirtualenv ansible 64 | pip install ansible 65 | cd ANSIBLE_ROLES_PATH/brianshumate.hubot/examples 66 | vagrant up 67 | ``` 68 | 69 | If you'd prefer to install on CentOS, you can specify a different Vagrant 70 | box as an environment variable like so: 71 | 72 | ``` 73 | mkvirtualenv ansible 74 | pip install ansible 75 | cd ANSIBLE_ROLES_PATH/brianshumate.hubot/examples 76 | BOX_NAME="chef/centos-6.5" vagrant up 77 | ``` 78 | 79 | **NOTE**: `ANSIBLE_ROLES_PATH` above refers to the path to your Ansible 80 | roles directory. 81 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ##v1.0.0 2 | 3 | - Updated tasks with more npm module usage 4 | - Updated documentation 5 | 6 | ##v1.0.1 7 | 8 | - Accept GitHub host key for now until a better way is determined 9 | 10 | ## v1.0.2 11 | 12 | - Revert lost npm module usage 13 | 14 | ## v1.0.3 15 | 16 | - Revert accept host key 17 | 18 | ## v1.0.4 19 | 20 | - Fix directory ownership issues 21 | - Added missing files scripts 22 | - Documentation updates 23 | 24 | ## v1.0.5 25 | 26 | - Updated tested software versions 27 | - Updated documentation 28 | 29 | ## v1.0.6 30 | 31 | - Updated tested software versions 32 | - Updated documentation 33 | 34 | ## v1.1.0 35 | 36 | - Support for new Hubot Yeoman deployment method 37 | - Using hashicorp/precise64 box for vagrant builds 38 | - Tasks cleanup 39 | - Updated supported versions 40 | - Updated documentation 41 | 42 | ## v1.2.0 43 | 44 | - Added initial support for RHEL/CentOS for brianshumate/ansible-hubot/issues/2 45 | - Updated documentation 46 | 47 | ## v1.2.1 48 | 49 | - Tidied external scripts 50 | - Added slack variable 51 | - Updated documentation 52 | 53 | ## v1.2.2 54 | 55 | - Fixed external scripts 56 | - Moved additional script collection to private variables 57 | - Updated documentation 58 | 59 | ## v1.2.3 60 | 61 | - Fixed custom scripts variable inclusion 62 | - Updated documentation 63 | 64 | ## v1.2.4 65 | 66 | - Use generator-hubot release 0.2.0 67 | 68 | ## v1.2.5 69 | 70 | - Install NVM to expected directory (`~/.nvm`) 71 | - Updated documentation 72 | 73 | ## v1.2.6 74 | 75 | - Updated documentation 76 | 77 | ## v1.2.7 78 | 79 | - Update Vagrantfile 80 | 81 | ## v1.2.8 82 | 83 | - Updated for new private_key location 84 | - Switch to ansible_os_distribution variable 85 | - Rename tasks 86 | - Update documentation 87 | - Minimal hubot_custom_scripts variable (hi RMS) 88 | 89 | ## v1.2.9 90 | 91 | - Ubuntu 14.04 92 | - Updated documentation 93 | 94 | ## v1.2.10 95 | 96 | - Stop service before decommission task 97 | - Update versions 98 | - Update documentation 99 | 100 | ## v1.2.11 101 | 102 | - Updated documentation 103 | 104 | ## v1.3.0 105 | 106 | - Add Slack support 107 | - Default adapter changed to 'slack' 108 | - Prefer "private" (files) first for inclusion 109 | - Update variables 110 | - Update documentation 111 | - Clean up cruft 112 | 113 | ## v1.4.0 114 | 115 | - Move all variables to defaults (thanks, @joestewart!) 116 | - Simplify startup script (thanks, @joestewart!) 117 | - Generate external scripts (thanks, @joestewart!) 118 | - Updated docs 119 | 120 | ## v1.5.0 121 | 122 | - Refactor the tasks to avoid duplicated 123 | - Make the role idempotent 124 | - Execute the tasks with the appropriate user 125 | - Make the role testable with molecule 126 | - Update the docs 127 | 128 | ## v1.5.1 129 | 130 | - Enable some Hubot scripts to provide a minimum of out-of-the-box 131 | functionality since their dependencies are being installed already 132 | - Fix some typos 133 | - Update documentation 134 | 135 | ## v1.5.2 136 | 137 | - More docs updates regarding default scripts 138 | 139 | ## v1.5.3 140 | 141 | - Merge feature to allow for git checkouts of scripts (thanks @joestewart ) 142 | - Update some variables 143 | - Update documentation about git checkout scripts 144 | 145 | ## v1.6.0 146 | 147 | - Use become / become_user 148 | - Install init script as root on Red Hat (thanks @craigw) 149 | - Cleanup Hubot scripts (thanks @craigw) 150 | - YAML file headings 151 | 152 | ## v1.6.1 153 | 154 | - Ensure service is started at end of tasks (thanks @emanuelis) 155 | - Add systemd unit (thanks @emanuelis) 156 | - Additional node modules 157 | - Use become 158 | - Make playbook filename a variable in Vagrantfile 159 | 160 | ## v1.6.2 161 | 162 | - Ensure service is restarted after environment changes (thanks @emanuelis) 163 | 164 | ## v1.6.3 165 | 166 | - More granular admin user directory variables 167 | - Become user fix 168 | - Updated documentation 169 | 170 | ## v1.7.0 171 | 172 | - Update to Node 4.x 173 | - Remove all scripts which do not have packaged versions 174 | - Remove deprecated hubot-scripts.json functionality and variables 175 | - Update documentation 176 | 177 | ## v1.7.1 178 | 179 | - Remove hubot-scripts package (it was breaking startup) 180 | - More defaults cleanup 181 | - Fix contributors page 182 | - Clean up custom scripts - with hubot_custom_scripts == true all scripts in 183 | files/scripts will be installed as well 184 | 185 | ## v1.7.2 186 | 187 | - Fix bare variable issue 188 | - Fix custom scripts 189 | 190 | ## v1.7.3 191 | 192 | - Fix more bare variable issues 193 | 194 | ## v1.8.0 195 | 196 | - Update Node version 197 | - Update tested dependency versions 198 | - Add metrics 199 | - Workaround issue with Ansible npm module [GH-2128] 200 | - Update README 201 | 202 | ## v1.8.1 203 | 204 | - Add initial tests / Travis 205 | -------------------------------------------------------------------------------- /defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: defaults/main.yml - Ansible Hubot default variables 3 | 4 | ############################################################################# 5 | # 6 | # hubot_admin: User account that will run the bot; for 7 | # operating in development mode with Vagrant, 8 | # this value should be "vagrant". 9 | # hubot_adapter: Supported adapters ('slack' or 'hipchat') 10 | # hubot_node_version: Node.js version to use 11 | # hubot_dir: Bot home directory 12 | # hubot_nvm_dir: Node Version Manager installation root directory 13 | # hubot_node_dir: Node.js installation root directory 14 | # hubot_global_node_packages: Global Node.js dependencies 15 | # hubot_all_dirs: List of directories owned by Hubot admin user 16 | # hubot_env: Environment variables for Hubot adapters 17 | ############################################################################# 18 | 19 | hubot_admin: vagrant 20 | 21 | hubot_adapter: slack 22 | 23 | hubot_node_version: 6.9.1 24 | 25 | hubot_admin_dir: "/home/{{ hubot_admin }}" 26 | 27 | hubot_dir: "{{ hubot_admin_dir }}/hubot" 28 | 29 | hubot_nvm_dir: "{{ hubot_admin_dir }}/.nvm" 30 | 31 | hubot_node_dir: "{{ hubot_nvm_dir }}/versions/node/v{{ hubot_node_version }}" 32 | 33 | hubot_global_node_packages: 34 | - coffee-script 35 | - yo 36 | - generator-hubot 37 | 38 | hubot_all_dirs: 39 | - "{{ hubot_dir }}" 40 | - "{{ hubot_nvm_dir }}" 41 | - "{{ hubot_admin_dir }}/.npm" 42 | 43 | hubot_env: 44 | # General Hubot stuff 45 | # HUBOT_AUTH_ADMIN: "FIXME" # Replace with hubot admin username 46 | HUBOT_LOGLEVEL: "info" 47 | 48 | # HipChat stuff 49 | # HUBOT_HIPCHAT_DEBUG: "FIXME" # Replace with boolean value 50 | # HUBOT_HIPCHAT_TOKEN: "FIXME" # Replace with HipChat auth token 51 | # HUBOT_HIPCHAT_JID: "FIXME" # Replace with HipChat Jabber ID 52 | # HUBOT_HIPCHAT_NAME: "FIXME" # Replace with HipChat user name 53 | # HUBOT_HIPCHAT_PASSWORD: "FIXME" # Replace with HipChat password 54 | # HUBOT_HIPCHAT_ROOMS: "FIXME" # Comma separated list of rooms to join 55 | # HUBOT_HIPCHAT_JOIN_ROOMS_ON_INVITE: "FIXME" # Replace with boolean value 56 | 57 | # Slack variables 58 | HUBOT_SLACK_TOKEN: "FIXME" 59 | 60 | # Weather stuff 61 | # HUBOT_WUNDERGROUND_API_KEY: "FIXME" # Replace with Wunderground API key 62 | 63 | ############################################################################# 64 | # 65 | # hubot_identity: Bot user name 66 | # hubot_description: Description of bot 67 | # hubot_owner: Name of bot owner 68 | # hubot_node_packages: Node.js dependencies 69 | # 70 | ############################################################################# 71 | 72 | hubot_identity: hubot 73 | 74 | hubot_owner: "'Stephie Andretti '" 75 | 76 | hubot_description: "'A helpful chat robot'" 77 | 78 | hubot_node_packages: 79 | - cheerio 80 | - chrono-node 81 | - clark 82 | - htmlparser 83 | - hubot-ascii-art 84 | - hubot-coin 85 | - hubot-calculator 86 | - hubot-{{ hubot_adapter }} 87 | - hubot-redis-brain 88 | - hubot-xkcd 89 | - hubot-youtube 90 | - lodash 91 | - moment 92 | - nodepie 93 | - soupselect 94 | - textspark 95 | 96 | ############################################################################# 97 | # 98 | # external_scripts: A list of additional Hubot scripts to use 99 | # 100 | ############################################################################# 101 | 102 | hubot_external_scripts: 103 | - hubot-ascii-art 104 | - hubot-coin 105 | - hubot-help 106 | - hubot-redis-brain 107 | - hubot-xkcd 108 | - hubot-youtube 109 | 110 | ############################################################################# 111 | # 112 | # hubot_custom_scripts: List of scripts from files/scripts to install 113 | # 114 | ############################################################################# 115 | 116 | # hubot_custom_scripts: 117 | # - caseofmondays.coffee 118 | # - dogatcomputer.coffee 119 | # - ignoreme.coffee 120 | 121 | ############################################################################# 122 | # 123 | # hubot_external_git_scripts: A list of additional Hubot scripts to 124 | # check out from git repositories 125 | ############################################################################# 126 | 127 | # hubot_external_git_scripts: 128 | # - { name: hubot-jenkins-userauth, repo_url: "https://github.com/joestewart/hubot-jenkins-userauth.git" } 129 | 130 | # EPEL repository URL 131 | epel_repo_url: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm" 132 | 133 | # EPEL repository GPG key 134 | epel_repo_gpg_key: "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}" 135 | -------------------------------------------------------------------------------- /tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: tasks/main.yml - Main tasks for ansible-hubot 3 | 4 | - include: install_packages_Debian.yml 5 | become: True 6 | become_user: root 7 | tags: package 8 | when: "ansible_os_family == 'Debian'" 9 | 10 | - include: install_packages_RedHat.yml 11 | become: True 12 | become_user: root 13 | tags: package 14 | when: "ansible_os_family == 'RedHat'" 15 | 16 | - name: Install Node Version Manager 17 | become: True 18 | become_user: "{{ hubot_admin }}" 19 | git: 20 | repo: https://github.com/creationix/nvm.git 21 | dest: "{{ hubot_nvm_dir }}" 22 | accept_hostkey: True 23 | tags: 24 | - node_nvm 25 | 26 | - name: Install Node.js 27 | become: True 28 | become_user: "{{ hubot_admin }}" 29 | shell: "source {{ hubot_nvm_dir }}/nvm.sh && nvm install {{ hubot_node_version }}" 30 | args: 31 | creates: "{{ hubot_node_dir }}" 32 | executable: /bin/bash 33 | changed_when: False 34 | tags: 35 | - node_packages 36 | 37 | # FIXME 38 | # This is now broken due to: 39 | # https://github.com/ansible/ansible-modules-extras/issues/2128 40 | # 41 | # - name: Install hubot global dependencies 42 | # become: True 43 | # become_user: "{{ hubot_admin }}" 44 | # npm: 45 | # name: "{{ item }}" 46 | # executable: "{{ hubot_node_dir }}/bin/npm" 47 | # path: "{{ hubot_dir }}" 48 | # state: present 49 | # global: yes 50 | # with_items: "{{ hubot_global_node_packages }}" 51 | # tags: 52 | # - node_packages 53 | 54 | # Doing things the hard way™ until above is fixed 55 | - name: Install hubot global dependencies 56 | become: True 57 | become_user: "{{ hubot_admin }}" 58 | shell: "source {{ hubot_nvm_dir }}/nvm.sh && nvm use {{ hubot_node_version }} && npm i -g {{ item }}" 59 | args: 60 | executable: /bin/bash 61 | with_items: "{{ hubot_global_node_packages }}" 62 | tags: 63 | - node_packages 64 | 65 | - name: Hubot home 66 | file: "path={{ hubot_dir }} state=directory owner={{ hubot_admin }}" 67 | 68 | - name: Assemble Hubot 69 | become: True 70 | become_user: "{{ hubot_admin }}" 71 | shell: "source {{ hubot_nvm_dir }}/nvm.sh && nvm use {{ hubot_node_version }} && echo 'n' | yo hubot --adapter={{ hubot_adapter }} --owner={{ hubot_owner }} --name={{ hubot_identity }} --description={{ hubot_description }} --defaults chdir={{ hubot_dir }}" 72 | args: 73 | executable: /bin/bash 74 | changed_when: False 75 | 76 | # FIXME 77 | # This is now broken due to: 78 | # https://github.com/ansible/ansible-modules-extras/issues/2128 79 | # 80 | # - name: Install hubot Node dependencies 81 | # become: True 82 | # become_user: "{{ hubot_admin }}" 83 | # npm: 84 | # name: "{{ item }}" 85 | # executable: "{{ hubot_node_dir }}/bin/npm" 86 | # path: "{{ hubot_dir }}" 87 | # state: present 88 | # with_items: "{{ hubot_node_packages }}" 89 | # tags: 90 | # - node_packages 91 | 92 | # Doing things the hard way™ until above is fixed 93 | - name: Install hubot Node dependencies 94 | become: True 95 | become_user: "{{ hubot_admin }}" 96 | shell: "source {{ hubot_nvm_dir }}/nvm.sh && nvm use {{ hubot_node_version }} && npm i {{ item }}" 97 | args: 98 | executable: /bin/bash 99 | with_items: "{{ hubot_node_packages }}" 100 | tags: 101 | - node_packages 102 | 103 | - name: Define Hubot environment 104 | become: True 105 | become_user: "{{ hubot_admin }}" 106 | template: 107 | src: hubot.env.j2 108 | dest: "{{ hubot_dir }}/{{ hubot_identity }}.env" 109 | tags: 110 | - hubot_environment 111 | notify: 112 | - restart hubot 113 | 114 | - name: Install Hubot start script 115 | become: True 116 | become_user: "{{ hubot_admin }}" 117 | template: 118 | src: start-hubot.sh.j2 119 | dest: "{{ hubot_dir }}/bin/start-hubot" 120 | mode: "0744" 121 | 122 | - name: Install custom Hubot scripts 123 | become: False 124 | copy: 125 | src: "scripts/{{ item }}" 126 | dest: "{{ hubot_dir }}/scripts/{{ item }}" 127 | owner: "{{ hubot_admin }}" 128 | mode: "0644" 129 | with_items: "{{ hubot_custom_scripts }}" 130 | when: hubot_custom_scripts is defined 131 | notify: 132 | - restart hubot 133 | tags: 134 | - hubot_scripts 135 | 136 | - name: Install hubot external git scripts 137 | become: False 138 | git: "repo={{ item.repo_url }} version={{ item.version | default('master') }} dest={{ hubot_dir }}/node_modules/{{ item.name }}" 139 | with_items: "{{ hubot_external_git_scripts }}" 140 | when: hubot_external_git_scripts is defined 141 | notify: 142 | - restart hubot 143 | tags: 144 | - hubot_scripts 145 | 146 | - name: Configure Hubot external scripts 147 | become: True 148 | become_user: root 149 | template: 150 | src: external-scripts.json.j2 151 | dest: "{{ hubot_dir }}/external-scripts.json" 152 | owner: "{{ hubot_admin }}" 153 | group: "{{ hubot_admin }}" 154 | mode: "0644" 155 | when: hubot_external_scripts is defined 156 | notify: 157 | - restart hubot 158 | tags: hubot_scripts 159 | 160 | - name: Hubot log directory 161 | file: 162 | path: "{{ hubot_dir }}/log" 163 | state: directory 164 | owner: "{{ hubot_admin }}" 165 | group: "{{ hubot_admin }}" 166 | tags: 167 | - hubot_environment 168 | 169 | - name: Hubot home ownership 170 | become: True 171 | become_user: root 172 | file: 173 | path: "{{ item }}" 174 | owner: "{{ hubot_admin }}" 175 | group: "{{ hubot_admin }}" 176 | recurse: "yes" 177 | with_items: "{{ hubot_all_dirs }}" 178 | tags: 179 | - hubot_environment 180 | 181 | - name: Start Redis 182 | become: True 183 | become_user: root 184 | service: 185 | name: "{{ redis_server }}" 186 | state: started 187 | 188 | - name: Install service init script 189 | become: True 190 | become_user: root 191 | template: 192 | src: hubot.init.j2 193 | dest: /etc/init.d/hubot 194 | mode: "0755" 195 | when: (ansible_os_family == "RedHat" and ansible_distribution_major_version < "7") 196 | notify: 197 | - enable hubot 198 | - restart hubot 199 | 200 | - name: Install Upstart script 201 | become: True 202 | become_user: root 203 | template: 204 | src: hubot.conf.j2 205 | dest: /etc/init/hubot.conf 206 | mode: "0755" 207 | when: (ansible_os_family == "Debian" and ansible_distribution_major_version < "15") 208 | notify: 209 | - enable hubot 210 | - restart hubot 211 | tags: 212 | - hubot_service 213 | 214 | - name: Install systemd unit 215 | become: True 216 | become_user: root 217 | template: 218 | src: hubot.service.j2 219 | dest: /etc/systemd/system/hubot.service 220 | mode: "0755" 221 | when: (ansible_os_family == "Debian" and ansible_distribution_major_version >= "15") or 222 | (ansible_os_family == "RedHat" and ansible_distribution_major_version > "6") 223 | notify: 224 | - enable hubot 225 | - restart hubot 226 | tags: 227 | - hubot_service 228 | 229 | - name: Start Hubot 230 | service: name=hubot state=started 231 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ansible Hubot 2 | 3 | [![Build Status](https://travis-ci.org/brianshumate/ansible-hubot.svg?branch=master)](https://travis-ci.org/brianshumate/ansible-hubot) 4 | [![Ansible Galaxy](https://img.shields.io/badge/galaxy-brianshumate.consul-blue.svg)](https://galaxy.ansible.com/brianshumate/hubot/) 5 | [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/brianshumate/ansible-hubot.svg)](http://isitmaintained.com/project/brianshumate/ansible-hubot "Average time to resolve an issue") 6 | [![Percentage of issues still open](http://isitmaintained.com/badge/open/brianshumate/ansible-hubot.svg)](http://isitmaintained.com/project/brianshumate/ansible-hubot "Percentage of issues still open") 7 | 8 | This is an [Ansible](http://www.ansible.com/) role for 9 | [Hubot](http://hubot.github.com/), the wonderful chatting robot that is sure 10 | to bring your team much delight and various values of increased productivity 11 | throughout the livelong day! 12 | 13 | By default this Hubot role uses the Slack adapter, but you can change the 14 | role to work with another adapter like HipChat by editing `defaults/main.yml`, 15 | updating the value of *hubot_adapter*, and adding the appropriate environment 16 | variables to `defaults.main.yml` file. 17 | 18 | ## Requirements 19 | 20 | This role requires a Ubuntu or CentOS based Linux host; it's known to function 21 | on Ubuntu and CentOS with the following software versions: 22 | 23 | * Ansible: 2.2.0.0 24 | * Hubot: GitHub Master 25 | * Node.js: 6.9.1 26 | * CentOS: 6 27 | * Ubuntu: 14.04, 13.10, 13.04, 12.10, 12.04 28 | 29 | ## Works with Ansible Galaxy 30 | 31 | You can install this role with the `ansible-galaxy` command instead of 32 | running directly from the git repository. 33 | 34 | Install it like this: 35 | 36 | ``` 37 | ansible-galaxy install brianshumate.hubot 38 | ``` 39 | 40 | You'll want to make sure you have write access to `/etc/ansible/roles/` since 41 | that is the default installation path, or define your own Ansible role path by 42 | creating a `$HOME/.ansible.cfg` file with these contents: 43 | 44 | ``` 45 | [defaults] 46 | roles_path = 47 | ``` 48 | 49 | Change `` to a directory you have write 50 | access to. 51 | 52 | See the [ansible-galaxy](http://docs.ansible.com/galaxy.html) documentation 53 | for more details. 54 | 55 | ## Role Variables 56 | 57 | All role variables should be in `defaults/main.yml`. 58 | 59 | | Name | Default Value | Description | 60 | | -------------- | ------------- | -----------------------------------| 61 | | `hubot_admin` | vagrant | OS username of Hubot owner/admin | 62 | | `hubot_adapter` | slack | Preferred chat adapter to use | 63 | | `hubot_node_version` | 0.10.36 | Preferred Node.js version | 64 | | `hubot_dir` | path | Hubot base directory | 65 | | `hubot_nvm_dir` | path | Node Version Manager (nvm) installation directory | 66 | | `hubot_node_dir` | path | 67 | | `hubot_global_node_packages` | list | Node.js dependency packages to install globally | 68 | | `hubot_all_dirs` | list | Directories owned by Hubot admin user | 69 | | `hubot_env` | list | Environment variables for Hubot adapters | 70 | | `hubot_identity` | hubot | Bot user name | 71 | | `hubot_owner` | "'Stephie Andretti '" | Bot owner | 72 | | `hubot_description` | "'A helpful chat robot'" | Bot description| 73 | | `hubot_node_packages` | list | Node.js dependency packages to install | 74 | | `hubot_external_scripts` | list | External third-party Hubot scripts to use | 75 | | `hubot_external_git_scripts` | list | External third-party Hubot scripts to clone from Git repositories | 76 | | `hubot_custom_scripts` | list | Scripts to use from `files/scripts` directory | 77 | | `hubot_git_scripts` | list | Scripts to clone from Git repositories | 78 | | `epel_repo_gpg_key` | path | EPEL GPG key URL | 79 | | `epel_repo_url` | URL | EPEL repository URL | 80 | 81 | ## Node Packages 82 | 83 | The `hubot_node_packages` defines the following Node.js dependency packages: 84 | 85 | * cheerio 86 | * chrono-node 87 | * clark 88 | * htmlparser 89 | * hubot-ascii-art 90 | * hubot-coin 91 | * hubot-calculator 92 | * hubot-hipchat-emoticons 93 | * hubot-{{ hubot_adapter }} 94 | * hubot-redis-brain 95 | * hubot-scripts 96 | * hubot-xkcd 97 | * hubot-youtube 98 | * lodash 99 | * moment 100 | * nodepie 101 | * soupselect 102 | * textspark 103 | 104 | Note that newer Hubot scripts are now also node modules. 105 | 106 | The `hubot_centos_os_packages` and `hubot_ubuntu_os_packages` variables 107 | define OS packages required by Hubot; they should be fine as-is. 108 | 109 | The `hubot_os_packages` defines following OS dependency packages: 110 | 111 | * build-essential 112 | * curl 113 | * git-core 114 | * libssl-dev 115 | * libexpat1-dev 116 | * redis-server 117 | 118 | Redis required for redis brain functionality. 119 | 120 | ### Scripts 121 | 122 | You can enable more Hubot scripts by adding them to the 123 | `hubot_node_packages` and `hubot_external_scripts` variables. 124 | 125 | ## Configuration 126 | 127 | First, edit the variables defined in `defaults/main.yml` as necessary. 128 | 129 | Then, copy the necessary `templates/hubot_?.env.j2` to 130 | `templates/_hubot_?.env.j2` where *?* is your hubot_adapter value, and update 131 | as necessary with the particular environment variables you need 132 | for your Hubot instance. 133 | 134 | Copy `hosts.example` to `hosts` and edit it to update the values for your 135 | Hubot host. Be sure to change the following values: 136 | 137 | * `0.0.0.0` 138 | * `ubuntu` 139 | * `~/.ssh/hubot_id` 140 | 141 | Update the `site.yml` playbook if you plan to use it and set `hubot_identity` 142 | to the short user name of your bot. 143 | 144 | ## Example Playbook 145 | 146 | After configuration a basic Hubot installation and activation is possible 147 | using the included `site.yml` playbook: 148 | 149 | ``` 150 | ansible-playbook -i hosts site.yml 151 | ``` 152 | 153 | You can also pass variables in using the `--extra-vars` option 154 | to the `ansible-playbook` command: 155 | 156 | ``` 157 | ansible-playbook -i hosts site.yml --extra-vars "hubot_admin=penelope hubot_adapter=hipchat hubot_identity=penelope hubot_owner='Penelope ' hubot_description='A stunning mermaid bot'" 158 | ``` 159 | ## Test the role 160 | 161 | You can test the role with [Molecule](http://molecule.readthedocs.org/en/master/). 162 | 163 | The molecule configuration resides at the root of the role in the 164 | `molecule.yml` file. This role is tested against Ubuntu Trusty 64 and 165 | Centos 7, but you can add other platforms if needed. 166 | 167 | To setup the test environment run the following commands: 168 | 169 | ``` 170 | mkvirtualenv -p $(which python2) molecule 171 | pip install molecule ansible 172 | ``` 173 | 174 | To test the role run ``molecule test --platform trusty64`` or ``molecule test --platform centos7``. 175 | 176 | ## Dependencies 177 | 178 | None 179 | 180 | ## License 181 | 182 | Apache 2 183 | 184 | ## Author Information 185 | 186 | [Brian Shumate](http://brianshumate.com) 187 | 188 | ## Contributors 189 | 190 | See CONTIRBUTORS.MD 191 | --------------------------------------------------------------------------------