GithubHelp home page GithubHelp logo

musicbot-ansible's Introduction

MusicBot Ansible Playbook

This Ansible playbook is used to install the excellent MusicBot bot for Discord onto a machine running Ubuntu 16.04 or Ubuntu 14.04. This is what I use to build the production MusicBot instance for Anthrocon's Discord Server. When the playbook is succesfully run, the machine will have the following:

  • A running copy of MusicBot
  • MusicBot configured as a service so that it will restart if the process dies or the machine is restarted
  • Performance metrics will be gathered every 5 minutes with Munin, available at http://hostname/munin/

Prerequisites (if using Vagrant)

If you want to set up a VM in Vagrant, you'll need to have that installed first. Once Vagrant is installed, run vagrant up to spin up a set of Ubuntu 16.04 and 14.04 VMs.

Prerequisites

Whether you're using Vagrant or not, here's what you'll need to take care of in order to use this Playbook:

  • Make sure Ansible is installed.
  • Copy inventory.example to inventory and your hosts under [production]
  • Copy roles/musicbot-config/files/example_options.ini to roles/musicbot-config/files/options.ini
  • Edit options.ini accordingly
  • Copy roles/musicbot-config/files/example_permissions.ini to roles/musicbot-config/files/permissions.ini
  • Edit permissions.ini accordingly

Prerequisites (if using Digital Ocean)

Digital Ocean VMs do not create a swapfile by default, and Ubuntu 16.04 does not include Python 2, which Ansible requires. As such, you'll need to run the Digital Ocean playbook first:

ansible-playbook ./digital-coean.yaml

...you will also need to make sure that you have ansible_user=root in your inventory for any Digital Ocean hosts.

Running Ansible

Now you're ready to run Ansible!

First, test that you can talk to all of your hosts:

ansible-playbook ./ping.yaml

You will need SSH access to talk to those hosts. If the ping playbook fails, you'll need to troubleshoot your connection, SSH keys, etc.

At this point, you should be good to run the musicbot playbook:

ansible-playbook ./musicbot.yaml

This will take a few minutes to run.

When complete, Musicbot will be installed as a service under systemd on Ubuntu 16.04. It will start when the machine starts and respawn if it crashes (or the process is killed). In fact, if configured properly, it should start playing in your Discord server shortly!

Known Issues

  • Because Nginx is a little weird with how it includes configurations, I ended up having to remove /etc/nginx/sites-enabled/default and replacing it with a configuration file of my own so that I can get the Munin graphs to work.
    I am completely open to any suggestions anyone might have on how to have configuration that doesn't require removing existing nginx configuration.
  • Don't try to install this on Ubuntu 12.04. Not all of the required libraries exist in repositories, at least from what I've been able to see. No guarantees are made for CentOS or any other Linux distro.

Authors

Just me: Douglas Muth. I can be reached via email (doug.muth AT gmail DOT com), and can also be found on Twitter, Facebook, and LinkedIn

musicbot-ansible's People

Contributors

dmuth avatar

Stargazers

Will Navidson avatar  avatar

Watchers

 avatar  avatar

Forkers

zya2d

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.