Remove nvm bash installation
This commit is contained in:
parent
8254bfee9f
commit
aef5ca8138
2 changed files with 9 additions and 34 deletions
|
|
@ -1,35 +1,14 @@
|
||||||
- name: create nvm install directory
|
- set_fact:
|
||||||
|
install_dir: '{{ xdg_config_dir }}/nvm'
|
||||||
|
|
||||||
|
- name: remove manually installed nvm install directory
|
||||||
file:
|
file:
|
||||||
path: '{{ nvm.install_dir }}'
|
path: 'install_dir'
|
||||||
state: directory
|
state: absent
|
||||||
|
|
||||||
- name: register the current nvm version
|
- name: remove nvm entry from bashrc
|
||||||
shell: 'source {{ nvm.install_dir }}/nvm.sh && nvm --version'
|
|
||||||
register: nvm_stats
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: parse the current nvm version
|
|
||||||
set_fact:
|
|
||||||
nvm_installed_version: nvm_stats.stdout
|
|
||||||
when: nvm_stats.rc == 0
|
|
||||||
|
|
||||||
- name: download nvm {{ nvm.version }}
|
|
||||||
get_url:
|
|
||||||
url: 'https://raw.githubusercontent.com/nvm-sh/nvm/{{ nvm.version }}/install.sh'
|
|
||||||
dest: '/tmp/nvm-{{ nvm.version }}-install.sh'
|
|
||||||
when: nvm_stats.rc > 0 or nvm_installed_version != nvm.version
|
|
||||||
register: nvm_download
|
|
||||||
|
|
||||||
- name: install nvm {{ nvm.version }}
|
|
||||||
ansible.builtin.command: 'bash /tmp/nvm-{{ nvm.version }}-install.sh'
|
|
||||||
environment:
|
|
||||||
PROFILE: /dev/null
|
|
||||||
NVM_DIR: '{{ nvm.install_dir }}'
|
|
||||||
args:
|
|
||||||
creates: '{{ nvm.install_dir }}/nvm.sh'
|
|
||||||
|
|
||||||
- name: ensure nvm gets loaded
|
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: '{{ ansible_env.HOME }}/.bashrc.override'
|
path: '{{ ansible_env.HOME }}/.bashrc.override'
|
||||||
line: >
|
line: >
|
||||||
[ -s "{{ nvm.install_dir }}/nvm.sh" ] && \. "{{ nvm.install_dir }}/nvm.sh" # This loads nvm
|
[ -s "{{ install_dir }}/nvm.sh" ] && \. "{{ install_dir }}/nvm.sh" # This loads nvm
|
||||||
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,3 @@ python_versions:
|
||||||
- { version: 3.8.14, path: 'python3.8', binary: 'python3.8' }
|
- { version: 3.8.14, path: 'python3.8', binary: 'python3.8' }
|
||||||
- { version: 3.7.14, path: 'python3.7', binary: 'python3.7' }
|
- { version: 3.7.14, path: 'python3.7', binary: 'python3.7' }
|
||||||
- { version: 3.6.15, path: 'python3.6', binary: 'python3.6' }
|
- { version: 3.6.15, path: 'python3.6', binary: 'python3.6' }
|
||||||
|
|
||||||
nvm:
|
|
||||||
install_dir: '{{ xdg_config_dir }}/nvm'
|
|
||||||
version: 'v0.40.0'
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue