Ansible: Why sudo user get permission deny error

I have a ubuntu machine, in which ubuntu user has admin, sudo, etc. permission, so I think ubuntu should have enough permission to copy file.

groups ubuntu
ubuntu : ubuntu adm sudo...

But somehow it could not copy file to /usr/local/bin/, and cannot do other operation which need high level permission, unless I change remote_user to root. I read Ansible document but I am still confused. In fact, I tried become=yes, become_method=sudo, but the only way to make copy work is to set remote_user=root.

Can anybody explain why remote_user=ubuntu cannot copy file to below destination? Thanks,

- name: Copy files
  become_user: ubuntu
  become: yes
    src: abc.txt
    dest: /usr/local/bin/
    owner: xyz
    group: xyz
    mode: '0755'
    remote_src: yes


Differentiable Programming in Kotlin

Airtel Postpaid Plans – All the Details You Need to Know