title: ansible remote_user as root
body: <p>I want to get started with ansible and there is a simple thing I dont get:</p>
  
  <pre><code>flipl@sun ~ % ansible -vvvv -m ping t420
  SUDO password: 
  &lt;t420.beach.lan&gt; ESTABLISH CONNECTION FOR USER: flipl
  &lt;t420.beach.lan&gt; REMOTE_MODULE ping
  &lt;t420.beach.lan&gt; EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/flipl/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 t420.beach.lan /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1454775840.71-251439732457316 &amp;&amp; chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1454775840.71-251439732457316 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1454775840.71-251439732457316'
  &lt;t420.beach.lan&gt; PUT /tmp/tmp1fqFHM TO /home/flipl/.ansible/tmp/ansible-tmp-1454775840.71-251439732457316/ping
  &lt;t420.beach.lan&gt; EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/flipl/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 t420.beach.lan /bin/sh -c 'LANG=C LC_CTYPE=C /usr/bin/python /home/flipl/.ansible/tmp/ansible-tmp-1454775840.71-251439732457316/ping; rm -rf /home/flipl/.ansible/tmp/ansible-tmp-1454775840.71-251439732457316/ &gt;/dev/null 2&gt;&amp;1'
  t420.beach.lan | success &gt;&gt; {
  "changed": false, 
  "ping": "pong"
  }
  
  flipl@sun ~ % su -
  Password: 
  Last login: Sa Feb  6 17:22:40 CET 2016 on pts/0
  
  [root@sun ~]# ansible -vvvv -m ping t420 -u flipl
  SUDO password: 
  &lt;t420.beach.lan&gt; ESTABLISH CONNECTION FOR USER: flipl
  &lt;t420.beach.lan&gt; REMOTE_MODULE ping
  &lt;t420.beach.lan&gt; EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=flipl -o ConnectTimeout=10 t420.beach.lan /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1454775858.05-125216053853458 &amp;&amp; chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1454775858.05-125216053853458 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1454775858.05-125216053853458'
  t420.beach.lan | FAILED =&gt; SSH Error: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
  while connecting to 192.168.0.100:22
  It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.
  </code></pre>
  
  <p>Do I miss something particular in using ansible? </p>
  
  <p>The aim, I want to achieve, is that only root can execute playbooks (why is there a SUDO Password prompt but it doesnt matter, what I put in there). Due to security, root-access via ssh is not allowed.
  So I wanted to play around with executing playbooks/ansible commands as root, using ssh with a client-Login and becoming root again for package installation.</p>
  
  <p>But as you can see, I have already problems with simple tasks :(</p>
  
  <p>I already tried to edit my inventory file:</p>
  
  <pre><code>[t420]
  flipl@t420.beach.kan
  t420.beach.lan ansible_ssh_user=flipl
  </code></pre>
  
  <p>Any help will be apreciated!</p>
  
  <p>thanks,
  pwe</p>