Is it possible to chain multiple connection plugins together. Specifically, I would want ansible to:
Connect to my jail host with ssh
Use the jail connection plugin to attach to a jail
Following an example intended for lxc, I set ansible_host to the form host:jail. However, I just get a message saying “jail connection requires running as root”. Passing -kuroot, it will prompt for an SSH password. Is this not working an error on my part, an ansible limitation or perhaps a bug/limitation in the jail connection plugin.
You can run Ansible using Ansible – I have done this for servers with chroots and the chroot connection plugin, I probably haven’t documented it very well but you could look at this chroot role.
Connection plugins don’t stack, but you can create an ssh+jail plugin that does both (I believe someone did already), also see lxc/lxd connection plugins.
The other suggestion of running ansible from ansible is interesting and I could see that working in other circumstances but my FreeBSD host systems are very minimal and wouldn’t typically contain a checkout of the playbooks which would be needed.