feat(mapping): introduce osarchmap per issue #13

This commit is contained in:
N 2019-06-20 18:26:29 +01:00 committed by Imran Iqbal
parent 72ea25fdd3
commit 41ac40d958
No known key found for this signature in database
GPG key ID: 6D8629439D2B7819
2 changed files with 48 additions and 8 deletions

View file

@ -5,6 +5,7 @@
{%- set tplroot = tpldir.split('/')[0] %}
{#- Start imports as #}
{%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %}
{%- import_yaml tplroot ~ "/osarchmap.yaml" as osarchmap %}
{%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %}
{%- import_yaml tplroot ~ "/osmap.yaml" as osmap %}
{%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %}
@ -16,17 +17,21 @@
default_settings,
default=tplroot,
merge=salt['grains.filter_by'](
osfamilymap,
grain='os_family',
osarchmap,
grain='osarch',
merge=salt['grains.filter_by'](
osmap,
grain='os',
osfamilymap,
grain='os_family',
merge=salt['grains.filter_by'](
osfingermap,
grain='osfinger',
osmap,
grain='os',
merge=salt['grains.filter_by'](
_config,
default='lookup'
osfingermap,
grain='osfinger',
merge=salt['grains.filter_by'](
_config,
default='lookup'
)
)
)
)

35
template/osarchmap.yaml Normal file
View file

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
#
# Setup variables using grains['osarch'] based logic.
# You just need to add the key:values for an `osarch` that differ
# from `defaults.yaml` + `os_family.yaml`.
# Only add an `osarch` which is/will be supported by the formula
#
# If you do not need to provide defaults via the `osarch` grain,
# you will need to provide at least an empty dict in this file, e.g.
# osarch: {}
---
amd64:
arch: amd64
x86_64:
arch: amd64
386:
arch: 386
arm64:
arch: arm64
armv6l:
arch: armv6l
armv7l:
arch: armv6l
ppc64le:
arch: ppc64le
s390x:
arch: s390x