Beaker in a box

Beaker in a box provides a way of using Ansible to install and configure a complete working Beaker environment, including three virtual guests(VMs) to act as test systems. This guide assumes that you already have Ansible installed and working, also have a spare system capable of KVM virtualization with at least 4GB of RAM running on Fedora 21.

Package Prerequisites

  • ansible >= 2.0

Cloning the beaker-in-a-box repo

Start by cloning Beaker-in-a-box’s git repository:

git clone git://

Setting up Beaker

The playbook sets the entire environment in several steps:

  1. Defines virtual machines and a virtual network called beaker.
  2. Provisions the server and the lab controller as one virtual machine. SSH Keys between host and virtual machine are exchanged to easy access and control of test systems using virsh. Default root password used is beaker.
  3. Provisions the test machines and adds them as available resources to the lab controller/server.

Start the setup using Ansible by running:

ansible-playbook setup_beaker.yml --ask-become-pass


Beaker in a box is using static IP and mac addresses. Please make sure that those static IP and mac addresses do not collide with any other machines on the same network. Those static IP and mac addresses can be found in group_vars/beaker.

Customizing the provisioning

By default the server and lab controller VM is provisioned from a CentOS 6 HTTP URL. If you prefer to provision it from a different HTTP URL, run the playbook by passing variables on the command line which will overwrite the default.

For example, create a new YAML file extravars.yml:


It provides the netinstall URL and additional repositories the VM is provisioned with. Then run the playbook and include the file to the ansible-playbook command:

ansible-playbook setup_beaker.yml --ask-become-pass -e@extravars.yml

In the same fashion, you can add additional distros during the provisioning process by setting the user_distros variable. To illustrate this, here is an example:


This will add CentOS 6.8 as an additional distribution, among the ones already added by default, to provision test machines from.

Verifying the server installation

Visiting http://beaker-server-lc.beaker/bkr/ from your hosts systems’s browser should show the beaker systems page.

An easy way to schedule a job is by performing a system scan for one of your test systems. On the systems page, click on a system and navigate to the Details tab. Schedule a scan by clicking on the Scan button.

Configure the bkr client to use your local Beaker server (see Installing and configuring the client). You can run bkr whoami to check that is working.

Next steps

The playbook has already taken care of adding tasks, importing distros and adding systems, but for completeness we recommend reading the next sections to get a better understanding by proceeding to adding tasks, importing distros, adding systems, and running jobs.