From fb83eeb140eb32c641e8c1f5450673f1e23fa8a6 Mon Sep 17 00:00:00 2001 From: Joel Parker Henderson Date: Wed, 19 Dec 2018 12:45:59 -0800 Subject: [PATCH] [Docs] Add Ansible task example Add Ansible task example to show how to install nvm and update it. Ansible is a systems administration tool. See https://github.com/ansible/ansible My personal experience of `nvm` is that installing via Ansible is good, and that a good example can help. This example took me about an hour to learn, so I'm hoping to save other people some time. This example is somewhat different than any others that I found on the web. There may be a better way to write it, and if so, please improve it. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index b62cc26..820fa80 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ - [Installation](#installation) - [Install script](#install-script) + - [Ansible](#ansible) - [Verify installation](#verify-installation) - [Important Notes](#important-notes) - [Git install](#git-install) @@ -91,6 +92,17 @@ If the above doesn't fix the problem, open your `.bash_profile` and add the foll - For more information about this issue and possible workarounds, please [refer here](https://github.com/creationix/nvm/issues/576) +#### Ansible + You can use a task: + +``` +- name: nvm + shell: > + curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash + args: + creates: "{{ ansible_env.HOME }}/.nvm/nvm.sh" +``` + ### Verify installation To verify that nvm has been installed, do: