Fedora Account System
Red Hat Associate
Red Hat Customer
It would be nice if virt-sysprep accepted e.g. `--ansible-playbook some-playbook.yml` and automatically executed the tasks there against the spawned machine.
What actual command should be run inside the appliance?
Not much inside ... only the necessary steps to be able to run ansible-playbook from the outside *against* the appliance.
I suspect that getting a network connection from the outside world to the appliance is going to be the problem here. The userspace network stack we use (SLIRP) does not easily support this (without invasive changes to libguestfs). To move this on you should do this: $ virt-rescue --network --scratch and see if it's possible to get ansible on the outside to configure inside this appliance, then detail what steps have to be taken to make that work. Note using SLIRP port forwarding is not really an option.
I bet it's non-trivial, but it should ideally work without the network connection. There seem to be a whole bunch of existing connection plugins in Ansible other than ssh: $ ansible-doc -t connection -l buildah Interact with an existing buildah container chroot Interact with local chroot docker Run tasks in docker containers funcd Use funcd to connect to target httpapi Use httpapi to run command on networ ... And perhaps we can think of a custom one in this case?
> To move this on you should do this: > > $ virt-rescue --network --scratch > > and see if it's possible to get ansible on the outside to configure > inside this appliance, then detail what steps have to be taken to make > that work. Note using SLIRP port forwarding is not really an option. I'll try to poke at this later and provide feedback, thanks for the tip.
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.
Reopening because Virtualization Tools has not been discontinued.