From 9aa8d59660fd9c74f18cdce35522e27ec6794618 Mon Sep 17 00:00:00 2001 From: "Adrien \"ze\" Urban" Date: Wed, 13 Feb 2019 17:52:49 +0100 Subject: [PATCH] pip: allow to drop a config file first --- packages/files/pip.conf | 6 ++++++ packages/pips.sls | 15 +++++++++++++++ pillar.example | 5 +++++ 3 files changed, 26 insertions(+) create mode 100644 packages/files/pip.conf diff --git a/packages/files/pip.conf b/packages/files/pip.conf new file mode 100644 index 0000000..23e4597 --- /dev/null +++ b/packages/files/pip.conf @@ -0,0 +1,6 @@ +{%- for section, settings in config.items()|sort -%} +[{{ section }}] +{%- for key, value in settings.items()|sort %} +{{ key }} = {{ value }} +{%- endfor %} +{% endfor %} diff --git a/packages/pips.sls b/packages/pips.sls index 4c3514d..fa6fbb2 100644 --- a/packages/pips.sls +++ b/packages/pips.sls @@ -6,12 +6,24 @@ {% 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 @@ -26,6 +38,9 @@ pip_req_pkgs: - sls: {{ dep }} {% endfor %} {% endif %} + {% if pip_config %} + - file: pip_config + {% endif %} {% endfor %} {% for upn in unwanted_pips %} diff --git a/pillar.example b/pillar.example index 70c24ed..e4d8fe8 100644 --- a/pillar.example +++ b/pillar.example @@ -31,6 +31,11 @@ packages: - campbel - reverse_geocode - indy-crypto + config: + global: + timeout: 120 + default-timeout: 120 + proxy: http://proxy.example.com:3128 gems: wanted: - progressbar