nvm #25

Merged
noah.knegt merged 3 commits from nvm into master 2023-04-06 10:38:58 +02:00
13 changed files with 101 additions and 0 deletions
Showing only changes of commit f7a7e6f967 - Show all commits

View File

@@ -0,0 +1,13 @@
# ===================================================================================================
# ? ABOUT
# @author : Noah Knegt
# @email : personal@noahknegt.com
# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations
# @createdOn : 06-04-2023
# @description : This will check if nvm is installed as the latest version.
# ===================================================================================================
---
- name: Check nvm version
shell: nvm --version
register: nvm_version

View File

@@ -0,0 +1,22 @@
# ===================================================================================================
# ? ABOUT
# @author : Noah Knegt
# @email : personal@noahknegt.com
# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations
# @createdOn : 06-04-2023
# @description : This will cleanup the system.
# ===================================================================================================
---
- name: Cleanup
file:
path: "{{ item }}"
state: absent
with_items:
- /tmp/nvm-install.sh
- /tmp/nvm-install.log
- /tmp/nvm-install.out
- /tmp/nvm-install.err
- /tmp/nvm-install.debug
- /tmp/nvm-install.info
- /tmp/nvm-install.warn

View File

@@ -0,0 +1,16 @@
# ===================================================================================================
# ? ABOUT
# @author : Noah Knegt
# @email : personal@noahknegt.com
# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations
# @createdOn : 06-04-2023
# @description : This will download the nvm install script.
# ===================================================================================================
---
- name: Download nvm
get_url:
url: https://raw.githubusercontent.com/nvm-sh/nvm/{{ nvm_latest_version.stdout }}/install.sh
dest: /tmp/nvm-install.sh
mode: 0755
when: nvm_version.stdout != nvm_latest_version.stdout

View File

@@ -0,0 +1,13 @@
# ===================================================================================================
# ? ABOUT
# @author : Noah Knegt
# @email : personal@noahknegt.com
# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations
# @createdOn : 06-04-2023
# @description : This will get the latest version of nvm.
# ===================================================================================================
---
- name: Get the latest nvm version
shell: curl -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | grep tag_name | cut -d '"' -f 4
register: nvm_latest_version

View File

@@ -0,0 +1,15 @@
# ===================================================================================================
# ? ABOUT
# @author : Noah Knegt
# @email : personal@noahknegt.com
# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations
# @createdOn : 06-04-2023
# @description : This will install nvm as the latest version.
# ===================================================================================================
---
- name: Install nvm
shell: /tmp/nvm-install.sh
args:
creates: /home/noahk/.nvm
when: nvm_version.stdout != nvm_latest_version.stdout

View File

@@ -1,2 +1,9 @@
---
# tasks file for nvm
- import_tasks: check_installed.yml
- import_tasks: get_version.yml
- import_tasks: download.yml
- import_tasks: install.yml
- import_tasks: cleanup.yml