roles/nodejs/tasks/main.yaml
changeset 0 df042396074e
equal deleted inserted replaced
-1:000000000000 0:df042396074e
       
     1 ---
       
     2 
       
     3 - name: download and unarchive nodejs
       
     4   become: yes
       
     5   unarchive:
       
     6     src: "https://nodejs.org/dist/{{nodejs_tag}}/{{nodejs_dir}}.tar.xz"
       
     7     dest: "/opt/"
       
     8     remote_src: yes
       
     9     creates: "/opt/{{nodejs_dir}}"
       
    10 
       
    11 # sudo update-alternatives --install "/usr/bin/node" "node" "/opt/node/bin/node" 1
       
    12 - name: update node alterantives
       
    13   become: yes
       
    14   alternatives:
       
    15     link: "/usr/bin/{{item}}"
       
    16     name: "{{item}}"
       
    17     path: "/opt/{{nodejs_dir}}/bin/{{item}}"
       
    18     priority: "1"
       
    19   with_items:
       
    20     - "node"
       
    21     - "npm"