Is it possible to run Ansible against a jailed environment without python?

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.

You can, but you'll be limited to modules that don't need Python to
execute, Ansible only ships with `raw` and `script` that can do that.

You can develop your own in any language you want to support or even
binary modules, the Python requirement on targets is mostly due to
that is the language modules Ansible ships requires (well, powershell
in case of windows targets).

One thing that you can do is overlay a working python on your
container for the time of execution, ansible-container did something
similar.

Thanks, this is exactly what I needed.

For anyone else interested in this answer, the relevant code is here: https://github.com/ansible/ansible-container/blob/c6b28ceb239356eb86adcccc42b2126812610885/container/core.py#L734