finished with a bunch more

This commit is contained in:
Matthew Stobbs
2026-03-03 15:08:15 -07:00
parent 24a4ec17ec
commit 065031b77f
27 changed files with 364 additions and 208 deletions

View File

@@ -1,10 +1,14 @@
# vim: set filetype=yaml.ansible
---
- name: Install cargo
- name: Dump install vars
ansible.builtin.debug:
var: pkg
- name: Install with cargo
become: "{{ install_become }}"
become_user: "{{ install_become_user }}"
community.general.cargo:
name: "{{ cargo.name }}"
version: "{{ cargo.version | default(omit) }}"
locked: "{{ cargo.locked | default(false) }}"
name: "{{ pkg.name }}"
version: "{{ pkg.version | default(omit) }}"
locked: "{{ pkg.locked | default(false) }}"
path: "{{ install_prefix }}"

View File

@@ -4,22 +4,22 @@
block:
- name: Fetch git repo
vars:
path: "{{ path_source }}/{{ cargo_build.source_dir }}"
repo: "{{ cargo_build.repo }}"
depth: "{{ cargo_build.depth | default(1) }}"
force: "{{ cargo_build.force_git | default(true) }}"
recursive: "{{ cargo_build.recursive | default(true) }}"
version: "{{ cargo_build.version | default(omit) }}"
path: "{{ path_source }}/{{ pkg.source_dir }}"
repo: "{{ pkg.repo }}"
depth: "{{ pkg.depth | default(1) }}"
force: "{{ pkg.force_git | default(true) }}"
recursive: "{{ pkg.recursive | default(true) }}"
version: "{{ pkg.version | default(omit) }}"
ansible.builtin.include_tasks: helpers/git.yml
- name: Build cargo release
ansible.builtin.command:
chdir: "{{ path_source }}/{{ cargo_build.source_dir }}"
argv: "{{ [cargo, build] + cargo_build.build_flags }}"
chdir: "{{ path_source }}/{{ pkg.source_dir }}"
argv: "{{ [cargo, build] + pkg.build_flags }}"
- name: Clean existing install
vars:
files: "{{ cargo_build.files }}"
files: "{{ pkg.files }}"
ansible.builtin.include_tasks: helpers/clean.yml
- name: Install cargo release
@@ -28,5 +28,5 @@
become: "{{ install_become }}"
become_user: "{{ install_become_user }}"
vars:
source_dir: "{{ cargo_build.source_dir }}"
source_dir: "{{ pkg.source_dir }}"
ansible.builtin.include_tasks: helpers/install.yml

View File

@@ -1,4 +1,14 @@
# vim: set filetype=yaml.ansible :
#
## Helper: git.yml
## Description: pull git repositories
## Variables:
## path: Destination path when cloning
## repo: url to git repo
## depth: _optional_ (default: 1) set git clone depth
## force: _optional_ (default: true) force cloning to given path
## recursive: _optional_ (default: true) do a recursive clone
## version: _optional_ (default: empty) git branch/tag to clone
---
- name: Clone git repository
ansible.builtin.git:

23
tasks/helpers/make.yml Normal file
View File

@@ -0,0 +1,23 @@
# vim: set filetype=yaml.ansible :
#
## Helper: make.yml
## Description: run make to build packages
## Variables:
##
---
- name: Fetch source code
vars:
path: "{{ pkg.path }}"
repo: "{{ pkg.repo }}"
version: "{{ pkg.version | default(omit) }}"
ansible.builtin.include_tasks: helpers/git.yml
- name: Run make targets
loop: "{{ pkg.targets }}"
loop_control:
loop_var: target
become: "{{ target.do_become }}"
community.general.make:
chdir: "{{ pkg.path }}"
target: "{{ target.name }}"
params: "{{ target.params | default(omit) }}"

View File

@@ -1,5 +1,8 @@
# vim: set filetype=yaml.ansible :
---
- name: Dump npm pkg
ansible.builtin.debug:
var: pkg
- name: Install npm
become: "{{ install_become }}"
become_user: "{{ install_become_user }}"