Wondering how Ansible works at a brick level. Most sites say a module is pushed and Ansible does not need an agent on the remote host - just SSH and Python.
It seems like Ansible would need to create a python script locally and copy it to the remote host. What is sent? Is it literally a .py
file or a .pyc
file - or other?
How is it possible the remote host will not need any additional Python packages?
That's correct.
scp
or WinRM might also be used, as well a handful of other connection types.It does create a script locally and copy it to the remote host.
.py
or a packed set of those.You can see for yourself -- execute Ansible with
ANSIBLE_KEEP_REMOTE_FILES
set to1
:and check the temporary directory on the target machine (by default under the
$HOME/.ansible/tmp/
for the connecting user).If the files were packed, there are instructions in the comments inside the file on how to expand the set.
This claim is incorrect.
There are many modules requiring additional Python packages, for example
expect
module:or even executables, for example
unarchive
module: