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.