Dimitri The only resonable explanation is, that you have something with the PATH env variable (btw what is the remote OS?). Try this: 1. Login to remote machine and switch to root. Send me an output of 'echo $PATH' and 'which rndc' 2. run the same playbook with tasks: - shell: "'echo $PATH'" register: path - debug: var=path
If it's possible, send me the dnscopy.pl script Piotr wt., 4 gru 2018 o 19:49 Dimitri Yioulos <[email protected]> napisaĆ(a): > Piotr, > > After putting in the directives you mentioned, if I leave become_method: > su and become_flags: '-' in the playbook, then the playbook is stuck/runs > without completion. If I take those out, leaving only become: yes, then I > get the following output: > > ok: [admin1] => { > "who": { > "changed": true, > "cmd": "whoami", > "delta": "0:00:00.006895", > "end": "2018-12-04 13:32:06.805245", > "rc": 0, > "start": "2018-12-04 13:32:06.798350", > "stderr": "", > "stderr_lines": [], > "stdout": "root", > "stdout_lines": [ > "root" > ] > } > } > > If I run the script on the remote host *without* su - root, I get: > > Can't exec "rndc": No such file or directory at ./dnscopy.pl line 296. > rndc -s dns1 reload failed: No such file or directory at ./dnscopy.pl > line 296. > > If I run the script on the remote host with su - root, I get: > > server reload successful > > > On Monday, December 3, 2018 at 11:44:08 AM UTC-5, Dimitri Yioulos wrote: >> >> Hey, all. >> >> I need to run a script residing on the remote machine with a switch, as >> in "/scripts/myscript -f" (it must be executed by root). I'm using the >> shell module, but can find no way to add the switch without the play >> failing. Help would be appreciated. >> >> Dimitri >> > -- > 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/8667307d-c3ee-4c1f-b631-76a11db678b2%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/8667307d-c3ee-4c1f-b631-76a11db678b2%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CACHJvyPRLmNYLy%3DUUVJ6rLa9vVSOjxwCRzHXOCTgh78Bz_NJkQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
