Am trying to write a playbook in order to execute a python script running 
on a different subdirectory under the same project folder

A python script running on - /home/{username}/project1/reports/test1.py

And playbook running on - /home/{username}/project1/test1.yml

I need to execute a python script using the playbook. And playbook looks 
like this.

---
- hosts: switch1
  vars:
   ansible_connection: network_cli
   ansible_network_os: nxos
   ansible_ssh_user: '{{ username }}'
   ansible_ssh_pass: '{{ password }}'
  tasks:
   - name: Execute the python script
     command: python test1.py
     args:
       chdir: /home/{username}/project1/reports


But it's failing to execute the script. Please suggest me if am missing 
anything



 

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2940a20f-948b-4e21-8915-16112093d0f7%40googlegroups.com.

Reply via email to