This covers how you can use the tooling provided by Forklift to spin up a production environment for real deployments or evaluation purposes. The tooling can spin up deployments automatically using Vagrant or be used on your virtual or bare metal machines.
The Vagrant configuration can currently run pointing at either a Libvirt or Virtualbox setup.
If you're using Linux, we recommend Libvirt. The default setup in the Vagrantfile is for VirtualBox. It has been tested against VirtualBox 4.2.18. To use Install VirtualBox from the 4.2 downloads page. Vagrant 1.6.5+ can be downloaded and installed from Vagrant Downloads
The Vagrantfile provides default setup and boxes for use with the vagrant-libvirt
provider. To set this up:
- Ensure you have Vagrant installed
- For libvirt:
- Ensure you have the prerequisites installed
sudo yum install ruby rubygems ruby-devel gcc gcc-c++
- Ensure you have the prerequisites installed
- For libvirt:
- Install libvirt. On CentOS/Fedora/RHEL, run
sudo yum install @virtualization libvirt-devel
- Install the libvirt plugin for Vagrant (see vagrant-libvirt page for more information)
vagrant plugin install vagrant-libvirt
- Make sure your user is in the
qemu
group. (e.g.[[ ! "$(groups $(whoami))" =~ "qemu" ]] && sudo usermod -aG qemu $(whoami)
) - Set the libvirt environment variable in your
.bashrc
or for your current session -export VAGRANT_DEFAULT_PROVIDER=libvirt
- If you are asked to provide your password for every command, follow these policykit steps.
The available versions and types of installs varies as new releases are made and older releases are deprecated. The most accurate way to see the list of available installations is to run the status command:
vagrant status
This will show a list of boxes by type and OS. For example, at the time of this documentation both Foreman 1.12 and Katello 3.1 had been released. Thus, when doing a status I see, for example:
centos7-foreman-nightly not created (libvirt)
centos7-katello-nightly not created (libvirt)
centos7-foreman-proxy-nightly not created (libvirt)
centos7-foreman-1.16 not created (libvirt)
centos7-katello-3.4 not created (libvirt)
This indicates that both Foreman and Katello nightly (our unstable releases) are available as well as production installations on Centos 7 boxes of Foreman, Katello and a Foreman Proxy. To fire up a Katello 3.4:
Start the installation for CentOS 7:
vagrant up centos7-katello-3.4
This will create a libvirt based virtual machine running the Katello server on CentOS.
This setup assumes you are either deploying on a non-VM environment or you already have a Virtual machine setup. The deployment can be done either locally on the box or via SSH using an Ansible inventory script with proper access.
This use case assumes that you are on a box that has SSH access to the target box for installation and that Ansible can properly realize the target host via an inventory script.
- Ensure Ansible is installed
- Clone this repository -
git clone https://github.com/theforeman/forklift.git
- Enter the repository -
cd forklift
- Create an inventory file with your hosts in the
inventories
subfolder. You can also pass a different inventory toansible-playbook
using--inventory
or-i
. - Change the variable remote_user in ./ansible.cfg to the appropriate value (the user that will log into the remote machine)
- Determine the compatible versions of Foreman and Katello you want to install based on the Katello install instructions at https://github.com/theforeman/forklift/blob/master/vagrant/config/versions.yaml. Replace the 3.16 in the URL with whatever version of Katello you want to install.
For a release version in production:
ansible-playbook -l <target-host> playbooks/katello.yml -e foreman_repositories_version=WANTED_FOREMAN_VERSION -e katello_repositories_version=WANTED_KATELLO_VERSION
For nightly production:
ansible-playbook -l <target-host> playbooks/katello.yml
After installing a Katello server, you could then spin up a Capsule with the assumption the Katello server can talk to the Capsule and vice versa.
ansible-playbook -l <target-capsule-host> playbooks/capsule_31.yml
- ssh to target machine as root
- Install Ansible --
yum install ansible
(for example from the EPEL repo) - Clone this repository -
git clone https://github.com/theforeman/forklift.git
- Enter the repository -
cd forklift
- Make sure DNS is set up properly. This is a Foreman requirement, not an Ansible requirement.
- Determine the compatible versions of Foreman and Katello you want to install based on the Katello install instructions at https://github.com/theforeman/forklift/blob/master/vagrant/config/versions.yaml.
For a release version in production:
ansible-playbook -l localhost playbooks/katello.yml -e foreman_repositories_version=WANTED_FOREMAN_VERSION -e katello_repositories_version=WANTED_KATELLO_VERSION
For nightly production:
ansible-playbook -l localhost playbooks/katello.yml