I'm using
nvm
nvm install [version]
command
shell
become
become_user
sudo -iu
source nvm.sh
nvm
You'll need to use the shell
module, because you want to run shell commands, and you'll need to source in the nvm
script into that environment. Something like:
- shell: |
source /path/to/nvm
nvm install ...
Whether or not you use become
depends on whether or not you want to run the commands as root
(or another user).