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?

2
  • 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. Commented Aug 10, 2021 at 21:06
  • 1
    Looks right based on stackoverflow.com/questions/35139711/… Commented Aug 10, 2021 at 22:22

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

1 Comment

You should pass the python binary to args.executable

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.