I have a mounted image that I’m running Ansible against. Currently I’m using an sshd jail, restricting ssh to the root of the image so that Ansible can run as if the the image is a host, but I would like to remove the restriction that the image has to have python. The host where the image is mounted will always have python, so is there a way to run Ansible using python from the host, but restricting Ansible changes to only the image? I’m not tied to the sshd jail, so some other way of restricting the Ansible run is also fine.
Additional details: I know that a lot of what I’m trying to do could be accomplished by removing the sshd jail and changing paths and other variables in the Ansible run to point only to the image, but this same playbook needs to be largely runnable against a booted version of the image as well, so I’m looking for a more general solution that doesn’t require an entirely different playbook or set of variables. With my current jail setup the mounted image and booted image look pretty similar from Ansible’s perspective and the playbook doesn’t require any changes, which is something I’d like to keep. Running against the booted image won’t be necessary if python isn’t part of the image.