Closed bdonnahue closed 5 years ago
I thought about modifying the code to accept symlinks... but then I thought I would just modify the installer so that scripts could regenerate the answerfile. My preinstall script could then put the correct disk name in the answerfile rather than relying on symlinks.
I had a look at the code, the init.py script is the entrypoint for the installation process
It then calls go() from the install.py file
We can see that answerfiles can be "generated" or retrieved from file locations
In this function the file is parsed and then fed into the actual install process which occurs later
The scripts are put into some type of dictionary
The answerfile.py file contains some utilities for getting the answerfile and parsing it etc
Retrieved answer files are pulled from the location and stored here: ANSWERFILE_PATH
this is hardcoded to be /tmp/answerfile in the constants.py file
We can modify the Answerfile.fetch() function to only fetch if the file has not been downloaded already
We can modify go() function: encapsulate some of the logic in a new function (the logic associated with parsing the answer file); then call the parse function again after running the installation-start scripts
This solution is a lot more powerful and about the same in terms of effort
I made the code changes and they are working.
Who maintains this project? I would like to get that code integrated in the next release
You can create a pull request to this repository and we will review it. Thanks!
I forgot about this project. I still need to submit the PR. Just updating the thread.
It seems that all of the functionality I require comes out of the box via the answerfile_generator parameter for the installer. This parameter will allow a user to specify a script which writes the answerfile XML to stdout. The script will be downloaded and executed at the beginning of the installation process. It is mentioned in the doc/parameters.txt
In an attempt to make the install more dynamic, I set about trying to come up with a way that I could PXE boot the system without knowing which disk I wanted to use ahead of time.
My idea was that I would create a installation-start script which would create a symlink for a given device. For example, I would create a symlink from sdb to xcpng. I would then configure the answer file to install to the symlink device named xcpng rather than sdb.
The install fails of the first go around, but succeeds on the second attempt.
The stack trace is as follows:
Please let me know if I can provide more details