Adding a mapping template for OS specific packages
This commit is contained in:
parent
08a03f0b5a
commit
5f805a19c1
3 changed files with 32 additions and 13 deletions
|
@ -1,2 +0,0 @@
|
|||
Kernel: {{ grains['kernel'] }}
|
||||
OS_Family: {{ grains['os_family'] }}
|
|
@ -1,19 +1,22 @@
|
|||
{% from "neovim/map.jinja" import neovim with context %}
|
||||
|
||||
neovim-install:
|
||||
{% if grains['os_family'] == 'Debian' %}
|
||||
pkgrepo.managed:
|
||||
- ppa: neovim-ppa/unstable
|
||||
- ppa: {{ neovim.ppa }}
|
||||
{% endif %}
|
||||
pkg.installed:
|
||||
{% if grains['kernel'] == 'Darwin' %}
|
||||
- name: neovim
|
||||
- taps: 'neovim/neovim'
|
||||
{% elif grains['kernel'] == 'Linux' %}
|
||||
- name: neovim
|
||||
- name: {{ neovim.name }}
|
||||
{% if grains['os_family'] == 'MacOS' %}
|
||||
- taps: {{ neovim.taps }}
|
||||
{% endif %}
|
||||
|
||||
os-family:
|
||||
file.managed:
|
||||
- name: {{ grains.homedir }}/os_family
|
||||
- source: salt:///neovim/files/os_fams
|
||||
- template: jinja
|
||||
# TODO: fix the python for MacOS
|
||||
{% if grains['os_family'] != 'MacOS' %}
|
||||
python-neovim:
|
||||
pkg.installed:
|
||||
- pkgs:
|
||||
- {{ grains.python2 }}
|
||||
- {{ grains.python3 }}
|
||||
{% endif %}
|
||||
|
||||
|
|
18
salty/base/neovim/map.jinja
Normal file
18
salty/base/neovim/map.jinja
Normal file
|
@ -0,0 +1,18 @@
|
|||
{% set neovim = salt['grains.filter_by']({
|
||||
'Debian': {
|
||||
'name': 'neovim',
|
||||
'ppa': 'neovim-ppa/unstable',
|
||||
'python2': 'python-neovim',
|
||||
'python3': 'python3-neovim',
|
||||
},
|
||||
'Arch': {
|
||||
'name': 'neovim',
|
||||
'python2': 'python2-neovim',
|
||||
'python3': 'python-neovim',
|
||||
},
|
||||
'MacOS': {
|
||||
'name': 'neovim',
|
||||
'taps': 'neovim/neovim',
|
||||
'python': 'neovim',
|
||||
},
|
||||
}, merge=salt['pillar.get']('neovim:lookup')) %}
|
Loading…
Reference in a new issue