nodejs/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Tue, 09 Jun 2020 19:23:44 -0500
changeset 41 b2ee28d1694c
parent 12 80a6e9af6aa9
child 144 267d58c0e186
permissions -rw-r--r--
Added nginx dep to html-root.

---

- name: download and unarchive nodejs
  become: yes
  unarchive:
    src: "{{nodejs_src}}"
    dest: "/opt/"
    remote_src: yes
    creates: "/opt/{{nodejs_dir}}"
    owner: "root"
    group: "root"

# 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"