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.

Triage: https://bitbucket.org/snippets/theputta/Ee9AMR

  • post-author-pic
    Victor C
    09-02-2018

    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/target.py
    register: output
    - debug: var=output




  • post-author-pic
    Aditya P
    09-03-2018

    Thanks, Victor

Looking For Team Training?

Learn More