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:
|
neovim-install:
|
||||||
{% if grains['os_family'] == 'Debian' %}
|
{% if grains['os_family'] == 'Debian' %}
|
||||||
pkgrepo.managed:
|
pkgrepo.managed:
|
||||||
- ppa: neovim-ppa/unstable
|
- ppa: {{ neovim.ppa }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
{% if grains['kernel'] == 'Darwin' %}
|
- name: {{ neovim.name }}
|
||||||
- name: neovim
|
{% if grains['os_family'] == 'MacOS' %}
|
||||||
- taps: 'neovim/neovim'
|
- taps: {{ neovim.taps }}
|
||||||
{% elif grains['kernel'] == 'Linux' %}
|
|
||||||
- name: neovim
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
os-family:
|
# TODO: fix the python for MacOS
|
||||||
file.managed:
|
{% if grains['os_family'] != 'MacOS' %}
|
||||||
- name: {{ grains.homedir }}/os_family
|
python-neovim:
|
||||||
- source: salt:///neovim/files/os_fams
|
pkg.installed:
|
||||||
- template: jinja
|
- 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