Skip to content

Commit 41ac40d

Browse files
noelmcloughlinmyii
authored andcommitted
feat(mapping): introduce osarchmap per issue #13
1 parent 72ea25f commit 41ac40d

File tree

2 files changed

+48
-8
lines changed

2 files changed

+48
-8
lines changed

template/map.jinja

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{%- set tplroot = tpldir.split('/')[0] %}
66
{#- Start imports as #}
77
{%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %}
8+
{%- import_yaml tplroot ~ "/osarchmap.yaml" as osarchmap %}
89
{%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %}
910
{%- import_yaml tplroot ~ "/osmap.yaml" as osmap %}
1011
{%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %}
@@ -16,17 +17,21 @@
1617
default_settings,
1718
default=tplroot,
1819
merge=salt['grains.filter_by'](
19-
osfamilymap,
20-
grain='os_family',
20+
osarchmap,
21+
grain='osarch',
2122
merge=salt['grains.filter_by'](
22-
osmap,
23-
grain='os',
23+
osfamilymap,
24+
grain='os_family',
2425
merge=salt['grains.filter_by'](
25-
osfingermap,
26-
grain='osfinger',
26+
osmap,
27+
grain='os',
2728
merge=salt['grains.filter_by'](
28-
_config,
29-
default='lookup'
29+
osfingermap,
30+
grain='osfinger',
31+
merge=salt['grains.filter_by'](
32+
_config,
33+
default='lookup'
34+
)
3035
)
3136
)
3237
)

template/osarchmap.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
#
4+
# Setup variables using grains['osarch'] based logic.
5+
# You just need to add the key:values for an `osarch` that differ
6+
# from `defaults.yaml` + `os_family.yaml`.
7+
# Only add an `osarch` which is/will be supported by the formula
8+
#
9+
# If you do not need to provide defaults via the `osarch` grain,
10+
# you will need to provide at least an empty dict in this file, e.g.
11+
# osarch: {}
12+
---
13+
amd64:
14+
arch: amd64
15+
16+
x86_64:
17+
arch: amd64
18+
19+
386:
20+
arch: 386
21+
22+
arm64:
23+
arch: arm64
24+
25+
armv6l:
26+
arch: armv6l
27+
28+
armv7l:
29+
arch: armv6l
30+
31+
ppc64le:
32+
arch: ppc64le
33+
34+
s390x:
35+
arch: s390x

0 commit comments

Comments
 (0)