added ripgrep state
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul 2025-02-19 18:36:25 +01:00
parent 5bab88ad7b
commit f0a77a9c5a
6 changed files with 76 additions and 0 deletions

View File

@ -0,0 +1,9 @@
---
ripgrep:
enabled: true
install_dir: /usr/local/apps
release_dir: /usr/local/apps/releases
mirror: https://github.com/BurntSushi/ripgrep/releases/download
version: 14.1.1
os: linux
arch: amd64

3
states/ripgrep/init.sls Normal file
View File

@ -0,0 +1,3 @@
---
include:
- .install

View File

@ -0,0 +1,23 @@
---
{%- from "ripgrep/map.jinja" import ripgrep with context %}
ripgrep-archive-extract:
archive.extracted:
- name: {{ ripgrep.release_dir }}/ripgrep-{{ ripgrep.version }}
- source: {{ ripgrep.mirror }}/{{ ripgrep.version }}/ripgrep-{{ ripgrep.version }}-{{ ripgrep.arch }}-unknown-{{ ripgrep.os|lower }}-musl.tar.gz
- skip_verify: true
- enforce_toplevel: false
- if_missing: {{ ripgrep.release_dir }}/ripgrep-{{ ripgrep.version }}/ripgrep
ripgrep-binary-symlink:
file.symlink:
- name: /usr/local/bin/ripgrep
- target: {{ ripgrep.release_dir }}/ripgrep-v{{ ripgrep.version }}-{{ ripgrep.os }}-{{ ripgrep.arch }}/ripgrep
- force: true
- require:
- archive: ripgrep-archive-extract
ripgrep-cleanup:
software.cleanup:
- name: ripgrep
- path: {{ ripgrep.release_dir }}
- version: "v{{ ripgrep.version }}"

View File

@ -0,0 +1,3 @@
---
Linux:
os: "linux"

14
states/ripgrep/map.jinja Normal file
View File

@ -0,0 +1,14 @@
{%- import_yaml "ripgrep/defaults.yaml" as default_settings -%}
{%- import_yaml "ripgrep/kernelmap.yaml" as kernelmap -%}
{%- import_yaml "ripgrep/osarchmap.yaml" as osarchmap -%}
{%- set defaults = salt['grains.filter_by'](default_settings,
default='ripgrep',
merge=salt['grains.filter_by'](osarchmap, grain='osarch',
merge=salt['grains.filter_by'](kernelmap, grain='kernel')
)
)
-%}
{%- set ripgrep = salt['pillar.get']('ripgrep', default=defaults, merge=True) -%}

View File

@ -0,0 +1,24 @@
---
amd64:
arch: "amd64"
x86_64:
arch: "amd64"
386:
arch: "386"
arm64:
arch: "aarch64"
aarch64:
arch: "aarch64"
armv6l:
arch: "arm"
armv7l:
arch: "arm"
armhf:
arch: "arm"