Using playbook|command line|included vars in inventory vars

I have a situation where it would be helpful to utilize included/playbook variables within inventory variables. For instance;

[ group_vars/lab.yml ]

Variables are late bound, but I’m curious how you are deciding that it’s not substituting.

name lines don’t show things in inventory scope as they differ between hosts.

Michael,

My version of ansible is -master (currently 1.4). I realized it wasn’t substituting by testing with and without the variable. So for instance;

[ group_vars/lab.yml ]

I don’t know where you expect remote_user to be coming from.

Did you mean “ansible_ssh_user” ?

Also did you want a literal “+” in the filename?

In any event, ‘ansible_ssh_user’ is basically an input variable based on who you connect to, and I wouldn’t expect you could use it there.

It would not make sense to put that in inventory because you might connect as a variety of users.

Michael,

remote_user was a bad example. I am really trying to substitute an INCLUDED or PLAYBOOK variable inside of an inventory variable. Here’s a better example:

[group_vars/lab.yml]

Please open a github ticket with a linked gist or playbook that reproduces this in hello-world kind of form and I can see if I can reproduce this.

Thanks!