How to run finish script after pxe installation?

Hi all,

we have configured foreman to build a new host with the following steps:

  1. using discovery during boot
  2. provision to hostgroup via foreman GUI
  3. Using PXE boot with a Kickstart PXELinux template
  4. Running provisioning template after PXE boot

These steps works well, but the finish template will not run.
It is defined in the operating system like the provisioning template and
should run command on the target server.

I do not even the a connection via Ssh on the target server. Which Username
is used for ssh connection for the finish template. (and where to configure)
And I don't even see any activities in foreman-tail regarding the finish
template.

Please help.

Kind regards,
Christian

Hello,

looking in our codebase, it looks like finish script only runs when
these conditions are met:

compute_attributes.present? && image_build? && !image.try(:user_data)

So basically it's image based provisioning only.

What you can do as a workaround, you can use post section in Anaconda
to download and run it yourself, or schedule a firstboot script.

Running it against non-image based deployments might be useful, feel
free to send a patch for that. Direct SSH connection is required from
Foreman then, be aware!

LZ

··· On Fri, Jan 27, 2017 at 9:06 AM, Christian Froestl wrote: > Hi all, > > we have configured foreman to build a new host with the following steps: > > 1. using discovery during boot > 2. provision to hostgroup via foreman GUI > 3. Using PXE boot with a Kickstart PXELinux template > 4. Running provisioning template after PXE boot > > These steps works well, but the finish template will not run. > It is defined in the operating system like the provisioning template and > should run command on the target server. > > I do not even the a connection via Ssh on the target server. Which Username > is used for ssh connection for the finish template. (and where to configure) > And I don't even see any activities in foreman-tail regarding the finish > template. > > Please help. > > Kind regards, > Christian > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-users+unsubscribe@googlegroups.com. > To post to this group, send email to foreman-users@googlegroups.com. > Visit this group at https://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.


Later,
Lukas @lzap Zapletal