In fact, the file is created in /rppt. It's ok :)
Matt Le lundi 24 décembre 2018 14:46:45 UTC+1, COUSSI Matthieu a écrit : > > Hi, > > I want to execute a command if a file exist. > > The script juste create a file in the same folder. > #/bin/sh > > > touch test.txt > > > > Ansible execute module below. > --- > # Vérification > - name: Vérification si le script existe > stat: > path: "/tmp/test.sh" > register: file_exist > > > # Exécution > - name: Exécution du script si il existe > shell: "/tmp/test.sh" > when: file_exist.stat.exists > > ... > > This is the result on screen > TASK [LINUX_test : Vérification si le script existe] > ********************************************************************************************* > ok: [test1] > > > TASK [LINUX_test : Exécution du script si il existe] > ********************************************************************************************* > changed: [test1] > > > > But the script doesn't create the file in the same folder. > > Do you have an idea? > > Thanks for your help, > > Matt > -- 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/75f15c8a-cffc-4d61-9a6e-cebff681b865%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
