add ability to install npm, go and pipxpkgs

This commit is contained in:
Matthew Stobbs
2025-01-21 22:22:41 -07:00
parent 1ec4bda33f
commit 34c290f522
2 changed files with 63 additions and 2 deletions

View File

@@ -31,9 +31,11 @@
- ansible.builtin.apt:
name: "{{ syspkgs }}"
state: "{{ install_state }}"
when: ansible_os_family == 'Darwin'
when: ansible_os_family == 'Debian'
become: true
when: ansible_system == 'Linux'
when:
- ansible_system == 'Linux'
- syspkgs|length > 0
tags:
- Linux
- RedHat
@@ -45,10 +47,12 @@
- community.general.homebrew:
name: "{{ syspkgs | unique }}"
state: "{{ install_state }}"
when: syspkgs|length > 0
- community.general.homebrew_cask:
name: "{{ caskpkgs | unique }}"
state: "{{ install_state }}"
when: caskpkgs|length > 0
tags:
- packages
- Darwin
@@ -66,3 +70,57 @@
tags:
- packages
- source
- name: Install cargo packages
community.general.cargo:
name: "{{ cargopkgs }}"
state: latest
locked: true
when: cargopkgs|length > 0
tags:
- packages
- rust
- name: Install local npm packages
when: packages.npm is defined
community.general.npm:
global: true
name: "{{ npmpkg }}"
state: latest
loop: "{{ npmpkgs }}"
loop_control:
loop_var: npmpkg
when: npmpkgs|length > 0
tags:
- npm
- packages
- name: Install local go packages
become: true
environment:
GOROOT: /usr/local/go
PATH: /usr/local/go/bin:$PATH
ansible.builtin.command:
cmd: "go install {{ gopkg }}"
loop: "{{ gopkgs }}"
loop_control:
loop_var: gopkg
when: gopkgs|length > 0
tags:
- go
- packages
- name: Install python pip packages for user
ansible.builtin.pip:
name: "{{ pipxpkg }}"
state: latest
loop: "{{ pipx_packages }}"
loop_control:
loop_var: pipxpkg
when: pipxpkgs|length > 0
tags:
- packages
- python
- pip
- pipx

View File

@@ -5,6 +5,9 @@ syspkgs: []
srcpkgs: []
caskpkgs: []
cargopkgs: []
npmpkgs: []
gopkgs: []
pipxpkgs: []
assume_missing_is_syspkg: false
install_state: present
full_upgrade: false