user: root ignored when running on hosts:localhost ?

Hi,

I´m using Ansible 1.8.2 running on Virtualbox (CentOs6.5) with this small playbook:

`

  • name: Test playbook for roles/jdk
    hosts: localhost
    user: root

vars:
jdk_root: /tmp/opt/java

roles:

  • { role: jdk, jdk_version: “1.8.0_40” }

`

The role looks like:

`

remote_user( which is what the deprecated 'user' sets) is ignored on
connection: local as there is no 'remote login', you can either force
to ssh to localhost as root with connection: ssh or you can use
become: true to use sudo to become root locally.