An Ansible Role to install and configure a tftp server.
A very common scenario in IT Operations is, that a server needs to be deployed via PXE boot. This involves tftp and syslinux.
This Ansible Role installs and configures tftp and syslinux.
- install tftp-server
- enable tftp-server
- install syslinux packages
- configure PXE Boot Configuration (pxelinux.cfg/default)
Used Modules:
- Ansible package Module
- Ansible service Module
- Ansible package_facts Module
- Ansible firewalld Module
- Ansible template Module
- Ansible file Module
- Ansible command Module
- Ansible stat Module
Install from Ansible Galaxy
ansible-galaxy install while_true_do.srv_tftp
Install from Github
git clone https://github.com/while-true-do/ansible-role-srv_tftp.git while_true_do.srv_tftp
---
# defaults file for while_true_do.srv_tftp
## Package Management
wtd_srv_tftp_package: "tftp-server"
# State can be present|latest|absent
wtd_srv_tftp_package_state: "present"
## Management for tftpboot
# tftp is most likely used for pxe, bootp
# enabled can be true|false
wtd_srv_tftp_boot_enabled: true
# Packages for tftpboot
wtd_srv_tftp_boot_package: "syslinux-tftpboot"
# State can be present|latest|absent
wtd_srv_tftp_boot_package_state: "present"
# Configuration for tftpboot
wtd_srv_tftp_boot_conf:
timeout: "300"
title: "PXE Boot"
label_bootdisk: true
label_hdt: false
label_reboot: false
label_poweroff: false
labels: []
# - label: ""
# default: false
# kernel: ""
# append: ""
## Service Management
wtd_srv_tftp_service: "tftp.socket"
# State can be started|stopped
wtd_srv_tftp_service_state: "started"
wtd_srv_tftp_service_enabled: true
## Firewalld Management
wtd_srv_tftp_fw_mgmt: true
wtd_srv_tftp_fw_service: "tftp"
# State can be enabled|disabled
wtd_srv_tftp_fw_state: "enabled"
# Zone can be according to defined zones on your machine.
wtd_srv_tftp_fw_zone: "public"
Running Ansible Roles can be done in a playbook.
---
- hosts: all
roles:
- role: while_true_do.srv_tftp
Configuring multiple labels. Be aware, that you have to download and prepare the needed OS files on your own.
- hosts: all
roles:
- role: while_true_do.srv_tftp
wtd_srv_tftp_boot_conf:
timeout: "100"
title: "While True Do Boot"
labels:
- label: "CentOS 7.6"
default: true
kernel: "centos76/vmlinuz"
append: "initrd=centos76/initrd.img"
- label: "Fedora 30"
kernel: "fedora30/vmlinuz"
append: "initrd=fedora30/initrd.img"
- RedHat Testing is currently not possible in public, due to limitations in subscriptions.
- Some services and features cannot be tested properly, due to limitations in docker.
Most of the "generic" tests are located in the Test Library.
Ansible specific testing is done with Molecule.
Infrastructure testing is done with testinfra.
Automated testing is done with Travis CI.
Thank you so much for considering to contribute. We are very happy, when somebody is joining the hard work. Please fell free to open Bugs, Feature Requests or Pull Requests after reading the Contribution Guideline.
See who has contributed already in the kudos.txt.
This work is licensed under a BSD-3-Clause License.
- Site https://while-true-do.io
- Twitter https://twitter.com/wtd_news
- Code https://github.com/while-true-do
- Mail hello@while-true-do.io
- IRC freenode, #while-true-do
- Telegram https://t.me/while_true_do