|
1 | 1 | ---
|
2 |
| -- name: Rename nodejs directory |
| 2 | +- name: Remove old toolchain |
3 | 3 | become: true
|
4 |
| - command: mv {{ nodejs_toolchain_dest }}/{{ toolchain_top_level_directory }} {{ nodejs_toolchain_dest }}/node |
5 |
| - args: |
6 |
| - creates: "{{ nodejs_toolchain_dest }}/node" |
7 |
| - when: toolchain_top_level_directory is defined |
| 4 | + file: |
| 5 | + path: "{{ nodejs_toolchain_final_dest }}" |
| 6 | + state: absent |
| 7 | + when: |
| 8 | + - toolchain_archive_contents.changed |
| 9 | + |
| 10 | +- name: Move nodejs directory from tmp to opt |
| 11 | + become: true |
| 12 | + command: mv /tmp/{{ toolchain_top_level_directory }} {{ nodejs_toolchain_final_dest }} |
| 13 | + when: |
| 14 | + - toolchain_archive_contents.changed |
| 15 | + |
| 16 | +- name: Create version file |
| 17 | + become: true |
| 18 | + copy: |
| 19 | + content: "{{ nodejs_toolchain_version }}" |
| 20 | + dest: "{{ nodejs_toolchain_final_dest }}/toolchain_version" |
8 | 21 |
|
9 | 22 | - name: Create node symlink
|
10 | 23 | become: true
|
11 | 24 | file:
|
12 |
| - src: "{{ nodejs_toolchain_dest }}/node/bin/node" |
| 25 | + src: "{{ nodejs_toolchain_final_dest }}/bin/node" |
13 | 26 | dest: /usr/local/bin/node
|
14 | 27 | state: link
|
15 | 28 |
|
16 | 29 | - name: Create npm symlink
|
17 | 30 | become: true
|
18 | 31 | file:
|
19 |
| - src: "{{ nodejs_toolchain_dest }}/node/bin/npm" |
| 32 | + src: "{{ nodejs_toolchain_final_dest }}/bin/npm" |
20 | 33 | dest: /usr/local/bin/npm
|
21 | 34 | state: link
|
22 | 35 |
|
23 | 36 | - name: Create npx symlink
|
24 | 37 | become: true
|
25 | 38 | file:
|
26 |
| - src: "{{ nodejs_toolchain_dest }}/node/bin/npx" |
| 39 | + src: "{{ nodejs_toolchain_final_dest }}/bin/npx" |
27 | 40 | dest: /usr/local/bin/npx
|
28 | 41 | state: link
|
29 | 42 |
|
|
32 | 45 | template:
|
33 | 46 | dest: "{{ nodejs_toolchain_npmrc_dest }}"
|
34 | 47 | src: npmrc.j2
|
35 |
| - |
36 |
| -- include_tasks: setup-Debian.yml |
37 |
| - when: ansible_os_family == "Debian" |
38 |
| - |
39 |
| -- include_tasks: setup-Darwin.yml |
40 |
| - when: ansible_os_family == "Darwin" |
|
0 commit comments