I found one solution to with delegate_to option to run on the task on
particular server.

Regards

On Wed, Jun 21, 2023 at 10:23, Prady A <[email protected]> wrote:

> Hi all
>
> I want to execute a python script which is available in control node. And
> the python script uses the ansible_hostname variable and update in an excel
> template available in the control node.
>
>
> My role is very simple:
> - name: execute python script
>    script: ./roles/writetoexcel.py {{ ansible_hostname }}
>    args:
>         executable: python3
>
> Since this role executes the python file in the remote node it is failing.
> Python3 command not found.. my intention is to run this python script in
> the control node for all the hosts and just use the ansible_hostname
> variable from ansible to update the excel which is also available in local.
>
> Regards
> Prady
>

-- 
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/CAEuB3AqeXO%2Bjk4-QaQCCa7h3xz3AK9O9f5zPonRoaaqE4%3DqVpA%40mail.gmail.com.

Reply via email to