Hi all,
I'm curious about what is the Ansible way of working with FreeBSD Jails on a
remote host.
In my company we deploy almost all of our inhouse software inside jails and
therefore I have developed a connection plugin "sshjail" that allows us to use
a jail on a remote host as an Ansible host (addressed by jailname@host).
To setup flexible test environments we want to use Ansible to create and
configure the jails up to the point where we can use our connection plugin to
connect to the jail. One crucial part in the creation process is to setup
Python inside the jail. I created a patched version of the pkgng module that
exposes pkg's --jail option as a "jail" parameter. See the pull request
https://github.com/ansible/ansible-modules-extras/pull/131 . This allows me to
have a simple task that runs against the host and installs Python inside the
jail. After that I can ran plays against the jail.
Michael is unhappy with the idea of having a jail parameter in the pkgng
module and closed the pull request. Coming from my use case there won't be a
need to have a jail option in all modules to do things in jails, so the
argument for closing the request does not really convince me. Furthermore, the
proposed jail parameter just exposes a feature present in the pkg program.
But maybe there is an elegant way to use the pkgng module from outside a jail
to install software inside the jail?
Best Wishes!
David