Running Python script via ansible


I’m trying to run a python script from an ansible script. I would think this would be an easy thing to do, but I can’t figure it out. I’ve got a project structure like this:

I’m trying to run within a task in main.yml (which is a role used in release.yml). Here’s the task:

I’ve also tried ../files/ I thought the path for ansible would be relative to the playbook, but I guess not?

I also tried debugging to figure out where I am in the middle of the script, but no luck there either.

That just prints out “.”. So helpful …


try to use script directive, it works for me

my main.yml

and file should be in files in the same role

Leave a Reply