nodejs/tasks/main.yaml
changeset 2 2556522a2a45
parent 0 df042396074e
child 12 80a6e9af6aa9
equal deleted inserted replaced
1:fd351734f007 2:2556522a2a45
       
     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"