You're right, it's useless. I missed to remove it after my latest test. And 
I past on the post unfortunately. 
Anyway the same issue happened without sudo.. I'm pretty sure 
I can't make a test at the moment, anyway I will be home in an hours to 
prove that.  


Il giorno martedì 5 marzo 2019 22:40:23 UTC+1, Kai Stian Olstad ha scritto:
>
> On 05.03.2019 11:47, fusillator wrote: 
> > Hi all, I've a very simple role to copy and validate a monit 
> configuration 
> > file 
> > 
> > cat roles/monit_install/tasks/main.yml 
> > - name: copy configuration file 
> >    template: 
> >      mode: 0600 
> >      dest: /etc/monitrc 
> >      src: monitrc.j2 
> >      validate: /usr/bin/sudo /usr/bin/monit -c %s -t 
> > 
>
> <snip /> 
>
> > but it fails when I try to launch it with sudo/become as follows: 
> > (after having removed the file monitrc on server2) 
> > 
> > $ ansible-playbook monit_install.yml --become --ask-become-pass 
> > SUDO password: 
>
> Since you are running the whole playbook with become/sudo there is no need 
> to have sudo in the validate. 
>
> -- 
> Kai Stian Olstad 
>

-- 
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/61970919-971f-404a-bf54-36bfa4b56654%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to