This commit is contained in:
parent
5440508ca4
commit
9730b83e41
9
states/ipblc/defaults.yaml
Normal file
9
states/ipblc/defaults.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
ipblc:
|
||||||
|
enabled: true
|
||||||
|
install_dir: /usr/local/apps
|
||||||
|
release_dir: /usr/local/apps/releases
|
||||||
|
mirror: https://git.paulbsd.com/paulbsd/ipblc/releases/download
|
||||||
|
version: "1.1.0"
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
4
states/ipblc/init.sls
Normal file
4
states/ipblc/init.sls
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
include:
|
||||||
|
- .install
|
||||||
|
- .service
|
30
states/ipblc/install.sls
Normal file
30
states/ipblc/install.sls
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
{%- from "ipblc/map.jinja" import ipblc with context %}
|
||||||
|
ipblc-dependencies:
|
||||||
|
pkg.installed:
|
||||||
|
- name: libczmq4
|
||||||
|
|
||||||
|
ipblc-archive-extract:
|
||||||
|
archive.extracted:
|
||||||
|
- name: {{ ipblc.release_dir }}/ipblc-{{ ipblc.version }}
|
||||||
|
- source: {{ ipblc.mirror }}/{{ ipblc.version }}/ipblc-{{ ipblc.version }}-{{ ipblc.os }}-{{ ipblc.arch }}.tar.gz
|
||||||
|
- skip_verify: true
|
||||||
|
- enforce_toplevel: false
|
||||||
|
- if_missing: {{ ipblc.release_dir }}/ipblc-{{ ipblc.version }}
|
||||||
|
- watch_in:
|
||||||
|
- service: ipblc-service
|
||||||
|
|
||||||
|
ipblc-binary-symlink:
|
||||||
|
file.symlink:
|
||||||
|
- name: {{ ipblc.install_dir }}/ipblc
|
||||||
|
- target: {{ ipblc.release_dir }}/ipblc-{{ ipblc.version }}
|
||||||
|
- require:
|
||||||
|
- archive: ipblc-archive-extract
|
||||||
|
- watch_in:
|
||||||
|
- service: ipblc-service
|
||||||
|
|
||||||
|
ipblc-cleanup:
|
||||||
|
software.cleanup:
|
||||||
|
- name: ipblc
|
||||||
|
- path: {{ ipblc.release_dir }}
|
||||||
|
- version: "{{ ipblc.version }}"
|
12
states/ipblc/ipblc.service.j2
Normal file
12
states/ipblc/ipblc.service.j2
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{%- from "ipblc/map.jinja" import ipblc with context -%}
|
||||||
|
## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
|
||||||
|
[Unit]
|
||||||
|
Description=ipblc
|
||||||
|
After=network.target postgresql.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart={{ ipblc.install_dir }}/ipblc/ipblc
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
3
states/ipblc/kernelmap.yaml
Normal file
3
states/ipblc/kernelmap.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
Linux:
|
||||||
|
os: "linux"
|
14
states/ipblc/map.jinja
Normal file
14
states/ipblc/map.jinja
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{%- import_yaml "ipblc/defaults.yaml" as default_settings -%}
|
||||||
|
|
||||||
|
{%- import_yaml "ipblc/kernelmap.yaml" as kernelmap -%}
|
||||||
|
{%- import_yaml "ipblc/osarchmap.yaml" as osarchmap -%}
|
||||||
|
|
||||||
|
{%- set defaults = salt['grains.filter_by'](default_settings,
|
||||||
|
default='ipblc',
|
||||||
|
merge=salt['grains.filter_by'](osarchmap, grain='osarch',
|
||||||
|
merge=salt['grains.filter_by'](kernelmap, grain='kernel')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
-%}
|
||||||
|
|
||||||
|
{%- set ipblc = salt['pillar.get']('ipblc', default=defaults, merge=True) -%}
|
21
states/ipblc/osarchmap.yaml
Normal file
21
states/ipblc/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"
|
14
states/ipblc/service.sls
Normal file
14
states/ipblc/service.sls
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
{%- from "ipblc/map.jinja" import ipblc with context %}
|
||||||
|
ipblc-service-file:
|
||||||
|
file.managed:
|
||||||
|
- name: /etc/systemd/system/ipblc.service
|
||||||
|
- source: salt://ipblc/ipblc.service.j2
|
||||||
|
- user: root
|
||||||
|
- group: root
|
||||||
|
- template: jinja
|
||||||
|
|
||||||
|
ipblc-service:
|
||||||
|
service.running:
|
||||||
|
- name: ipblc
|
||||||
|
- enable: true
|
Loading…
Reference in New Issue
Block a user