added fd state
This commit is contained in:
parent
19323c2bcc
commit
5bab88ad7b
9
states/fd/defaults.yaml
Normal file
9
states/fd/defaults.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
fd:
|
||||
enabled: true
|
||||
install_dir: /usr/local/apps
|
||||
release_dir: /usr/local/apps/releases
|
||||
mirror: https://github.com/sharkdp/fd/releases/download
|
||||
version: 10.2.0
|
||||
os: linux
|
||||
arch: amd64
|
3
states/fd/init.sls
Normal file
3
states/fd/init.sls
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
include:
|
||||
- .install
|
23
states/fd/install.sls
Normal file
23
states/fd/install.sls
Normal file
@ -0,0 +1,23 @@
|
||||
---
|
||||
{%- from "fd/map.jinja" import fd with context %}
|
||||
fd-archive-extract:
|
||||
archive.extracted:
|
||||
- name: {{ fd.release_dir }}/fd-{{ fd.version }}
|
||||
- source: {{ fd.mirror }}/v{{ fd.version }}/fd_v{{ fd.version }}-{{ fd.arch }}-unknown-{{ fd.os|lower }}-musl.tar.gz
|
||||
- skip_verify: true
|
||||
- enforce_toplevel: false
|
||||
- if_missing: {{ fd.release_dir }}/fd-v{{ fd.version }}/fd
|
||||
|
||||
fd-binary-symlink:
|
||||
file.symlink:
|
||||
- name: /usr/local/bin/fd
|
||||
- target: {{ fd.release_dir }}/fd-v{{ fd.version }}-{{ fd.os }}-{{ fd.arch }}/fd
|
||||
- force: true
|
||||
- require:
|
||||
- archive: fd-archive-extract
|
||||
|
||||
fd-cleanup:
|
||||
software.cleanup:
|
||||
- name: fd
|
||||
- path: {{ fd.release_dir }}
|
||||
- version: "v{{ fd.version }}"
|
3
states/fd/kernelmap.yaml
Normal file
3
states/fd/kernelmap.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
Linux:
|
||||
os: "linux"
|
14
states/fd/map.jinja
Normal file
14
states/fd/map.jinja
Normal file
@ -0,0 +1,14 @@
|
||||
{%- import_yaml "fd/defaults.yaml" as default_settings -%}
|
||||
|
||||
{%- import_yaml "fd/kernelmap.yaml" as kernelmap -%}
|
||||
{%- import_yaml "fd/osarchmap.yaml" as osarchmap -%}
|
||||
|
||||
{%- set defaults = salt['grains.filter_by'](default_settings,
|
||||
default='fd',
|
||||
merge=salt['grains.filter_by'](osarchmap, grain='osarch',
|
||||
merge=salt['grains.filter_by'](kernelmap, grain='kernel')
|
||||
)
|
||||
)
|
||||
-%}
|
||||
|
||||
{%- set fd = salt['pillar.get']('fd', default=defaults, merge=True) -%}
|
24
states/fd/osarchmap.yaml
Normal file
24
states/fd/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