summaryrefslogtreecommitdiffstats
path: root/README.md
blob: dbc93cd978baad4ff695087ffc3f5867380a8a9e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

Ansible roles for OpenSLX

Small collection of ansible roles to build a dracut-based initramfs for network boot. The roles currently support both Ubuntu 16.04.2 and CentOS 7.3. Currently, it only matches these distribution families but does not check for these exact versions!

setup-dev-tools

Installs basic development packages for the detected distribution:

Ubuntu:     build-essential, cmake, git
CentOS:     "@development tools", cmake, git

dracut-initramfs-builder

Builds the dracut-based initramfs using the dnbd3-rootfs module (see systemd-init): * Install needed dependencies to build dracut for the detected distribution * Checkout git repository for systemd-init * Build the initramfs for the running kernel * Extract both initramfs and kernel out of the virtual machine

Depends on setup-dev-tools role (see dracut-initramfs-builder/meta/main.yml).

Usage

Use the provided 'build-dracut-initramfs.yml' playbook for the ansible provisioner in your packer template. You can use an already created qcow2 image, instead of always generating new packer images. See run-playbook-only.json for a sample packer template to use an existing qcow2 image and provision them with our playbook. The template requires the variable 'image_path' to be set, which needs to be the path of the qcow2 image.

If it was generated by packer and the manifest was created, you can simply extract the image path from that: # Be in same directory as where you built the image with packer with an ansible-roles in that directory, then: packer build -var-file=base.json -only=qemu -var='image_path='"$(jq -r '.builds[0].files[0].name' < manifest.json)"'' ansible-roles/run-playbook-only.json