title: Not able to switch user in ansible
body: <p>We have a system where we have user A and user B. We can switch to user B from A using "sudo su" command only. Direct login to B user is not allowed.</p>
  
  <p>Now From Ansible master, we can login to A user (as ansible remote user) successfully. Our use case is, We have to run some commands as user B using ansible. But we are failing to switch to B user and run those commands. </p>
  
  <p>Our yml file looks like -</p>
  
  <h1>Module to copy java to the target host.</h1>
  
  <pre><code>- name: Copying Java jdk1.8.0_192
    remote_user: A
    become_user: B
    become: true
    become_method: su
    copy:
      src: /etc/ansible/jboss7-cluster/raw_template/jdk1.8.0_192.zip
      dest: "{{ java_install_dir }}"
  </code></pre>
  
  <p>Any inputs?</p>