Skip to content

Commit 602c17f

Browse files
authored
Merge pull request #63 from myii/refactor/add-osfingermap
refactor: add `osfingermap` (and `oscodenamemap` for Tumbleweed configuration)
2 parents a63ddd6 + 3ce9ef2 commit 602c17f

File tree

5 files changed

+32
-9
lines changed

5 files changed

+32
-9
lines changed

node/map.jinja

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,24 @@
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 %}
10+
{%- import_yaml tplroot ~ "/oscodenamemap.yaml" as oscodenamemap with context %}
911

1012
{%- set _config = salt['config.get'](tplroot, default={}) %}
1113
{%- set defaults = salt['grains.filter_by'](
1214
default_settings,
1315
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'
16+
merge=salt['grains.filter_by']( osarchmap, grain='osarch',
17+
merge=salt['grains.filter_by']( osfamilymap, grain='os_family',
18+
merge=salt['grains.filter_by']( osmap, grain='os',
19+
merge=salt['grains.filter_by']( osfingermap, grain='osfinger',
20+
merge=salt['grains.filter_by']( oscodenamemap, grain='oscodename',
21+
merge=salt['grains.filter_by']( _config, default='lookup'
22+
)
23+
)
1824
)
1925
)
2026
)

node/oscodenamemap.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
4+
openSUSE Tumbleweed:
5+
pkg:
6+
name: nodejs16

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/integration/default/controls/packages_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
package_name =
88
case platform[:family]
99
when 'suse'
10-
'nodejs14'
10+
case system.platform[:finger]
11+
when 'opensuse-tumbleweed'
12+
'nodejs16'
13+
else
14+
'nodejs14'
15+
end
1116
else
1217
'nodejs'
1318
end

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)