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.
For more options, visit https://groups.google.com/d/optout.