updated lego state
This commit is contained in:
parent
be4f389ee6
commit
74fcae4162
9
states/lego/defaults.yaml
Normal file
9
states/lego/defaults.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
lego:
|
||||
enabled: true
|
||||
install_dir: /usr/local/apps
|
||||
release_dir: /usr/local/apps/releases
|
||||
mirror: https://github.com/go-acme/lego/releases/download
|
||||
version: v4.0.1
|
||||
os: linux
|
||||
arch: amd64
|
3
states/lego/init.sls
Normal file
3
states/lego/init.sls
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
include:
|
||||
- .install
|
19
states/lego/install.sls
Normal file
19
states/lego/install.sls
Normal file
@ -0,0 +1,19 @@
|
||||
---
|
||||
{%- from "lego/map.jinja" import lego with context %}
|
||||
{%- if not salt['file.file_exists']( lego.install_dir +"/lego-" + lego.version) %}
|
||||
lego-archive-extract:
|
||||
archive.extracted:
|
||||
- name: {{ lego.release_dir }}/lego-{{ lego.version }}-{{ lego.os }}-{{ lego.arch }}
|
||||
- source: {{ lego.mirror }}/{{ lego.version }}/lego_{{ lego.version }}_{{ lego.os }}_{{ lego.arch }}.tar.gz
|
||||
- skip_verify: true
|
||||
- enforce_toplevel: false
|
||||
- if_missing: {{ lego.release_dir }}/lego-{{ lego.version }}-{{ lego.os }}-{{ lego.arch }}
|
||||
|
||||
lego-binary-symlink:
|
||||
file.symlink:
|
||||
- name: /usr/local/bin/lego
|
||||
- target: {{ lego.release_dir }}/lego-{{ lego.version }}-{{ lego.os }}-{{ lego.arch }}/lego
|
||||
- force: true
|
||||
- require:
|
||||
- archive: lego-archive-extract
|
||||
{%- endif %}
|
3
states/lego/kernelmap.yaml
Normal file
3
states/lego/kernelmap.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
Linux:
|
||||
os: "linux"
|
14
states/lego/map.jinja
Normal file
14
states/lego/map.jinja
Normal file
@ -0,0 +1,14 @@
|
||||
{%- import_yaml "lego/defaults.yaml" as default_settings -%}
|
||||
|
||||
{%- import_yaml "lego/kernelmap.yaml" as kernelmap -%}
|
||||
{%- import_yaml "lego/osarchmap.yaml" as osarchmap -%}
|
||||
|
||||
{%- set defaults = salt['grains.filter_by'](default_settings,
|
||||
default='lego',
|
||||
merge=salt['grains.filter_by'](osarchmap, grain='osarch',
|
||||
merge=salt['grains.filter_by'](kernelmap, grain='kernel')
|
||||
)
|
||||
)
|
||||
-%}
|
||||
|
||||
{%- set lego = salt['pillar.get']('lego', default=defaults, merge=True) -%}
|
21
states/lego/osarchmap.yaml
Normal file
21
states/lego/osarchmap.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
amd64:
|
||||
arch: "amd64"
|
||||
|
||||
x86_64:
|
||||
arch: "amd64"
|
||||
|
||||
386:
|
||||
arch: "386"
|
||||
|
||||
arm64:
|
||||
arch: "arm64"
|
||||
|
||||
armv6l:
|
||||
arch: "arm"
|
||||
|
||||
armv7l:
|
||||
arch: "arm"
|
||||
|
||||
armhf:
|
||||
arch: "arm"
|
Loading…
Reference in New Issue
Block a user