Closed magick93 closed 5 years ago
The error clearly states that the location where you are trying to install NVM doesn't exist. Does the user "user"
home directory actually exist on the machine you are targeting? The role looks for the directory via an Ansible environment variable "{{ansible_env.HOME}}/.nvm"
and attempts to install it there.
Run this command on your machine cut -d: -f1 /etc/passwd | sort
If user
isn't in that list then that is the issue.
sys
...
systemd-timesync
usbmux
<-- missing
uucp
uuidd
whoopsie
www-data
Let me know.
Yes, that user user
does exist.
Thanks
Ok. Can you ensure that the user that is running the task is actually the "user" user?
You an add a command task to the playbook.
- name: Who AM I
command: whoami
Does the user directory have the correct permissions?
755 rwxr-xr-x
What OS are you trying to provision on?
Yes, it is the user
user who is running the playbook.
I am debugging, using:
- name: get the username running the deploy
become: false
local_action: command whoami
register: username_on_the_host
- debug: var=username_on_the_host
which produces:
ok: [127.0.0.1] => {
"username_on_the_host": {
"changed": true,
"cmd": [
"whoami"
],
"delta": "0:00:00.001775",
"end": "2019-02-21 15:49:09.958252",
"failed": false,
"rc": 0,
"start": "2019-02-21 15:49:09.956477",
"stderr": "",
"stderr_lines": [],
"stdout": "user",
"stdout_lines": [
"user"
]
}
}
I am able to proceed with using the ansible-role-nvm by preceding it wtih:
- name: Creates directory
file:
path: /home/user/.nvm
state: directory
What OS are you trying to provision on?
Ubuntu 18.10.
Ok, this has not been tested on Ubuntu 18.10 yet so I will have to look into it this weekend.
Glad you found a work around. In fact it's probably a good idea for the role to test if the .nvm directory exists before hand before trying to install. So, I will investigate the issue and update the role accordingly.
Addressed in PR#4
Hello
When I run this role, using:
I get the following: