-
-
Notifications
You must be signed in to change notification settings - Fork 646
drupalvm_user... ansible_ssh_user undefined #1302
Comments
Honestly I'm quite confused as to how this could happen. Could you hack drupalvm_user: "{{ ansible_ssh_user | default(ansible_env.SUDO_USER, true) | default(ansible_env.USER, true) | default(ansible_user_id) }}" to drupalvm_user: "{{ ansible_ssh_user | default(ansible_env.SUDO_USER, true) | default(ansible_env.USER, true) | default(ansible_user_id, true) }}" Does that by any chance fix it? |
I am still getting the error with that change. |
Wonder if it's because you're running python3 and this is an ansible bug. Could you install python 2 with |
It seems that I already have that package installed. |
Would you mind posting your |
Could you log in to VM and check which version of ansible is installed? |
If this is indeed the issue, you can pin a specific ansible version by adding a config.vm.provisioners[0].config.install_mode = 'pip'
config.vm.provisioners[0].config.version = '2.2.2.0' You might have to uninstall the existing ansible from the VM ( |
Ansible 2.2.2.0
Ansible 2.2.1.0
Ansible 2.3.0.0
Ansible 2.3.0.0
So I don't think switching to |
I can confirm this bug exists when using
@jonnyeom could you check if it works if you uninstall ansible config.vm.provisioners[0].config.install_mode = 'pip' |
@oxyc I uninstalled ansible and added the |
Great! That's some weird bug right there. I don't see a way we can fix it though. @geerlingguy should we dig deeper and see why it works with |
It seems this is definitely due to a change in Ansible itself, see: ansible/ansible#23530 |
Also why isn't undefined being caught by |
@oxyc - It's weird... the behavior of |
That only returns For now, this specific bug only seem to occur when you're running Ubuntu 12.04 and Uninstall ansible vagrant ssh -c 'sudo apt-get remove ansible' and add a Vagrantfile.local with config.vm.provisioners[0].config.install_mode = 'pip' |
That sounds like a decent enough workaround. One other question, though—shouldn't drupal-vm/provisioning/vars/main.yml Line 8 in 2997dc9
ansible_user and not ansible_ssh_user ?
|
Yes, even if it wont fix the bug, it should be updated. Also, if we depend on environment variables (which I think we probably could) this is also be fixable with: drupalvm_user: "{{ ansible_env.SUDO_USER | default(ansible_env.USER, true) | default(ansible_user_id) }}" If running through sudo this would return the |
@oxyc - For that change... I would want to do a little extra testing to confirm it doesn't change any existing configurations; I do think relying on the env vars would be more stable than |
Issue #1302: Remove ansible_ssh_user variable to avoid upstream bugs
Going to tentatively mark this as fixed, as I've merged the PR. I will do a little testing really quick on prod.drupalvm.com and verify it doesn't cause any changes. |
When using ansible-local, the ansible_env.USER variable is set to root instead of the user you're sshing as. Instead, use ansible_env.SUDO_USER as seen here: geerlingguy/drupal-vm#1302 (comment)
ERROR: ``` The task includes an option with an undefined variable. The error was: 'ansible_user' is undefined ``` - ref. ansible/ansible#23530 - ref. geerlingguy/drupal-vm#1302
* ➕ Added fzf package in common role. * 💚 Fixed error 'ansible_user' is undefined. ERROR: ``` The task includes an option with an undefined variable. The error was: 'ansible_user' is undefined ``` - ref. ansible/ansible#23530 - ref. geerlingguy/drupal-vm#1302
Issue Type
Your Environment
Your OS
Full console output
Summary
On Vagrant Up, the provisioning errors out on the Ensure composer directory exists Task.
The error has been pasted above.
This seems to be a duplicate of an older issue, #533.
Any thoughts?
The text was updated successfully, but these errors were encountered: