0

I have 2 possible subnets that systems could be built in using Kickstart, with the subnet of the client directing which build should occur. How could I go about this?

I have tried the following %pre scripts to little avail at the moment. Is on CentOS 6.6:

%pre
mysubnet=$(echo `hostname -I` | cut -d'.' -f3)
echo "url --url http://192.168.$mysubnet.1/CENTOS/6/os" > /tmp/url-include
%end

...with this at the top of the ks file (omissions for brevity):

install
text
%include /tmp/url-include   

I have checked the contents of url-include at build time, and it does appear to contain all the correct and expected information, but I always am prompted for the install type.

Adding further info as requested

install
text
%include /tmp/url-include
lang en_US.UTF-8
keyboard uk
network --onboot yes --device eth0 --bootproto dhcp --noipv6
firewall --disabled
selinux --disabled
timezone --utc Europe/London
reboot

%include /tmp/repo-include

%pre
#!/bin/bash

mysubnet=$(echo `hostname -I` | cut -d'.' -f3)

echo "url --url http://192.168.$mysubnet.1/CENTOS/6/os" > /tmp/url-include

echo "repo --name=\"CentOS\"  --baseurl=http://192.168.$mysubnet.1/CENTOS/6/extras/x86_64/Packages --cost=100" > /tmp/repo-include


%end

Currently i am about to try another methodology that involves segregating tftp traffic, and then applying the network config %post install. And try how limited the name resolution is at this point in the cycle.

stub0t
  • 1
  • 1
  • Ahh looks like the url directive is evaluated prior to the %pre evaluation so I'm even less sure of how to resolve this issue now... – stub0t Jun 27 '16 at 19:02
  • 1
    You'll probably want to go ahead and include more of the ks file, especially as per your last comment; add anything relevant please. – bourneN5years Jun 27 '16 at 20:07
  • ...especially anything to do with the " install location," since you mentioned that is what is holding you up.. please update also if that is not correct. – bourneN5years Jun 27 '16 at 20:41

0 Answers0