Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@ class { 'elastic_stack::repo':
base_repo_url => 'https://mymirror.example.org/elastic-artifacts/packages',
}
```

To use only specific architecture of the repo, set `architecture`, eg.:
``` puppet
class { 'elastic_stack::repo':
architecture => 'amd64',
}
```
19 changes: 11 additions & 8 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
# @param proxy The URL of a HTTP proxy to use for package downloads (YUM only)
# @param version The (major) version of the Elastic Stack for which to configure the repo
# @param base_repo_url The base url for the repo path
# @param architecure The architecture to be used by apt::source
class elastic_stack::repo (
Boolean $oss = false,
Boolean $prerelease = false,
Optional[Integer] $priority = undef,
String $proxy = 'absent',
Integer $version = 7,
Optional[String] $base_repo_url = undef,
Optional[String] $architecture = undef,
) {
if $prerelease {
$version_suffix = '.x-prerelease'
Expand Down Expand Up @@ -69,20 +71,21 @@
include apt

apt::source { 'elastic':
ensure => 'present',
comment => $description,
location => $base_url,
release => 'stable',
repos => 'main',
key => {
ensure => 'present',
comment => $description,
location => $base_url,
architecture => $architecture,
release => 'stable',
repos => 'main',
key => {
'id' => $key_id,
'source' => $key_source,
},
include => {
include => {
'deb' => true,
'src' => false,
},
pin => $priority,
pin => $priority,
}
}
'RedHat', 'Linux': {
Expand Down
9 changes: 9 additions & 0 deletions spec/classes/repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,15 @@ def declare_zypper(version: '7.x', **params)
end
end

context 'with architecture parameter' do
let(:params) { default_params.merge(architecture: 'amd64') }

case facts[:os]['family']
when 'Debian'
it { is_expected.to declare_apt(architecture: 'amd64') }
end
end

context 'with proxy parameter' do
let(:params) { default_params.merge(proxy: 'http://proxy.com:8080') }

Expand Down