Merge lp:~javier.collado/utah/readable-preseed into lp:utah
Status: | Merged |
---|---|
Approved by: | Javier Collado |
Approved revision: | 831 |
Merged at revision: | 821 |
Proposed branch: | lp:~javier.collado/utah/readable-preseed |
Merge into: | lp:utah |
Diff against target: |
345 lines (+113/-96) 11 files modified
debian/utah.install (+1/-0) templates/50-utahdefault.conf.jinja2 (+13/-0) templates/casper-preseed-script.jinja2 (+4/-0) templates/check-locks-command.jinja2 (+9/-0) templates/install-deb-command.jinja2 (+2/-0) templates/preseed-install-commands.jinja2 (+5/-0) templates/preseed-postinstall-commands.jinja2 (+4/-0) templates/preseed-success-command.jinja2 (+8/-0) templates/utah-latecommand.jinja2 (+18/-0) utah/config.py (+2/-0) utah/provisioning/provisioning.py (+47/-96) |
To merge this branch: | bzr merge lp:~javier.collado/utah/readable-preseed |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Javier Collado (community) | Approve | ||
Review via email:
|
Description of the change
The changes in this branch are intended to improve the readability of the
generated preseed once it's rewritten.
To do this, it replaces the templates that were include in the code with other
ones in separate files using jinja2 template library. Some of the files aren't
really templates because they don't have any substitution variable, but I've
moved them to a file to keep a better separatation between the code and the
data that is used in the provisioned machines. I could replace the template
rendering for them with just a file copy if you find this doesn't make much
sense.
An example of a fragment of a the preseed for a desktop would be as follows:
ubiquity ubiquity/
sh utah-latecommand; \
in-target sh -c '\
while (fuser /var/lib/dpkg/lock \
do \
echo "Waiting for dpkg lock to become available"; \
sleep 10; \
done; \
apt-get install -y --force-yes openssh-server >>/var/
while (fuser /var/lib/dpkg/lock \
do \
echo "Waiting for dpkg lock to become available"; \
sleep 10; \
done; \
apt-get install -y --force-yes gdebi >>/var/
sed -i -e '"'"'/^exit 0$/i\
while (fuser /var/lib/dpkg/lock \
do \
done; \
apt-get install -y --force-yes openssh-server >>/var/
while (fuser /var/lib/dpkg/lock \
do \
done; \
apt-get install -y --force-yes gdebi >>/var/
'"'"'\
'; [ "$?" -eq "0" ]
Note that this was all in a single line and now it's possible to take a look at
it if it's needed to troubleshoot a problem.
I've tested the changes with {desktop,server} {i386,amd64} images and didn't
fine any problem.
This looks pretty great. I think it would be awesome if we also templated the default preseed, libvirt XML file, and maybe even stuff like the kernel command line options and the commands we pass to cobbler, but all of those would involve more work to keep them compatible with user input. I think this is a really good step in the direction of separation of code from configuration.
As far as the actual code, it all looks reasonable to me. If you've tested it, it should be fine. If I have some time, I'll try to test it as well.
Finally, if we merge this before the rsyslog stuff, we'll need to make sure that branch gets properly updated to take these changes into account, and vice versa.