title: You need to be root to execute - ansible
body: <p>I have a lab setup with ansible controller + node and exploring few areas.</p>
  
  <p>I am so far setup an user account named <code>ansible</code> in both machines and enabled ssh keybased authentication</p>
  
  <p>Also setup sudo premissions for the user in both machines</p>
  
  <p>When I try to run the below playbook , It works on the local machine and fails on the other node.</p>
  
  <p><code>--- #Install Telnet
  - hosts: all
    name: Install Telnet
    become: true
    become_user: ansible
    become_method: sudo
    tasks:
     - yum:
        name: telnet
        state: latest</code></p>
  
  <p>Output is as follows 
  `[ansible@host1 playbooks]$ ansible-playbook telnetDeployYUM.yml</p>
  
  <p>PLAY [Install Telnet] ***********************************************************************************************************************************************************************</p>
  
  <p>TASK [Gathering Facts] **********************************************************************************************************************************************************************
  ok: [192.168.64.6]
  ok: [192.168.64.5]</p>
  
  <p>TASK [yum] **********************************************************************************************************************************************************************************
  ok: [192.168.64.5]
  fatal: [192.168.64.6]: FAILED! => {"changed": true, "msg": "You need to be root to perform this command.\n", "obsoletes": {"grub2": {"dist": "x86_64", "repo": "@anaconda", "version": "1:2.02-0.64.el7.centos"}, "grub2-tools": {"dist": "x86_64", "repo": "@anaconda", "version": "1:2.02-0.64.el7.centos"}}, "rc": 1, "results": ["Loaded plugins: fastestmirror\n"]}
          to retry, use: --limit @/home/ansible/playbooks/telnetDeployYUM.retry</p>
  
  <p>PLAY RECAP **********************************************************************************************************************************************************************************
  192.168.64.5               : ok=2    changed=0    unreachable=0    failed=0
  192.168.64.6               : ok=1    changed=0    unreachable=0    failed=1</p>
  
  <p>[ansible@host1 playbooks]$
  `</p>
  
  <p>I could also manually able to run <code>sudo yum</code> on the failed target as ansible user</p>
  
  <p>I believe sudo set up in correct </p>
  
  <p><code>[ansible@host2 root]$ sudo whoami
  root
  </code></p>
  
  <p>Can experts share some insights on what I am missing with respect to my failed machine , Thanks.</p>