This commit is contained in:
parent
5bab88ad7b
commit
f0a77a9c5a
9
states/ripgrep/defaults.yaml
Normal file
9
states/ripgrep/defaults.yaml
Normal 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
3
states/ripgrep/init.sls
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
include:
|
||||||
|
- .install
|
23
states/ripgrep/install.sls
Normal file
23
states/ripgrep/install.sls
Normal 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 }}"
|
3
states/ripgrep/kernelmap.yaml
Normal file
3
states/ripgrep/kernelmap.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
Linux:
|
||||||
|
os: "linux"
|
14
states/ripgrep/map.jinja
Normal file
14
states/ripgrep/map.jinja
Normal 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) -%}
|
24
states/ripgrep/osarchmap.yaml
Normal file
24
states/ripgrep/osarchmap.yaml
Normal 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"
|
Loading…
Reference in New Issue
Block a user