Adding a new salt state

Fixing the neovim install
Tying things together in top
This commit is contained in:
Elijah Lazkani 2017-03-18 22:21:08 -04:00
parent 7db0c4d202
commit eb52bb6144
4 changed files with 57 additions and 2 deletions

View file

@ -12,7 +12,7 @@ neovim-install:
{% endif %} {% endif %}
# TODO: fix the python for MacOS # TODO: fix the python for MacOS
{% if grains['os_family'] != 'MacOS' %} {% if grains['os_family'] == 'Arch' %}
python-neovim: python-neovim:
pkg.installed: pkg.installed:
- pkgs: - pkgs:

View file

@ -0,0 +1,30 @@
pip-install:
pkg.installed:
- name: {{ python_env.pip }}
virtualenv-install:
pip.installed:
- name: {{ python_env.virtualenv }}
- user: {{ grains.user }}
- bin_env: {{ python_env.pip_bin_env }}
- require:
- pkg: pip-install
virtualenvwrapper-install:
pip.installed:
- name: {{ python_env.virtualenvwrapper }}
- user: {{ grains.user }}
- bin_env: {{ python_env.pip_bin_env }}
- require:
- pip: virtualenv-install
zsh-virtualenvwrapper:
file.append:
- name: {{ grains.homedir }}/.zshrc
- text:
- ""
- "# Adding virtualenvwrapper python binary path"
- "export VIRTUALENVWRAPPER_PYTHON={{ python_env.python_path }}"
- ""
- "# Sourcing virtualenv"
- "source {{ grains.homedir }}/.local/bin/virtualenvwrapper.sh"

View file

@ -0,0 +1,24 @@
{% set python_env = salt['grains.filter_by']({
'Debian': {
'pip': 'python3-pip',
'pip_bin_env: '/usr/bin/pip3',
'virtualenv': 'virtualenv',
'virtualenvwrapper': 'virtualenvwrapper',
'python_path': '/usr/bin/python3',
},
'Arch': {
'pip': 'python-pip',
'pip_bin_env: '/usr/bin/pip',
'virtualenv': 'virtualenv',
'virtualenvwrapper': 'virtualenvwrapper',
'python_path': '/usr/bin/python',
},
'MacOS': {
'pip': 'python3',
'pip_bin_env: '/usr/local/bin/pip3',
'virtualenv': 'virtualenv',
'virtualenvwrapper': 'virtualenvwrapper',
'python_path': '/usr/local/bin/python3',
},
}, default='Debian' ) %}

View file

@ -1,5 +1,6 @@
base: base:
'*': '*':
- git - git
- neovim
- zsh - zsh
- python_env
- neovim