From 4906bf31786abcc5a5d08734deac70cb3b20742b Mon Sep 17 00:00:00 2001 From: Yolanda Robla Date: Mon, 13 Jul 2015 13:15:15 +0200 Subject: [PATCH] Allow to send optional values to configuration Under certain situations, is useful to send some extra configuration to pip.conf, such as the retries, timeout, etc... This change allows to pass extra values as optional settings to the template. Change-Id: Ibcf431a17717fb7f8b8f501603f035fd9456def4 --- manifests/init.pp | 1 + templates/pip.conf.erb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 1e210f1..9c63744 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,6 +4,7 @@ class pip ( $index_url = 'https://pypi.python.org/simple', $trusted_hosts = [], $manage_pip_conf = false, + $optional_settings = {}, ) { include pip::params validate_array($trusted_hosts) diff --git a/templates/pip.conf.erb b/templates/pip.conf.erb index c0b957d..19af6d3 100644 --- a/templates/pip.conf.erb +++ b/templates/pip.conf.erb @@ -6,3 +6,7 @@ trusted-host = <%= trusted_host %> <% end -%> <% end -%> + +<% @optional_settings.keys.sort.each do |setting| -%> +<%= setting -%> = <%= @optional_settings[setting] %> +<% end -%>