freeipa/doc/workshop/building.rst

72 lines
2.0 KiB
ReStructuredText
Raw Normal View History

.. _building:
2016-01-21 15:44:10 -06:00
Building Vagrant box images
===========================
This document describes how to build vagrant box images for the
FreeIPA workshop.
Requirements
------------
- Install packer (http://packer.io/)
- Install Vagrant, libvirt and VirtualBox
- Clone the Fedora kickstarts repo (https://pagure.io/fedora-kickstarts)
2016-01-21 15:44:10 -06:00
Packer template
---------------
Packer template ``packer-template-fedora.json`` requires Fedora 34 kickstart file
used by Fedora to build vagrant images:
2016-01-21 15:44:10 -06:00
- Clone the repo and checkout latest Fedora release branch::
2016-01-21 15:44:10 -06:00
$ git clone https://pagure.io/fedora-kickstarts.git
$ cd fedora-kickstarts
$ git checkout f34
2016-01-21 15:44:10 -06:00
- Install ``pykickstart`` package which provides ``ksflatten`` tool::
2016-01-21 15:44:10 -06:00
$ sudo dnf install pykickstart
2016-01-21 15:44:10 -06:00
- Generate the ``anaconda-ks.cfg`` file needed by flattening vagrant kickstart files
and putting it onto the same folder as the packer template file::
2016-01-21 15:44:10 -06:00
$ ksflatten -c $FEDORA_KICKSTARTS_REPO/fedora-cloud-base-vagrant.ks > $FREEIPA_REPO/doc/workshop/anaconda-ks.cfg
2016-01-21 15:44:10 -06:00
Building the vagrant images
-----------------------------
2016-01-21 15:44:10 -06:00
Build the images::
2016-01-21 15:44:10 -06:00
$ cd $FREEIPA_REPO/doc/workshop
$ BIN_PACKER build packer-template-fedora.json
2016-01-21 15:44:10 -06:00
Uploading boxes to Vagrant Cloud
2016-01-21 15:44:10 -06:00
----------------------------------
Vagrant by default looks for boxes in a directory called *Vagrant Cloud*.
2016-01-21 15:44:10 -06:00
Therefore is is good to make images available there, so that people
can easily download them as part of workshop preparation.
1. Log into https://app.vagrantup.com/.
2016-01-21 15:44:10 -06:00
2. Create or edit the *freeipa-workshop* box.
3. Create a new *version* of the box (left-hand menu). Each version
can include images for multiple *providers*.
4. *Create new provider* for ***virtualbox*** and upload the
corresponding ``.box`` file.
5. *Create new provider* for ***libvirt*** and upload the
corresponding ``.box`` file. *libvirt* may not appear as an
autocomplete option but type it in anyway.
6. *Release* the new version (this makes it available for
Vagrant to download). *Edit* the version, then click *Release
version*.