Last active
August 29, 2015 14:22
-
-
Save jeff-minard-ck/011c7966d765aad38efe to your computer and use it in GitHub Desktop.
example
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
[INFO ] Executing command '/bin/bash -c "source ~/.nvm/nvm.sh; nvm ls v0.10.32 | grep \'N/A\'"' as user 'vagrant' in directory '/home/vagrant' | |
[DEBUG ] output: /bin/bash: /root/.nvm/nvm.sh: Permission denied | |
/bin/bash: nvm: command not found |
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
# | |
# Node.js & NVM SLS | |
# | |
{%- set node_version = 'v0.10.32' %} | |
{%- set node_stable = 'v0.12.0' %} | |
{%- set nvm_version = 'v0.25.4' %} | |
include: | |
- git | |
- bash | |
nvm_deps: | |
pkg.installed: | |
- names: | |
- curl | |
- require: | |
- pkg: git | |
- file: bash_rc | |
nvm_install: | |
cmd.run: | |
- name: curl --silent https://raw.githubusercontent.com/creationix/nvm/{{ nvm_version }}/install.sh | bash | |
- unless: test -f /home/vagrant/.nvm/install.sh | |
- user: vagrant | |
- group: vagrant | |
- cwd: /home/vagrant | |
- env: | |
- NVM_DIR: '/home/vagrant/.nvm' | |
- PROFILE: '/home/vagrant/.bashrc' | |
- METHOD: 'script' | |
- require: | |
- pkg: nvm_deps | |
node_stable_install: | |
cmd.run: | |
- name: /bin/bash -c "source ~/.nvm/nvm.sh; nvm install {{ node_stable }} 2>/dev/null && nvm alias stable {{ node_stable }}" | |
- onlyif: /bin/bash -c "source ~/.nvm/nvm.sh; nvm ls {{ node_stable }} | grep 'N/A'" | |
- user: vagrant | |
- group: vagrant | |
- cwd: /home/vagrant | |
- require: | |
- cmd: nvm_install | |
node_install: | |
cmd.run: | |
- name: /bin/bash -c "source ~/.nvm/nvm.sh; nvm install {{ node_version }} 2>/dev/null && nvm alias default {{ node_version }} && nvm use {{ node_version }}" | |
- onlyif: /bin/bash -c "source ~/.nvm/nvm.sh; nvm ls {{ node_version }} | grep 'N/A'" | |
- user: vagrant | |
- group: vagrant | |
- cwd: /home/vagrant | |
- require: | |
- cmd: node_stable_install |
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
# salt-call cmd.run 'echo $HOME' | |
[INFO ] Executing command 'echo $HOME' in directory '/root' | |
local: | |
/root | |
# salt-call cmd.run 'su -c "echo \$HOME" vagrant' | |
[INFO ] Executing command 'su -c "echo \\$HOME" vagrant' in directory '/root' | |
local: | |
/home/vagrant |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment