Re: [ansible-project] sudo(become) difference between "copy" module and "command" module

2020-06-09 Thread Mukuntha rajaa
Hello, Thanks a lot. Its clear now. I have used "remote_src" to apply "become" logic. Regards, Mukuntha. On Tue, 9 Jun 2020 at 12:29, Luca 'remix_tj' Lorenzetto < lorenzetto.l...@gmail.com> wrote: > Hello, > > but become applies on target host, not controller. And, as stated > before, in the fi

Re: [ansible-project] sudo(become) difference between "copy" module and "command" module

2020-06-08 Thread Luca 'remix_tj' Lorenzetto
Hello, but become applies on target host, not controller. And, as stated before, in the first playbook you're copying with cp sshd_config of the remote host to /tmp/sshd_config. Instead in the second one you're copying sshd_config from controller to /tmp/sshd_config of the remote host. Even if the

Re: [ansible-project] sudo(become) difference between "copy" module and "command" module

2020-06-08 Thread Mukuntha rajaa
Hello, Which is why I've mentioned "become: yes" option. Like I've mentioned in starting of this thread, if I run the exact same playbook with "command" module, permission issue does not come. Only with "copy" module, it complains about permission issue. Please note I've used "become" in both the

Re: [ansible-project] sudo(become) difference between "copy" module and "command" module

2020-06-08 Thread James Cassell
> On Mon, 8 Jun, 2020, 10:54 pm James Cassell, > wrote: > > > > On Mon, Jun 8, 2020, at 11:25 AM, Mukuntha rajaa wrote: > > > Hello, > > > > > > "become" works perfectly fine with "command" module. But not with > > > "copy" module. Am I doing something wrong here. > > > > > > *_Work

Re: [ansible-project] sudo(become) difference between "copy" module and "command" module

2020-06-08 Thread Mukuntha rajaa
Thanks for your email. This playbook is for testing purpose. I wanted src to be from controller only. On Mon, 8 Jun, 2020, 10:54 pm James Cassell, wrote: > > On Mon, Jun 8, 2020, at 11:25 AM, Mukuntha rajaa wrote: > > Hello, > > > > "become" works perfectly fine with "command" module. But not wi

Re: [ansible-project] sudo(become) difference between "copy" module and "command" module

2020-06-08 Thread James Cassell
On Mon, Jun 8, 2020, at 11:25 AM, Mukuntha rajaa wrote: > Hello, > > "become" works perfectly fine with "command" module. But not with > "copy" module. Am I doing something wrong here. > > *_Working playbook:_* > - name: demo > hosts: localhost > tasks: > - name: copy > command: cp /etc/s

[ansible-project] sudo(become) difference between "copy" module and "command" module

2020-06-08 Thread Mukuntha rajaa
Hello, "become" works perfectly fine with "command" module. But not with "copy" module. Am I doing something wrong here. *Working playbook:* - name: demo hosts: localhost tasks: - name: copy command: cp /etc/ssh/sshd_config /tmp/sshd_config become: yes - name: edit