Hi Vince,

script will delete your script on it's own after executing it, similar to 
other modules. 

https://github.com/ansible/ansible/blob/0461620b2ddc7e8c0bf00bf8b7b95edd3a4c109c/lib/ansible/plugins/action/script.py#L144

On Thursday, August 2, 2018 at 1:51:05 PM UTC+5:30, Vincent Descargues 
wrote:
>
> Hello, 
>
> I would like to know how it is possible with a command to be able to both 
> transfer execute and delete a python script via a playbook. Currently I do 
> it in 3 lines: 1) Transfer 2) Execute 3) Delete.
>
> I could see on different forum that we could use the function "script"
>
>
> My current playbook :
> hosts: host
> - name: download python script
> copy: 
> src: /etc/ansible/xxxx/python.py 
> dest: /etc/sssd/ 
> - name: execute python script 
> command: python /etc/sssd/python.py 
> - name: delete python script 
> command: rm /etc/sssd/python.py
>
>
>
>
> In fact, I would like to be able to transfer the python script, execute it 
> and delete it because I do not want to store it on the machine where it 
> runs.
>
>
> (example command "script" find on internet) I tried it but it does not 
> work :
>
> - hosts: my-servers sudo: true tasks: - script: 
> /home/stuart/scripts/setup.sh --creates /home/stuart/installed-git.txt
>
> Thanks a lot for answer.
>
> Vincent
>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ac362fa4-6327-4c37-a0db-f84400d188ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to