Created
June 7, 2014 02:31
-
-
Save johndstein/4f10ef7b692df9f7d7b6 to your computer and use it in GitHub Desktop.
Ansible task to install nvm and node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here is how to install nvm and node in an Ansible task. | |
# I tried a bunch of different things, and as usual it's simple, but you have to get it right. | |
# The important part is that you have to shell with /bin/bash -c and source nvm.sh | |
--- | |
- name: Install nvm | |
shell: > | |
curl https://raw.githubusercontent.com/creationix/nvm/v0.7.0/install.sh | sh | |
creates=/home/{{ ansible_user_id }}/.nvm/nvm.sh | |
- name: Install node and set version | |
shell: > | |
/bin/bash -c "source ~/.nvm/nvm.sh && nvm install 0.10 && nvm alias default 0.10" | |
creates=/home/{{ ansible_user_id }}/.nvm/alias |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment