I install CentOS 7 using the ks=http://10.0.0.100:8080/anaconda-ks.cfg
option and I serve the static configuration file by running a simple web server: python -m SimpleHTTPServer 8080
.
In my anaconda-ks.cfg
I currently set the hostname like this:
network --hostname=centdev
However, I wish to read a text file (preferably JSON using Python) from the same location as my anaconda-ks.cfg
and check the current hardware ID against a dictionary to figure out which hostname to use.
Can I somehow avoid hardcoding http://10.0.0.100:8080 into
anaconda-ks.cfg
and fetch this location via e.g. a an environment variable?Do I just embed my python script inside of
anaconda-ks.cfg
using the%pre
like below?
%pre
#!/bin/python
print 'Read JSON file here...'
%end