0

Trying to create a yaml that will run a python script to connect ansible to other software frameworks.

The playbook looks like something along the lines of:

---
- host: all
  tasks:
  - name: Connect to some framework
    script: testscript.py

Is this correct syntax or is there more to add to the yaml file?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
minTwin
  • 1,181
  • 2
  • 21
  • 35
  • 2
    You might have a better chance to get an answer if you don't rely on people guessing the problem. What is actually going wrong when you run this playbook? Please don't replay in comments, edit your question. – Zeitounator Aug 10 '21 at 21:06
  • 1
    Looks right based on https://stackoverflow.com/questions/35139711/running-python-script-via-ansible – OneCricketeer Aug 10 '21 at 22:22

1 Answers1

1

You should probably add the interpreter:

---
- host: all
  tasks:
  - name: Connect to some framework
    script: /path/to/testscript.py
    args:
      executable: /usr/bin/python
Roberto Paz
  • 356
  • 1
  • 8