bertvv / ansible-role-pxeserver

Ansible role to set up a PXE server on RHEL/CentOS 7
https://galaxy.ansible.com/bertvv/pxeserver/
Other
38 stars 21 forks source link

Ansible role pxeserver

An Ansible role for setting up a PXE boot server.

This role will download the kernel(s) and initrd(s) that you want to boot, but the filesystem (that will be shared over NFS) is not set up automatically.

Requirements

No specific requirements

Role Variables

TODO

Variable Default Comment
pxeserver_directory pxelinux Subdirectory under TFTP root for PXE specific files
pxeserver_images [] List of dicts specifying PXEboot images to be served. See below.
pxeserver_ip ansible_default_ipv4.address IP address of the PXE server

You can specify the boot images to be served with the variable pxeserver_images, a dict containing the keys listed below. Keys are mandatory unless specified.

Key Value
name A unique identifier for the image
default When true, this image is chosen as the default. May be omitted.
kernel_url URL where to download the kernel image.
initrd_url URL where to download the initrd image.
kickstart_url URL where to download the kickstart file. May be omitted
kickstart_path Location where to copy the kickstart file from. May be omitted
label Label for the PXE boot menu entry of this image.

Dependencies

This role depends on:

Example Playbook

See the test playbook

Testing

The tests directory contains tests for this role in the form of a Vagrant environment. You should install the dependent roles

$ cd tests/
$ ansible-galaxy install -p roles bertvv.tftp
$ vagrant up

The last command creates a new CentOS 7 VM and applies the playbook test.yml. This should result in a working PXE server.

Contributing

Issues, feature requests, ideas are appreciated and can be posted in the Issues section. Pull requests are also very welcome. Preferably, create a topic branch and when submitting, squash your commits into one (with a descriptive message).

License

BSD

Further reading

Author Information

Bert Van Vreckem (bert.vanvreckem@gmail.com)