Merge branch 'master' into fixes

This commit is contained in:
N 2019-03-02 14:16:52 +00:00
commit 27941fe9e1
No known key found for this signature in database
GPG key ID: 93AFB6C0144D1A90
5 changed files with 51 additions and 4 deletions

View file

@ -37,7 +37,7 @@ packages:
archives:
pkgs:
required: ['curl', 'bzip2', 'gzip']
types: ('tar', 'zip', 'rar',)
types: ['tar', 'zip', 'rar']
wanted: {} #note: dict
unwanted: []
required:

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

@ -1,5 +1,11 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
Suse:
pips:
required:
pkgs:
- python3-pip
Debian:
pips:
required:

View file

@ -6,19 +6,37 @@
{% 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 %}
{{ pn }}:
packages pips install {{ pn }}:
{%- 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:
- pkg: pip_req_pkgs
{% if req_states %}
@ -26,9 +44,18 @@ pip_req_pkgs:
- sls: {{ dep }}
{% endfor %}
{% endif %}
{% if pip_config %}
- file: pip_config
{% endif %}
{% endfor %}
{% for upn in unwanted_pips %}
{{ upn }}:
pip.removed
packages pips remove {{ upn }}:
{%- if grains.os_family in ('Suse',) %}
cmd.run:
- name: /usr/bin/pip uninstall {{ pn }}
{%- else %}
pip.removed:
- name: {{ upn }}
{%- endif %}
{% endfor %}

View file

@ -24,6 +24,9 @@ packages:
- wget
- git
pips:
#required:
# pkgs:
# - python2-pip
wanted:
- dxpy
- attrs
@ -31,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