[Spacewalk-list] Set Random During Build process

Emmett Hogan ehogan at gmail.com
Wed Mar 2 00:34:38 UTC 2016


Hi everyone,

I am sure this issue has been solved a thousand times, but for the life of
me, my google-foo is failing and I cannot find the solution.

Basically, all I want to do is generate a random temporary hostname when a
machine is provisioned via Spacewalk.  I've thought that the right way
would be a snippet that did just:

------------------------------
echo "network --hostname=temp-$RANDOM$RANDOM.mydomain.com" >
/tmp/pre-hostname
%include /tmp/pre-hostname
-------------------------------

The file /tmp/pre-hostname is getting created correctly, but the "%include"
isn't working. (I am assuming that it is because it's inside of a "%pre"
block.

Basically, I want to be able to PXE boot a machine and have it come up with
a standard (but random) temporary hostname using our default
configuration.  Not localhost.localdomain.

Once the role of the machine is decided, I plan to use Chef to update the
hostname, and other configurations and the Spacewalk registration.

Am I doing something blatantly stupid here?

Thanks,
Emmett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20160301/02f6d1a8/attachment.htm>


More information about the Spacewalk-list mailing list