mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Allow customizing of virt-sysprep behaviour on package (#955)
Support `vagrant package` of e.g. bento-derived boxes that require SSH hostkeys already set (as in the case of bento/debian-7 and above,) as well as leave existing LVM UUIDs untouched (e.g. in bento/ubuntu-18.04.) Instead of hard-coding sysprep operations, use an environment variable to set these instead. Use the Chef bento use case as an example for customizing sysprep operations.
This commit is contained in:
committed by
Darragh Bailey
parent
3d0080b6a4
commit
deb36bef8b
@@ -38,7 +38,8 @@ module VagrantPlugins
|
||||
`qemu-img rebase -p -b "" #{@tmp_img}`
|
||||
# remove hw association with interface
|
||||
# working for centos with lvs default disks
|
||||
`virt-sysprep --no-logfile --operations defaults,-ssh-userdir -a #{@tmp_img}`
|
||||
operations = ENV.get('VAGRANT_LIBVIRT_VIRT_SYSPREP_OPERATIONS', 'defaults,-ssh-userdir')
|
||||
`virt-sysprep --no-logfile --operations #{operations} -a #{@tmp_img}`
|
||||
# add any user provided file
|
||||
extra = ''
|
||||
@tmp_include = @tmp_dir + '/_include'
|
||||
|
||||
Reference in New Issue
Block a user