Discovery image and zip file question

Hello,

I am trying to roll my own discovery ISO to include some scripts I want to
run ahead of provisioning an OS to disks.

I must be doing this incorrectly as my test script as not landing in
/opt/extension/autostart.d when booted from my fdi image.

I have downloaded fdi-image-3.2.0.tar and uncompressed that bad boy.
Dropped a test.zip in the foreman-discovery-image-master folder (test.zip
contains the below)

autostart.d/
autostart.d/01_zip.sh
bin/
facts/
lib/

I run ./build-livecd fdi-centos7.ks followed by ./build-livecd-root

I then boot the ISO, set an ssh password, login but I do not see my script
in /opt/extension/autostart.d

I guess I am missing a step or completely misunderstood the how to achieve
this? I basically need to include my scripts in the ISO.

Any help would be appreciated.

Ta,

Oleg,

are you on DHCP network? Or booting the ISO from CDROM/USB stick without
network.

There's a service called /usr/bin/discovery-fetch-extensions
and /usr/bin/discovery-start-extensions with their systemd service files,
the former is path activated and there is a environment file created by
NetworkManager when (any) interface is activated. It reads the servername
from command line, but if there is a TFTP server option it got from DHCP
response, it prefers it. So it looks like this only works when the the
network is activated. This is expected behaviour.

But it looks like if you embed extensions and no network is activated, it
does not unpack them (start extensions), this is a bug. We should unpack
and activate them even if no network is started at all. File a ticket
please.

LZ

··· On Sat, Dec 3, 2016 at 12:16 PM, Oleg Mcnoleg wrote:

Hello,

I am trying to roll my own discovery ISO to include some scripts I want to
run ahead of provisioning an OS to disks.

I must be doing this incorrectly as my test script as not landing in
/opt/extension/autostart.d when booted from my fdi image.

I have downloaded fdi-image-3.2.0.tar and uncompressed that bad boy.
Dropped a test.zip in the foreman-discovery-image-master folder (test.zip
contains the below)

autostart.d/
autostart.d/01_zip.sh
bin/
facts/
lib/

I run ./build-livecd fdi-centos7.ks followed by ./build-livecd-root

I then boot the ISO, set an ssh password, login but I do not see my script
in /opt/extension/autostart.d

I guess I am missing a step or completely misunderstood the how to achieve
this? I basically need to include my scripts in the ISO.

Any help would be appreciated.

Ta,


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

I am using CDROM/USB stick without network.

I have another question if you don't mind.

My custom ISO discovers OK in the Foreman UI, but I get the below when
initiating a reboot. I downloaded the latest master image and built my ISO
from that.

I am running plugin tfm-rubygem-foreman_discovery-6.0.0-1.fm1_12.el7.noarch

2016-12-06 16:46:16 [app] [W] ERF50-5094 [Foreman::WrappedException]: Failed
to reboot host mac3ca82a1ece68 with error ERF50-4973 [Foreman::
WrappedException]: Unable to reboot mac3ca82a1ece68 via https://myclient:8443:
Legacy direct service only supports http scheme ([ArgumentError]: Legacy
direct service only supports http scheme) ([Foreman::WrappedException]:
ERF50-4973 [Foreman::WrappedException]: Unable to reboot mac3ca82a1ece68
via https://82…)
> Foreman::WrappedException: ERF50-4973 [Foreman::WrappedException]: Unable
to reboot mac3ca82a1ece68 via https://myclient:8443: Legacy direct service
only supports http scheme ([ArgumentError]: Legacy direct service only
supports http scheme)

Thanks,

When you start the image, what is the version number at the bottom left? It
must be higher than 3.0 and the correct version must be uploaded in the
discovery_version fact. If not, the plugin attempts to use legacy FDI API
which is perhaps not what you want. Check the version, it should be also
present on the image somewhere at /usr/share/fdi/VERSION file.

File a ticket for the extensions problem. A workaround is to start the
service manually (e.g. create new systemd unit for your script).

LZ

··· On Tue, Dec 6, 2016 at 5:55 PM, Oleg Mcnoleg wrote:

I am using CDROM/USB stick without network.

I have another question if you don’t mind.

My custom ISO discovers OK in the Foreman UI, but I get the below when
initiating a reboot. I downloaded the latest master image and built my ISO
from that.

I am running plugin tfm-rubygem-foreman_discovery-
6.0.0-1.fm1_12.el7.noarch

2016-12-06 16:46:16 [app] [W] ERF50-5094 [Foreman::WrappedException]:
Failed to reboot host mac3ca82a1ece68 with error ERF50-4973 [Foreman::
WrappedException]: Unable to reboot mac3ca82a1ece68 via https://myclient:8443:
Legacy direct service only supports http scheme ([ArgumentError]: Legacy
direct service only supports http scheme) ([Foreman::WrappedException]:
ERF50-4973 [Foreman::WrappedException]: Unable to reboot mac3ca82a1ece68
via https://82…)

Foreman::WrappedException: ERF50-4973 [Foreman::WrappedException]:
Unable to reboot mac3ca82a1ece68 via https://myclient:8443: Legacy direct
service only supports http scheme ([ArgumentError]: Legacy direct service
only supports http scheme)

Thanks,


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

Thanks for the reply, the ISO I built shows 'Foreman Discovery Image v
(20161204.1)' and /usr/share/fdi/VERSION is empty.

Note that I downloaded from
https://github.com/theforeman/foreman-discovery-image and build with
build-livecd fdi-centos7.ks and build-livecd-root

If I download the prebuilt iso (from the below) I am able to reboot
discovered nodes from Foreman UI as expected. When booting this ISO I see
'Foreman Discovery Image v3.2.0 (20160920.1)' and /usr/share/fdi/VERSION
shows 3.2.0

Is the foreman-discovery-image from github v.3.2.0? In which case how to I
add the version to load the correct API?

I have raised a bug against the .zip extraction.

Thanks a lot for the work here, this ISO is going to help a lot in our
environment.

Are you building from git?

In the build-livecd script there is this line:

VERSION=${4:-$(git describe --abbrev=0 --tags)}

The file is not getting created properly, use parameter to set it to value
3.1.0 or something like that.

We need to fix that and make a default value of 99.99.99 or something like
that for ad-hoc builds.

LZ

··· On Wed, Dec 7, 2016 at 11:35 PM, Oleg Mcnoleg wrote:

Thanks for the reply, the ISO I built shows ‘Foreman Discovery Image v
(20161204.1)’ and /usr/share/fdi/VERSION is empty.

Note that I downloaded from https://github.com/theforeman/
foreman-discovery-image and build with build-livecd fdi-centos7.ks and
build-livecd-root

If I download the prebuilt iso (from the below) I am able to reboot
discovered nodes from Foreman UI as expected. When booting this ISO I see
’Foreman Discovery Image v3.2.0 (20160920.1)’ and /usr/share/fdi/VERSION
shows 3.2.0

Is the foreman-discovery-image from github v.3.2.0? In which case how to I
add the version to load the correct API?

I have raised a bug against the .zip extraction.

Thanks a lot for the work here, this ISO is going to help a lot in our
environment.


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