OK, I think I've catched it. I can reproduce the problem when I override 
the remote user in the playbook file:

- hosts: all
  user: *root*
*...*

In my experience, the precedence rules for the applied ssh remote user are 
following:

   1. ansible_ssh_user in inventory file (or defined as extra 
variable<https://github.com/al3x/sovereign/blob/b77bcdbb0c7fa7e66d4e51e17ed88ede56614fee/Vagrantfile#L32>
   )
   2. *user YAML attribute in playbook file (recently discovered ;-)*
   3. -u / --user ansible-playbook argument (used by Vagrant provisioner)
   4. ANSIBLE_REMOTE_USER environment variable
   5. remote_user paramter in an ansible.cfg file
   6. username of the current user

At the moment, Vagrant behavior can therefore be shadowed by configuration 
1 and 2, which is the origin of this confusion. I'll re-open your pull 
request to evaluate, which strategy makes more sense...

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to