nodejs/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Sun, 09 Feb 2020 20:56:26 -0600
changeset 6 3b1f18f6a5a4
parent 2 2556522a2a45
child 12 80a6e9af6aa9
permissions -rw-r--r--
Updated prometheus roles. WIP psql, nginx exporters.

---

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