2019-04-24 18:18:44 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=jinja
|
|
|
|
|
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
|
|
|
{%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %}
|
2019-06-08 19:39:21 +02:00
|
|
|
{%- import_yaml tplroot ~ "/osarchmap.yaml" as osarchmap %}
|
2020-11-03 10:34:46 +01:00
|
|
|
{%- import_yaml tplroot ~ "/cpuarchmap.yaml" as cpuarchmap %}
|
2019-06-20 02:36:58 +02:00
|
|
|
{%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %}
|
2020-05-14 01:27:23 +02:00
|
|
|
{%- set _config = salt['config.get'](tplroot, default={}) %}
|
2019-04-24 18:18:44 +02:00
|
|
|
|
2020-05-14 01:27:23 +02:00
|
|
|
{%- set defaults = salt['grains.filter_by'](
|
|
|
|
default_settings,
|
|
|
|
default=tplroot,
|
|
|
|
merge=salt['grains.filter_by']( osfamilymap, grain='os_family',
|
|
|
|
merge=salt['grains.filter_by']( osarchmap, grain='osarch',
|
2020-11-03 10:34:46 +01:00
|
|
|
merge=salt['grains.filter_by']( cpuarchmap, grain='cpuarch',
|
|
|
|
merge=salt['grains.filter_by']( _config, default='lookup'
|
|
|
|
)
|
2020-05-14 01:27:23 +02:00
|
|
|
)
|
2019-06-22 23:34:37 +02:00
|
|
|
)
|
2020-05-14 01:27:23 +02:00
|
|
|
)
|
2019-06-22 23:34:37 +02:00
|
|
|
)
|
2020-05-14 01:27:23 +02:00
|
|
|
%}
|
2019-06-22 23:34:37 +02:00
|
|
|
|
2020-05-14 01:27:23 +02:00
|
|
|
{%- set p = salt['grains.filter_by']( {'defaults': defaults}, default='defaults', merge=_config) %}
|
2019-04-24 18:18:44 +02:00
|
|
|
|
2020-05-14 01:27:23 +02:00
|
|
|
{# ## components ## #}
|
|
|
|
{%- if 'component' in p.pkg and p.pkg.component is mapping %}
|
|
|
|
{%- for name,v in p.pkg.component.items() %}
|
|
|
|
{%- set url = None %}
|
|
|
|
{%- set dir = name %}
|
|
|
|
{%- if 'version' in v and v.version and 'archive' in v and v.archive and 'uri' in p.pkg %}
|
|
|
|
{%- set uri = '%s/%s/releases/download/%s/%s'|format(p.pkg.uri, name, v.version, name) %}
|
|
|
|
{%- set url = '%s-%s.%s-%s.tar.gz'|format(uri, v.version|replace('v',''), p.kernel, p.arch) %}
|
|
|
|
{%- set dir = '%s-%s'|format(name, v.version) %}
|
|
|
|
{%- do p.pkg.component[name].update({'path': p.dir.archive ~ '/' + dir }) %}
|
2020-11-10 14:19:30 +01:00
|
|
|
{% if p.pkg.component[name]['archive'].get('official', true) %}
|
|
|
|
{%- do p.pkg.component[name]['archive'].update({'name': p.dir.archive + '/' + dir, 'source': url}) %}
|
|
|
|
{% else %}
|
|
|
|
{%- do p.pkg.component[name]['archive'].update({'name': p.dir.archive + '/' + dir }) %}
|
|
|
|
{% endif %}
|
2020-08-21 15:33:20 +02:00
|
|
|
{%- endif %}
|
2020-05-14 01:27:23 +02:00
|
|
|
{%- endfor %}
|
|
|
|
{%- endif %}
|
2019-04-26 14:02:30 +02:00
|
|
|
|
2020-05-14 01:27:23 +02:00
|
|
|
{# ## clientlibs ## #}
|
|
|
|
{%- if 'clientlibs' in p.pkg and p.pkg.clientlibs is mapping %}
|
|
|
|
{%- for name,v in p.pkg.clientlibs.items() %}
|
|
|
|
{%- set url = None %}
|
|
|
|
{%- set dir = name %}
|
|
|
|
{%- if 'version' in v and v.version and 'archive' in v and v.archive and 'uri' in v.archive %}
|
|
|
|
{%- set url = v.archive.uri ~ '/' ~ v.version ~ '.tar.gz' %}
|
|
|
|
{%- set dir = name ~ '-' ~ v.version %}
|
|
|
|
{%- endif %}
|
|
|
|
{%- do p.pkg.clientlibs[name].update({'path': p.dir.archive ~ '/' + dir }) %}
|
|
|
|
{%- do p.pkg.clientlibs[name]['archive'].update({'name': p.dir.archive + '/' + dir, 'source': url}) %}
|
|
|
|
{%- endfor %}
|
2019-08-06 21:57:50 +02:00
|
|
|
{%- endif %}
|
|
|
|
|
2020-05-14 01:27:23 +02:00
|
|
|
{%- set prometheus = p %}
|