I am getting troubles to execute a python script using ansible.
I have the next ansible structure:
python_project
roles
prueba
files
prueba.py
tasks
prueba.yaml
My yaml is the following one:
- name: prueba script python playbook
hosts: localhost
tasks:
- name: run prueba.py
script: prueba.py
I execute it like this: ansible-playbook prueba.yaml and I get the following error:
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Could not find or
access 'prueba.py'\n
Searched in:\n\t/root/python_project/roles/prueba/tasks/files/pr ueba.py\n\t/root/python_project/roles/prueba/tasks/prueba.py\n\t/root/python_pro ject/roles/prueba/tasks/files/prueba.py\n\t/root/python_project/roles/prueba/tas ks/prueba.py on the Ansible Controller.\nIf you are using a module and expect th e file to exist on the remote, see the remote_src option"}
Any suggestion?