@@ -1,2 +0,0 @@
|
||||
---
|
||||
# defaults file for nvm
|
@@ -1,2 +0,0 @@
|
||||
---
|
||||
# handlers file for nvm
|
@@ -1,20 +0,0 @@
|
||||
# ===================================================================================================
|
||||
# ? 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
|
||||
become: true
|
||||
become_user: noahk
|
||||
become_method: su
|
||||
become_flags: '--login'
|
||||
vars:
|
||||
ansible_become_pass: "{{ noahk_password }}"
|
||||
register: nvm_version
|
||||
ignore_errors: true
|
@@ -1,22 +0,0 @@
|
||||
# ===================================================================================================
|
||||
# ? 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
|
@@ -1,16 +0,0 @@
|
||||
# ===================================================================================================
|
||||
# ? 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 or nvm_version.stdout == ""
|
@@ -1,13 +0,0 @@
|
||||
# ===================================================================================================
|
||||
# ? 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
|
@@ -1,19 +0,0 @@
|
||||
# ===================================================================================================
|
||||
# ? 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
|
||||
become: true
|
||||
become_user: noahk
|
||||
become_method: su
|
||||
become_flags: '--login'
|
||||
vars:
|
||||
ansible_become_pass: "{{ noahk_password }}"
|
||||
when: nvm_version.stdout != nvm_latest_version.stdout or nvm_version.stdout == ""
|
@@ -1,9 +0,0 @@
|
||||
---
|
||||
- import_tasks: check_installed.yml
|
||||
- import_tasks: get_version.yml
|
||||
|
||||
- import_tasks: download.yml
|
||||
|
||||
- import_tasks: install.yml
|
||||
|
||||
- import_tasks: cleanup.yml
|
@@ -1,2 +0,0 @@
|
||||
localhost
|
||||
|
@@ -1,5 +0,0 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- nvm
|
@@ -1,3 +0,0 @@
|
||||
---
|
||||
# vars file for nvm
|
||||
noahk_password: 'Voorzitter17'
|
Reference in New Issue
Block a user