r/pxe: Set up a PXE server
The *pxe* role configures the TFTP and NBD stages of PXE network booting. The TFTP server provides the files used for the boot stage, which may either be a kernel and initramfs, or another bootloader like SYSLINUX/PXELINUX or GRUB. The NBD server provides the root filesystem, typically mounted by code in early userspace/initramfs. The *pxe* role also creates a user group called *pxeadmins*. Users in this group can publish content via TFTP; they have write-access to the `/var/lib/tftpboot` directory.
This commit is contained in:
5
roles/pxe/meta/main.yml
Normal file
5
roles/pxe/meta/main.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
dependencies:
|
||||
- role: tftp
|
||||
tags: tftp
|
||||
- role: nbd-server
|
||||
tags: nbd
|
||||
36
roles/pxe/tasks/main.yml
Normal file
36
roles/pxe/tasks/main.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
- name: ensure pxeadmins group exists
|
||||
group:
|
||||
name: pxeadmins
|
||||
state: present
|
||||
tags:
|
||||
- group
|
||||
|
||||
- name: ensure pxeadmins can write to tftpboot directory
|
||||
acl:
|
||||
path: /var/lib/tftpboot
|
||||
entity: pxeadmins
|
||||
etype: group
|
||||
permissions: rwX
|
||||
recursive: True
|
||||
default: '{{ item == "default" }}'
|
||||
state: present
|
||||
loop:
|
||||
- default
|
||||
- current
|
||||
tags:
|
||||
- permissions
|
||||
|
||||
- name: ensure pxeadmins can write to nbd directory
|
||||
acl:
|
||||
path: /var/lib/nbd
|
||||
entity: pxeadmins
|
||||
etype: group
|
||||
permissions: rwX
|
||||
recursive: True
|
||||
default: '{{ item == "default" }}'
|
||||
state: present
|
||||
loop:
|
||||
- default
|
||||
- current
|
||||
tags:
|
||||
- permissions
|
||||
Reference in New Issue
Block a user