scalebot ircbot #5

Supports: xenial bionic


IRCbot and RabbitMQ-server consumer

The IRCbot charm was created by Canonical hyperscale team to listen to messages from a RabbitMQ-server instance and then show this messages in an IRC channel. IRCbot charm requires RabbitMQ-server charm. Its configuration has two parts, one related with IRCbot and other with RabbitMQ-server.

If you deploy each charm separately: $ juju deploy ~ce-hyperscale/scalebot-ircbot $ juju deploy rabbitmq-server

Then you need to add the relation between charms: juju add-relation rabbitmq-server scalebot-ircbot

The IRCbot charm will create a systemd unit called ircbot.service to run the IRCbot service. This service is responsible for staying connected to the IRC network and for joining a channel and then reading the messages from RabbitMQ-server and showing these messages formatted in IRC channel.

Where do the messages to RabbitMQ-server come from? We are using a Jenkins instance with the MQ-notifier plugin. The MQ-notifier plugin sends messages whenever a build is started and finished. IRCbot is creating a scalebot exchange and a scalebot queue and then binding the queue to the exchange with a routing_key scalebot. Add this configuration to the MQ-notifier plugin. It also sends a message when a build enters and leaves the queue (but these messages are ignored by IRCbot charm - we are just interested in knowing when the job started and when it finished - with success or failure status). If it fails, you can make your bot ping someone in IRC channel (irc_nick_to_alert config) and/or you can just add scalebot-jenkins-failure to be highlighted in your IRC client settings.

We tested this charm in both x86_64 and aarch64 architectures.


(string) Space separated list of extra deb packages to install.
(string) List of signing keys for install_sources package sources, per charmhelpers standard format (a yaml list of strings encoded as a string). The keys should be the full ASCII armoured GPG public keys. While GPG key ids are also supported and looked up on a keyserver, operators should be aware that this mechanism is insecure. null can be used if a standard package signing key is used that will already be installed on the machine, and for PPA sources where the package signing key is securely retrieved from Launchpad.
(string) List of extra apt sources, per charm-helpers standard format (a yaml list of strings encoded as a string). Each source may be either a line that can be added directly to sources.list(5), or in the form ppa:<user>/<ppa-name> for adding Personal Package Archives, or a distribution component to enable.
(string) IRC authentication method (server OR nickserv)
(string) IRC bot-nickname
(string) IRC channel name, do not need to add "#"
(boolean) IRC SSL. Enable it for IRC server authentication (irc_auth_method)
(string) IRC nickname to alert if any
(string) IRC password if auth_method is server or nickserv
(int) IRC server port number
(string) IRC server
(string) The status of service-affecting packages will be set to this value in the dpkg database. Valid values are "install" and "hold".
(int) RabbitMQ-server port number
(string) RabbitMQ-server username
(string) RabbitMQ-server virtual host