Foreman Hook questions

Hi folks,

When provisionning with foreman, foreman will download the kernel and
initrd according to the source media.

Unfortunately, debian does not bundle non-free firmware inside the initrd,
and it's a real pain because most of my servers need non-free firmware for
network cards.

I've created a smal script wich grab the firmware tarball from debian
website, and add it to the initrd.

What i wanted to do now, it's to hook this script into foreman so everytime
it download a new kernel/initrd, it will merge firmware tarball inside.

So it seems that foreman_hooks plugin may be good for that.

My first question is :

Is the host/managed/after_build event good for this ?

And how can i know the name of the downloaded initrd ?

Regards,

>
> Hi folks,
>

I will answer myself :wink:

>
> When provisionning with foreman, foreman will download the kernel and
> initrd according to the source media.
>
> Unfortunately, debian does not bundle non-free firmware inside the initrd,
> and it's a real pain because most of my servers need non-free firmware for
> network cards.
>
> I've created a smal script wich grab the firmware tarball from debian
> website, and add it to the initrd.
>
> What i wanted to do now, it's to hook this script into foreman so
> everytime it download a new kernel/initrd, it will merge firmware tarball
> inside.
>
>
> So it seems that foreman_hooks plugin may be good for that.
>
> My first question is :
>
> Is the host/managed/after_build event good for this ?
>

It is the right Event.

>
> And how can i know the name of the downloaded initrd ?
>

You have to build the initrd name from what you know about the host, say :
OS-Version-Arch-initrd.gz.

I've done a script using hammer for this, specific to Debian Host.

If someone interested in this script, or would like it for another distro,
feel free to tell me.

··· Le jeudi 19 mars 2015 15:25:43 UTC+1, claude juif a écrit :

Regards,