diff options
| author | Luke Hoersten <[email protected]> | 2020-02-09 12:05:37 -0600 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2020-02-09 12:05:37 -0600 |
| commit | 1cb30cc0aa4fda9bf0bac0b41ace862b1db434b8 (patch) | |
| tree | e4b27462ba4b8b249bb5eaac4b4be0006ca0392c /nodejs | |
| parent | 195a4a3fcf65bf47ecb1a0ea2a9fb070c18eb20f (diff) | |
Moved roles to top level
Diffstat (limited to 'nodejs')
| -rw-r--r-- | nodejs/defaults/main.yaml | 7 | ||||
| -rw-r--r-- | nodejs/tasks/main.yaml | 21 |
2 files changed, 28 insertions, 0 deletions
diff --git a/nodejs/defaults/main.yaml b/nodejs/defaults/main.yaml new file mode 100644 index 0000000..a67e2ab --- /dev/null +++ b/nodejs/defaults/main.yaml @@ -0,0 +1,7 @@ +--- + +nodejs_tag: "latest-v11.x" +nodejs_version: "11.15.0" +nodejs_arch: "{{ansible_architecture}}" +nodejs_dir: "node-v{{nodejs_version}}-{{ansible_system | lower}}-{{nodejs_arch}}" +nodejs_src: "https://nodejs.org/dist/{{nodejs_tag}}/{{nodejs_dir}}.tar.gz" diff --git a/nodejs/tasks/main.yaml b/nodejs/tasks/main.yaml new file mode 100644 index 0000000..6972e76 --- /dev/null +++ b/nodejs/tasks/main.yaml @@ -0,0 +1,21 @@ +--- + +- name: download and unarchive nodejs + become: yes + unarchive: + src: "https://nodejs.org/dist/{{nodejs_tag}}/{{nodejs_dir}}.tar.xz" + dest: "/opt/" + remote_src: yes + creates: "/opt/{{nodejs_dir}}" + +# sudo update-alternatives --install "/usr/bin/node" "node" "/opt/node/bin/node" 1 +- name: update node alterantives + become: yes + alternatives: + link: "/usr/bin/{{item}}" + name: "{{item}}" + path: "/opt/{{nodejs_dir}}/bin/{{item}}" + priority: "1" + with_items: + - "node" + - "npm" |
