Running a python program using Ansible

Hi Again,
I am successful in copying and running a python program from master to slave nodes but not able to see the output of the program. Can you please let me know where i am going wrong.


  • post-author-pic
    Victor C

    By default, the task does not display what was changed or what the output of the command is on the remote host.

    You can either do the following:

    1. Run    ansible-playbook python.yml -v 

    to display additional info which includes the stdout on the remote host, or

    2. Modify the playbook to include the debug info.

          - name: Running the script
    raw: python /home/user/
    register: output
    - debug: var=output

  • post-author-pic
    Aditya P

    Thanks, Victor

Looking For Team Training?

Learn More