mirror of
https://github.com/morten-olsen/configs.git
synced 2026-02-08 00:46:24 +01:00
cleanup
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||
|
||||
4
playbooks/roles/software_nvm/meta/main.yml
Normal file
4
playbooks/roles/software_nvm/meta/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
- role: base_terminal
|
||||
51
playbooks/roles/software_nvm/tasks/main.yml
Normal file
51
playbooks/roles/software_nvm/tasks/main.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
- name: Install dependencies
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- git
|
||||
|
||||
- name: Clone nvm
|
||||
tags:
|
||||
- install
|
||||
ansible.builtin.git:
|
||||
accept_newhostkey: true
|
||||
clone: true
|
||||
force: true
|
||||
recursive: false
|
||||
repo: https://github.com/nvm-sh/nvm
|
||||
dest: "{{ home }}/.nvm"
|
||||
|
||||
- name: Install node and set version
|
||||
tags:
|
||||
- config
|
||||
register: nodeinstall
|
||||
ansible.builtin.shell: source {{ home }}/.nvm/nvm.sh && nvm install 22
|
||||
changed_when: "'is already installed' not in nodeinstall.stderr"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
|
||||
- name: Setup config dirctories
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.file:
|
||||
mode: "{{ item.mode }}"
|
||||
path: "{{ home }}/{{ item.path }}"
|
||||
state: directory
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'directory'
|
||||
|
||||
- name: Copy config {{ context }}
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
Reference in New Issue
Block a user