Skip to content

Commit

Permalink
Use ubuntu location if we are on ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke committed Oct 13, 2018
1 parent d03beac commit 6c2175b
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions data/os/Ubuntu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
gitlab::repository_configuration:
'apt::source':
"gitlab_official_ce":
comment: 'Official repository for GitLab Omnibus'
location: "https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu"
key:
id: '1A4C919DB987D435939638B914219A96E15E78F4'
source: 'https://packages.gitlab.com/gpg.key'
"gitlab_official_ee":
comment: 'Official repository for GitLab Omnibus'
location: "https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu"
key:
id: '1A4C919DB987D435939638B914219A96E15E78F4'
source: 'https://packages.gitlab.com/gpg.key'
6 changes: 4 additions & 2 deletions hiera.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ defaults:

hierarchy:
- name: 'OS Major Release Overrides'
path: "%{facts.os.family}/%{facts.os.release.major}.yaml"
path: "family/%{facts.os.family}/%{facts.os.release.major}.yaml"
- name: 'Operating System'
path: "os/%{facts.os.name}.yaml"
- name: 'Operating System Family'
path: "%{facts.os.family}.yaml"
path: "family/%{facts.os.family}.yaml"
- name: 'Defaults'
path: 'defaults.yaml'
8 changes: 8 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
it { is_expected.to contain_apt__source('gitlab_official_ee').with_ensure('absent') }
it { is_expected.not_to contain_apt__source('gitlab_official_') }
it { is_expected.not_to contain_yumrepo('gitlab_official_ce') }
case facts[:operatingsystem]
when 'Ubuntu'
it { is_expected.to contain_apt__source('gitlab_official_ce').with_location('https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu') }
it { is_expected.to contain_apt__source('gitlab_official_ee').with_location('https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu') }
else
it { is_expected.to contain_apt__source('gitlab_official_ce').with_location('https://packages.gitlab.com/gitlab/gitlab-ce/debian') }
it { is_expected.to contain_apt__source('gitlab_official_ee').with_location('https://packages.gitlab.com/gitlab/gitlab-ee/debian') }
end
when 'RedHat'
it { is_expected.to contain_yumrepo('gitlab_official_ce').with_ensure('present').with_enabled(1) }
it { is_expected.to contain_yumrepo('gitlab_official_ee').with_ensure('absent') }
Expand Down

0 comments on commit 6c2175b

Please sign in to comment.