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 2bc6f7e..0eb6cff 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 @@ -32,6 +44,9 @@ packages pips install {{ pn }}: - 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 b062dc3..c30421b 100644 --- a/pillar.example +++ b/pillar.example @@ -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