#808556 live-wrapper: use ansible for the vmdebootstrap hook script

#808556#5
Date:
2015-12-20 21:57:05 UTC
From:
To:
Hi,

The current method of using a shell script as the hook script means that
a lot of logic about the setup of the live environment has to be handled
by live-wrapper, where a tool like ansible can already do these things.

Instead of trying to implement logic for configuring the live
environments, just let ansible do it.

Thanks,
Iain.

#808556#10
Date:
2015-12-20 22:12:51 UTC
From:
To:
Hi,

Ok, here are my thoughts on this:

Add an option to lwr, something like --ansible <playbook>, that causes a
hook script to be run that does:

  * mount_support
  * disable daemons in the chroot
  * prepare_apt_source
  * create an ansible inventory containing a single host
    where ansible_host is set to the rootdir (passed as the
    first argument to the hook script) and use connection
    type of chroot - the alias should probably be "live" or
    something known so it can be used in the playbook
  * run the ansible playbook passing in the inventory
  * remove_daemon_block
  * replace_apt_source
  * blacklist_qemu_bochs (this is only really needed for qemu efi - should
    investigate this futher)

This actually shouldn't be too hard. The blends-images package can then be a
series of ansible playbooks and bootloader configs as jinja2 templates
(#808557) which will be consistent with any templates used as part of the
ansible playbook.

Thanks,
Iain.