diff --git a/manifests/init.pp b/manifests/init.pp index d2e0ee902..3fac111d6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -144,6 +144,10 @@ # String. URL of the apt GPG key # Default: http://packages.elastic.co/GPG-KEY-elasticsearch # +# [*repo_proxy*] +# String. URL for repository proxy +# Default: undef +# # [*logging_config*] # Hash representation of information you want in the logging.yml file # @@ -242,6 +246,7 @@ $repo_version = undef, $repo_key_id = 'D88E42B4', $repo_key_source = 'http://packages.elastic.co/GPG-KEY-elasticsearch', + $repo_proxy = undef, $logging_file = undef, $logging_config = undef, $logging_template = undef, diff --git a/manifests/repo.pp b/manifests/repo.pp index 19945f3e2..d1e5d0a3a 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -51,6 +51,7 @@ gpgcheck => 1, gpgkey => $::elasticsearch::repo_key_source, enabled => 1, + proxy => $::elasticsearch::repo_proxy, } } 'Suse': { diff --git a/spec/classes/005_elasticsearch_repo_spec.rb b/spec/classes/005_elasticsearch_repo_spec.rb index 052aa69d4..a32f77d85 100644 --- a/spec/classes/005_elasticsearch_repo_spec.rb +++ b/spec/classes/005_elasticsearch_repo_spec.rb @@ -139,6 +139,23 @@ end + context "Override repo proxy" do + + let :params do + default_params.merge({ + :repo_proxy => 'http://proxy.com:8080' + }) + end + + case facts[:osfamily] + when 'RedHat' + context 'has override repo proxy' do + it { is_expected.to contain_yumrepo('elasticsearch').with_proxy('http://proxy.com:8080') } + end + end + + end + end end end