This commit is contained in:
N 2019-03-02 13:22:36 +00:00
commit 8d1ca8f19b
No known key found for this signature in database
GPG key ID: 93AFB6C0144D1A90
3 changed files with 29 additions and 2 deletions

6
packages/files/pip.conf Normal file
View file

@ -0,0 +1,6 @@
{%- for section, settings in config.items()|sort -%}
[{{ section }}]
{%- for key, value in settings.items()|sort %}
{{ key }} = {{ value }}
{%- endfor %}
{% endfor %}

View file

@ -6,22 +6,35 @@
{% set req_pkgs = packages.pips.required.pkgs %}
{% set wanted_pips = packages.pips.wanted %}
{% set unwanted_pips = packages.pips.unwanted %}
{% set pip_config = packages.pips.config %}
### REQ PKGS (without these, some of the WANTED PIPS will fail to install)
pip_req_pkgs:
pkg.installed:
- pkgs: {{ req_pkgs }}
{% if pip_config %}
pip_config:
file.managed:
- name: /etc/pip.conf
- source: salt://{{ slspath }}/files/pip.conf
- template: jinja
- makedirs: True
- context:
config: {{ pip_config|json }}
{% endif %}
### PYTHON PKGS to install using PIP
# (requires the python-pip deb/rpm installed, either by the system or listed in
# the required packages
{% for pn in wanted_pips %}
packages pips install {{ pn }}:
{%- if grains.os_family in ('Suse',) %}
{%- if grains.os_family in ('Suse',) %} ##workaround https://github.com/saltstack-formulas/docker-formula/issues/198
cmd.run:
- name: /usr/bin/pip install {{ pn }}
{%- else %}
pip.installed:
- name: {{ pn }}
- reload_modules: true
{%- endif %}
- require:
@ -31,6 +44,9 @@ packages pips install {{ pn }}:
- sls: {{ dep }}
{% endfor %}
{% endif %}
{% if pip_config %}
- file: pip_config
{% endif %}
{% endfor %}
{% for upn in unwanted_pips %}
@ -39,7 +55,7 @@ packages pips remove {{ upn }}:
cmd.run:
- name: /usr/bin/pip uninstall {{ pn }}
{%- else %}
pip.removed
pip.removed:
- name: {{ upn }}
{%- endif %}
{% endfor %}

View file

@ -34,6 +34,11 @@ packages:
- campbel
- reverse_geocode
- indy-crypto
config:
global:
timeout: 120
default-timeout: 120
proxy: http://proxy.example.com:3128
gems:
wanted:
- progressbar