V
V
vlzemtsov2017-10-12 17:36:45
linux
vlzemtsov, 2017-10-12 17:36:45

How to execute scripts after OS installation from PXE server?

Good afternoon.
Prelude:
I have a PXE server to which new virtual machines connect and from which they download an .iso image to install the OS.
Question:
Is it possible to specify from a PXE server (there are dhcp and tftp daemons that can be used for this) to execute some scripts after installing the OS on a new machine. (In fact, I need one package to be installed and one command to be executed.
Crutch:
If this is not possible, then I can make a "reference" OS on which the necessary commands will be executed and have the PXE server download and install this "reference" " OS. How to pack it? How to make the PXE server roll it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Spheniscus, 2017-10-13
@vlzemtsov

Depends on the distribution that is deployed via PXE.
In RHEL-based you need to look in the direction of the kickstart file
In DEB-based - in the direction of preseed.cfg
Both options allow you to execute a set of commands after installing the OS.
You can implement it differently - make a package with a daemon that, on the first run after installation, will execute the necessary commands and then delete itself

V
Victor Taran, 2017-10-13
@shambler81

I haven't been tinkering with this crap for a long time, but there you can also make separate configurations for each machine. there are network storage printers and so on, is it really not possible to execute a command.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question