What does Ansible push to the remote host?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












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?










share|improve this question



























    up vote
    1
    down vote

    favorite












    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?










    share|improve this question

























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      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?










      share|improve this question















      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?







      ansible






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 4 hours ago









      techraf

      3,10081531




      3,10081531










      asked 4 hours ago









      jouell

      317215




      317215




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted











          Most sites say a module is pushed and Ansible does not need an agent on the remote host - just SSH and Python.




          That's correct.



          scp or WinRM might also be used, as well a handful of other connection types.





          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?




          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 to 1:



          ANSIBLE_KEEP_REMOTE_FILES=1 ansible-playbook playbook.yml


          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 comments how to expand the set.





          How is it possible the remote host will not need any additional Python packages?




          This claim is incorrect.



          There are many modules requiring additional Python packages, for example expect module:




          The below requirements are needed on the host that executes this module.



          • python >= 2.6

          • pexpect >= 3.3



          or even executables, for example unarchive module:




          Requires gtar/unzip command on target host.







          share|improve this answer






















          • One note to further this: docs.ansible.com/ansible/2.5/dev_guide/…. You can use the explode command to 'turn the string into some python files that you can work with': ~/.ansible/tmp$ ansible-tmp-1536719125.6725047-209276989541110/setup.py explode
            – jouell
            3 hours ago










          • Isn't this what I wrote above? "If the files were packed, there are instructions in comments how to expand the set."
            – techraf
            3 hours ago











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "2"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f931073%2fwhat-does-ansible-push-to-the-remote-host%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted











          Most sites say a module is pushed and Ansible does not need an agent on the remote host - just SSH and Python.




          That's correct.



          scp or WinRM might also be used, as well a handful of other connection types.





          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?




          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 to 1:



          ANSIBLE_KEEP_REMOTE_FILES=1 ansible-playbook playbook.yml


          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 comments how to expand the set.





          How is it possible the remote host will not need any additional Python packages?




          This claim is incorrect.



          There are many modules requiring additional Python packages, for example expect module:




          The below requirements are needed on the host that executes this module.



          • python >= 2.6

          • pexpect >= 3.3



          or even executables, for example unarchive module:




          Requires gtar/unzip command on target host.







          share|improve this answer






















          • One note to further this: docs.ansible.com/ansible/2.5/dev_guide/…. You can use the explode command to 'turn the string into some python files that you can work with': ~/.ansible/tmp$ ansible-tmp-1536719125.6725047-209276989541110/setup.py explode
            – jouell
            3 hours ago










          • Isn't this what I wrote above? "If the files were packed, there are instructions in comments how to expand the set."
            – techraf
            3 hours ago















          up vote
          2
          down vote



          accepted











          Most sites say a module is pushed and Ansible does not need an agent on the remote host - just SSH and Python.




          That's correct.



          scp or WinRM might also be used, as well a handful of other connection types.





          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?




          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 to 1:



          ANSIBLE_KEEP_REMOTE_FILES=1 ansible-playbook playbook.yml


          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 comments how to expand the set.





          How is it possible the remote host will not need any additional Python packages?




          This claim is incorrect.



          There are many modules requiring additional Python packages, for example expect module:




          The below requirements are needed on the host that executes this module.



          • python >= 2.6

          • pexpect >= 3.3



          or even executables, for example unarchive module:




          Requires gtar/unzip command on target host.







          share|improve this answer






















          • One note to further this: docs.ansible.com/ansible/2.5/dev_guide/…. You can use the explode command to 'turn the string into some python files that you can work with': ~/.ansible/tmp$ ansible-tmp-1536719125.6725047-209276989541110/setup.py explode
            – jouell
            3 hours ago










          • Isn't this what I wrote above? "If the files were packed, there are instructions in comments how to expand the set."
            – techraf
            3 hours ago













          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted







          Most sites say a module is pushed and Ansible does not need an agent on the remote host - just SSH and Python.




          That's correct.



          scp or WinRM might also be used, as well a handful of other connection types.





          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?




          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 to 1:



          ANSIBLE_KEEP_REMOTE_FILES=1 ansible-playbook playbook.yml


          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 comments how to expand the set.





          How is it possible the remote host will not need any additional Python packages?




          This claim is incorrect.



          There are many modules requiring additional Python packages, for example expect module:




          The below requirements are needed on the host that executes this module.



          • python >= 2.6

          • pexpect >= 3.3



          or even executables, for example unarchive module:




          Requires gtar/unzip command on target host.







          share|improve this answer















          Most sites say a module is pushed and Ansible does not need an agent on the remote host - just SSH and Python.




          That's correct.



          scp or WinRM might also be used, as well a handful of other connection types.





          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?




          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 to 1:



          ANSIBLE_KEEP_REMOTE_FILES=1 ansible-playbook playbook.yml


          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 comments how to expand the set.





          How is it possible the remote host will not need any additional Python packages?




          This claim is incorrect.



          There are many modules requiring additional Python packages, for example expect module:




          The below requirements are needed on the host that executes this module.



          • python >= 2.6

          • pexpect >= 3.3



          or even executables, for example unarchive module:




          Requires gtar/unzip command on target host.








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 4 hours ago

























          answered 4 hours ago









          techraf

          3,10081531




          3,10081531











          • One note to further this: docs.ansible.com/ansible/2.5/dev_guide/…. You can use the explode command to 'turn the string into some python files that you can work with': ~/.ansible/tmp$ ansible-tmp-1536719125.6725047-209276989541110/setup.py explode
            – jouell
            3 hours ago










          • Isn't this what I wrote above? "If the files were packed, there are instructions in comments how to expand the set."
            – techraf
            3 hours ago

















          • One note to further this: docs.ansible.com/ansible/2.5/dev_guide/…. You can use the explode command to 'turn the string into some python files that you can work with': ~/.ansible/tmp$ ansible-tmp-1536719125.6725047-209276989541110/setup.py explode
            – jouell
            3 hours ago










          • Isn't this what I wrote above? "If the files were packed, there are instructions in comments how to expand the set."
            – techraf
            3 hours ago
















          One note to further this: docs.ansible.com/ansible/2.5/dev_guide/…. You can use the explode command to 'turn the string into some python files that you can work with': ~/.ansible/tmp$ ansible-tmp-1536719125.6725047-209276989541110/setup.py explode
          – jouell
          3 hours ago




          One note to further this: docs.ansible.com/ansible/2.5/dev_guide/…. You can use the explode command to 'turn the string into some python files that you can work with': ~/.ansible/tmp$ ansible-tmp-1536719125.6725047-209276989541110/setup.py explode
          – jouell
          3 hours ago












          Isn't this what I wrote above? "If the files were packed, there are instructions in comments how to expand the set."
          – techraf
          3 hours ago





          Isn't this what I wrote above? "If the files were packed, there are instructions in comments how to expand the set."
          – techraf
          3 hours ago


















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f931073%2fwhat-does-ansible-push-to-the-remote-host%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          Long meetings (6-7 hours a day): Being “babysat” by supervisor

          Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

          Confectionery