diff --git a/manifests/repo.pp b/manifests/repo.pp index 18df57a13..06335ad35 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -118,6 +118,9 @@ if ($facts['os']['distro']['id'] == 'Raspbian') { $operatingsystem = 'raspbian' + } elsif ($facts['os']['architecture'] in ['arm64', 'aarch64']) { + # arm64 is the Debian name, but some facter versions report aarch64 instead + $operatingsystem = "${downcase($facts['os']['name'])}-arm64" } else { $operatingsystem = downcase($facts['os']['name']) } diff --git a/spec/classes/repo_spec.rb b/spec/classes/repo_spec.rb index 598e0b812..8bbd91694 100644 --- a/spec/classes/repo_spec.rb +++ b/spec/classes/repo_spec.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'deep_merge' require 'spec_helper' describe 'zabbix::repo' do @@ -45,6 +46,16 @@ it { is_expected.to contain_apt__source('zabbix').with_location('http://repo.zabbix.com/zabbix/5.0/debian/') } end end + + %w[arm64 aarch64].each do |arch| + context "on #{arch}" do + let :facts do + facts.deep_merge(os: { architecture: arch }) + end + + it { is_expected.to contain_apt__source('zabbix').with_location("http://repo.zabbix.com/zabbix/6.0/#{facts[:os]['name'].downcase}-arm64/") } + end + end when 'RedHat' it { is_expected.to compile.with_all_deps }