scalebot ircbot #2

Supports: xenial bionic
Add to new model

Description

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.
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.


Configuration

extra_packages
(string) Space separated list of extra deb packages to install.
install_keys
(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.
install_sources
(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.
irc_auth_method
(string) IRC authentication method (server OR nickserv)
none
irc_botnick
(string) IRC bot-nickname
irc_channel
(string) IRC channel name, do not need to add "#"
irc_enable_ssl
(boolean) IRC SSL. Enable it for IRC server authentication (irc_auth_method)
irc_nick_to_alert
(string) IRC nickname to alert if any
irc_password
(string) IRC password if auth_method is server or nickserv
irc_port
(int) IRC server port number
6667
irc_server
(string) IRC server
package_status
(string) The status of service-affecting packages will be set to this value in the dpkg database. Valid values are "install" and "hold".
install
rabbitmq_port
(int) RabbitMQ-server port number
5672
rabbitmq_user
(string) RabbitMQ-server username
scalebot
rabbitmq_vhost
(string) RabbitMQ-server virtual host
/