Skip to content

Commit e5f9399

Browse files
committed
refactor: add osfingermap
1 parent a63ddd6 commit e5f9399

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

node/map.jinja

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@
33

44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- import_yaml tplroot ~ "/defaults.yaml" as default_settings with context %}
6+
{%- import_yaml tplroot ~ "/osarchmap.yaml" as osarchmap with context %}
67
{%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap with context %}
78
{%- import_yaml tplroot ~ "/osmap.yaml" as osmap with context %}
8-
{%- import_yaml tplroot ~ "/osarchmap.yaml" as osarchmap with context %}
9+
{%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap with context %}
910

1011
{%- set _config = salt['config.get'](tplroot, default={}) %}
1112
{%- set defaults = salt['grains.filter_by'](
1213
default_settings,
1314
default=tplroot,
14-
merge=salt['grains.filter_by']( osfamilymap, grain='os_family',
15-
merge=salt['grains.filter_by']( osmap, grain='os',
16-
merge=salt['grains.filter_by']( osarchmap, grain='osarch',
17-
merge=salt['grains.filter_by']( _config, default='lookup'
15+
merge=salt['grains.filter_by']( osarchmap, grain='osarch',
16+
merge=salt['grains.filter_by']( osfamilymap, grain='os_family',
17+
merge=salt['grains.filter_by']( osmap, grain='os',
18+
merge=salt['grains.filter_by']( osfingermap, grain='osfinger',
19+
merge=salt['grains.filter_by']( _config, default='lookup'
20+
)
1821
)
1922
)
2023
)

node/osfingermap.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
4+
Debian-9:
5+
pkg:
6+
version: 16.13.2-1nodesource1
7+
Ubuntu-18.04:
8+
pkg:
9+
version: 16.13.2-1nodesource1

test/salt/pillar/repo.sls

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
node:
55
pkg:
66
use_upstream_repo: true # Debian family only
7-
{%- if salt['grains.get']('osfinger') in ['Debian-9','Ubuntu-18.04'] %}
8-
version: 16.13.2-1nodesource1
9-
{%- endif %}
107
config:
118
prefix: /home/vagrant/.npm-packages
129
environ:

0 commit comments

Comments
 (0)