mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-22 22:11:44 -07:00
add systemd-nspawn connection driver
This commit adds a connection driver built on top of systemd-nspawn. This is similar to the existing `chroot` driver, except that nspawn offers a variety of additional services. For example, it takes care of automatically mounting `/proc` and `/sys` inside the chroot environment, which will make a variety of tools work correctly that would otherwise fail. You can take advantage of other system-nspawn features to perform more complicated tasks. For example, on my x86_64 system I have a Raspberry Pi disk image mounted on `/rpi`. I can't use `chroot` with this because the binaries contained in the image are for the wrong architecture. However, I can use the systemd-nspawn `--bind` option to automatically insert the appropriate qemu-arm binary into the container using an inventory file like this: pi ansible_host=/rpi ansible_nspawn_extra_args='--bind /usr/bin/qemu-arm --bind /lib64' See http://www.freedesktop.org/software/systemd/man/systemd-nspawn.html for more information about systemd-nspawn itself.
This commit is contained in:
parent
482f882798
commit
3597ca082b
3 changed files with 157 additions and 0 deletions
|
@ -355,6 +355,8 @@ class CLI(with_metaclass(ABCMeta, object)):
|
|||
help="specify extra arguments to pass to scp only (e.g. -l)")
|
||||
connect_group.add_option('--ssh-extra-args', default='', dest='ssh_extra_args',
|
||||
help="specify extra arguments to pass to ssh only (e.g. -R)")
|
||||
connect_group.add_option('--nspawn-extra-args', default='', dest='nspawn_extra_args',
|
||||
help="specify extra arguments to pass to systemd-nspawn only (e.g. --bind)")
|
||||
|
||||
parser.add_option_group(connect_group)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue