diff --git a/data/Debian.yaml b/data/familiy/Debian.yaml similarity index 100% rename from data/Debian.yaml rename to data/familiy/Debian.yaml diff --git a/data/RedHat.yaml b/data/familiy/RedHat.yaml similarity index 100% rename from data/RedHat.yaml rename to data/familiy/RedHat.yaml diff --git a/data/RedHat/6.yaml b/data/familiy/RedHat/6.yaml similarity index 100% rename from data/RedHat/6.yaml rename to data/familiy/RedHat/6.yaml diff --git a/data/os/Ubuntu.yaml b/data/os/Ubuntu.yaml new file mode 100644 index 00000000..d17eb24c --- /dev/null +++ b/data/os/Ubuntu.yaml @@ -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' diff --git a/hiera.yaml b/hiera.yaml index 5f9a8f71..62db496b 100644 --- a/hiera.yaml +++ b/hiera.yaml @@ -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' diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 89b916b8..e478f220 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -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') }