diff --git a/manifests/config.pp b/manifests/config.pp deleted file mode 100644 index 0ba646bc..00000000 --- a/manifests/config.pp +++ /dev/null @@ -1,169 +0,0 @@ -# == Class gitlab::config -# -# This class is called from gitlab for service config. -# -class gitlab::config { - - # get variables from the toplevel manifest for usage in the template - $ci_redis = $::gitlab::ci_redis - $ci_unicorn = $::gitlab::ci_unicorn - $config_manage = $::gitlab::config_manage - $config_file = $::gitlab::config_file - $external_url = $::gitlab::external_url - $external_port = $::gitlab::external_port - $geo_postgresql = $::gitlab::geo_postgresql - $geo_primary_role = $::gitlab::geo_primary_role - $geo_secondary = $::gitlab::geo_secondary - $geo_secondary_role = $::gitlab::geo_secondary_role - $git = $::gitlab::git - $gitaly = $::gitlab::gitaly - $git_data_dirs = $::gitlab::git_data_dirs - $gitlab_git_http_server = $::gitlab::gitlab_git_http_server - $gitlab_ci = $::gitlab::gitlab_ci - $gitlab_pages = $::gitlab::gitlab_pages - $gitlab_rails = $::gitlab::gitlab_rails - $high_availability = $::gitlab::high_availability - $letsencrypt = $::gitlab::letsencrypt - $logging = $::gitlab::logging - $logrotate = $::gitlab::logrotate - $manage_storage_directories = $::gitlab::manage_storage_directories - $manage_accounts = $::gitlab::manage_accounts - $mattermost = $::gitlab::mattermost - $mattermost_external_url = $::gitlab::mattermost_external_url - $mattermost_nginx = $::gitlab::mattermost_nginx - $mattermost_nginx_eq_nginx = $::gitlab::mattermost_nginx_eq_nginx - $nginx = $::gitlab::nginx - $node_exporter = $::gitlab::node_exporter - $redis_exporter = $::gitlab::redis_exporter - $postgres_exporter = $::gitlab::postgres_exporter - $gitlab_monitor = $::gitlab::gitlab_monitor - $pages_external_url = $::gitlab::pages_external_url - $pages_nginx = $::gitlab::pages_nginx - $pages_nginx_eq_nginx = $::gitlab::pages_nginx_eq_nginx - $postgresql = $::gitlab::postgresql - $prometheus = $::gitlab::prometheus - $prometheus_monitoring_enable = $::gitlab::prometheus_monitoring_enable - $redis = $::gitlab::redis - $redis_master_role = $::gitlab::redis_master_role - $redis_slave_role = $::gitlab::redis_slave_role - $redis_sentinel_role = $::gitlab::redis_sentinel_role - $registry = $::gitlab::registry - $registry_nginx = $::gitlab::registry_nginx - $registry_nginx_eq_nginx = $::gitlab::registry_nginx_eq_nginx - $registry_external_url = $::gitlab::registry_external_url - $secrets = $::gitlab::secrets - $secrets_file = $::gitlab::secrets_file - $sentinel = $::gitlab::sentinel - $service_group = $::gitlab::service_group - $service_manage = $::gitlab::service_manage - $service_user = $::gitlab::service_user - $rake_exec = $::gitlab::rake_exec - $shell = $::gitlab::shell - $sidekiq = $::gitlab::sidekiq - $sidekiq_cluster = $::gitlab::sidekiq_cluster - $store_git_keys_in_db = $::gitlab::store_git_keys_in_db - $source_config_file = $::gitlab::source_config_file - $unicorn = $::gitlab::unicorn - $gitlab_workhorse = $::gitlab::gitlab_workhorse - $user = $::gitlab::user - $web_server = $::gitlab::web_server - $roles = $::gitlab::roles - - # replicate $nginx to $mattermost_nginx if $mattermost_nginx_eq_nginx true - if $mattermost_nginx_eq_nginx { - $_real_mattermost_nginx = $nginx - } else { - $_real_mattermost_nginx = $mattermost_nginx - } - - # replicate $nginx to $pages_nginx if $pages_nginx_eq_nginx true - if $pages_nginx_eq_nginx { - $_real_pages_nginx = $nginx - } else { - $_real_pages_nginx = $pages_nginx - } - - # replicate $nginx to $registry_nginx if $registry_nginx_eq_nginx true - if $registry_nginx_eq_nginx { - $_real_registry_nginx = $nginx - } else { - $_real_registry_nginx = $registry_nginx - } - - if $config_manage { - if $source_config_file { - file { $config_file: - ensure => file, - owner => $service_user, - group => $service_group, - mode => '0600', - source => $source_config_file, - } - } else { - file { $config_file: - ensure => file, - owner => $service_user, - group => $service_group, - mode => '0600', - content => template('gitlab/gitlab.rb.erb'); - } - } - } - - if ! empty($secrets) { - file { $secrets_file: - ensure => file, - owner => $service_user, - group => $service_group, - mode => '0600', - content => inline_template('<%= require \'json\'; JSON.pretty_generate(@secrets) + "\n" %>'), - } - } - - if $service_manage { - # configure gitlab using the official tool - if $config_manage { - File[$config_file] { - notify => Exec['gitlab_reconfigure'] - } - } - if ! empty($secrets) { - File[$secrets_file] { - notify => Exec['gitlab_reconfigure'] - } - } - exec { 'gitlab_reconfigure': - command => '/usr/bin/gitlab-ctl reconfigure', - refreshonly => true, - timeout => 1800, - logoutput => true, - tries => 5, - } - } - - if $store_git_keys_in_db != undef { - $_store_git_keys_in_db = $store_git_keys_in_db ? { - true => 'file', - default => 'absent', - } - - $opt_gitlab_shell_dir = $store_git_keys_in_db ? { - true => 'directory', - default => 'absent' - } - - file {'/opt/gitlab-shell': - ensure => $opt_gitlab_shell_dir, - owner => 'root', - group => 'git', - } - - file { '/opt/gitlab-shell/authorized_keys': - ensure => $_store_git_keys_in_db, - owner => 'root', - group => 'git', - mode => '0650', - source => 'puppet:///modules/gitlab/gitlab_shell_authorized_keys', - } - } -} diff --git a/manifests/host_config.pp b/manifests/host_config.pp new file mode 100644 index 00000000..aefb136c --- /dev/null +++ b/manifests/host_config.pp @@ -0,0 +1,82 @@ +# == Class gitlab::host_config +# +# This class is for setting host configurations required for gitlab installation +# +# [*config_dir*] +# Default: '/etc/gitlab' +# The service executable path. +# Provide this variable value only if the service executable path +# would be a subject of change in future GitLab versions for any reason. +class gitlab::host_config ( + $config_dir = '/etc/gitlab', + $skip_auto_migrations = $gitlab::skip_auto_migrations, + $skip_auto_reconfigure = $gitlab::skip_auto_reconfigure, + $secrets_file = $gitlab::secrets_file, + $store_git_keys_in_db = $gitlab::store_git_keys_in_db, +) { + + file { $config_dir: + ensure => 'directory', + owner => 'root', + group => 'root', + mode => '0775', + } + + # Deprecation notice: + # skip_auto_migrations is deprecated and will be removed at some point after + # GitLab 11.0 is released + $skip_auto_migrations_deprecation_msg = "DEPRECTATION: 'skip_auto_migrations' is deprecated if using GitLab 10.6 or greater. Set skip_auto_reconfigure instead" + $skip_auto_reconfigure_attributes = { + owner => 'root', + group => 'root', + mode => '0644', + } + + if $skip_auto_migrations != undef { + + notify { $skip_auto_migrations_deprecation_msg: } + + $_skip_auto_migrations_ensure = $skip_auto_migrations ? { + true => 'present', + default => 'absent', + } + + file { '/etc/gitlab/skip-auto-migrations': + ensure => $_skip_auto_migrations_ensure, + * => $skip_auto_reconfigure_attributes, + } + } + + file { '/etc/gitlab/skip-auto-reconfigure': + ensure => $skip_auto_reconfigure, + * => $skip_auto_reconfigure_attributes, + } + + if $store_git_keys_in_db != undef { + $_store_git_keys_in_db = $store_git_keys_in_db ? { + true => 'file', + default => 'absent', + } + + $opt_gitlab_shell_dir = $store_git_keys_in_db ? { + true => 'directory', + default => 'absent' + } + + file {'/opt/gitlab-shell': + ensure => $opt_gitlab_shell_dir, + owner => 'root', + group => 'git', + } + + file { '/opt/gitlab-shell/authorized_keys': + ensure => $_store_git_keys_in_db, + owner => 'root', + group => 'git', + mode => '0650', + source => 'puppet:///modules/gitlab/gitlab_shell_authorized_keys', + } + } + + include gitlab::backup +} diff --git a/manifests/init.pp b/manifests/init.pp index 4bf15a87..8ea11447 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -50,14 +50,6 @@ # Default: root # Group of the config file. # -# [*service_restart/_start/_stop/_status*] -# Default: /usr/bin/gitlab-ctl -# Commands for the service definition. -# -# [*service_hasstatus/_hasrestart*] -# Default: true -# The gitlab service has this commands available. -# # [*rake_exec*] # Default: '/usr/bin/gitlab-rake' # The gitlab-rake executable path. @@ -357,26 +349,20 @@ String $package_ensure = $::gitlab::params::package_ensure, Boolean $package_pin = $::gitlab::params::package_pin, # system service configuration - Boolean $service_enable = $::gitlab::params::service_enable, - Enum['stopped', 'false', 'running', 'true'] $service_ensure = $::gitlab::params::service_ensure, # lint:ignore:quoted_booleans - String $service_group = $::gitlab::params::service_group, - Boolean $service_hasrestart = $::gitlab::params::service_hasrestart, - Boolean $service_hasstatus = $::gitlab::params::service_hasstatus, - Boolean $service_manage = $::gitlab::params::service_manage, - String $service_name = $::gitlab::params::service_name, - String $service_exec = $::gitlab::params::service_exec, - String $service_restart = $::gitlab::params::service_restart, - String $service_start = $::gitlab::params::service_start, - String $service_status = $::gitlab::params::service_status, - String $service_stop = $::gitlab::params::service_stop, - String $service_user = $::gitlab::params::service_user, + Boolean $service_enable = true, + Enum['stopped', 'false', 'running', 'true'] $service_ensure = 'running', # lint:ignore:quoted_booleans + Boolean $service_manage = true, + String $service_name = 'gitlab-runsvdir', + String $service_exec = '/usr/bin/gitlab-ctl', + String $service_user = 'root', + String $service_group = 'root', # gitlab specific String $rake_exec = $::gitlab::params::rake_exec, Enum['ce', 'ee'] $edition = 'ce', Optional[Hash] $ci_redis = undef, Optional[Hash] $ci_unicorn = undef, - Boolean $config_manage = $::gitlab::params::config_manage, - Stdlib::Absolutepath $config_file = $::gitlab::params::config_file, + Boolean $config_manage = true, + Stdlib::Absolutepath $config_file = '/etc/gitlab/gitlab.rb', Optional[String] $custom_hooks_dir = undef, Stdlib::Httpurl $external_url = $::gitlab::params::external_url, Optional[Integer[1, 65565]] $external_port = undef, @@ -422,7 +408,7 @@ Boolean $registry_nginx_eq_nginx = false, Optional[Array] $roles = undef, Optional[Hash] $secrets = undef, - Stdlib::Absolutepath $secrets_file = $::gitlab::params::secrets_file, + Optional[Stdlib::Absolutepath] $secrets_file = '/etc/gitlab/gitlab-secrets.json', Optional[Hash] $sentinel = undef, Optional[Hash] $shell = undef, Optional[Hash] $sidekiq = undef, @@ -443,13 +429,15 @@ Hash $global_hooks = {}, ) inherits gitlab::params { - contain gitlab::preinstall + contain gitlab::host_config + contain gitlab::omnibus_config contain gitlab::install - contain gitlab::config contain gitlab::service - contain gitlab::backup - Class['gitlab::preinstall'] -> Class['gitlab::install'] -> Class['gitlab::config'] ~> Class['gitlab::service'] -> Class['gitlab::backup'] + Class['gitlab::host_config'] + -> Class['gitlab::omnibus_config'] + -> Class['gitlab::install'] + -> Class['gitlab::service'] $custom_hooks.each |$name, $options| { gitlab::custom_hook { $name: diff --git a/manifests/install.pp b/manifests/install.pp index 266c23a4..262f5aaa 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -4,12 +4,12 @@ # class gitlab::install { - $edition = $::gitlab::edition - $manage_package_repo = $::gitlab::manage_package_repo - $manage_package = $::gitlab::manage_package - $package_ensure = $::gitlab::package_ensure + $edition = $gitlab::edition + $manage_package_repo = $gitlab::manage_package_repo + $manage_package = $gitlab::manage_package + $package_ensure = $gitlab::package_ensure $package_name = "gitlab-${edition}" - $package_pin = $::gitlab::package_pin + $package_pin = $gitlab::package_pin # only do repo management when on a Debian-like system if $manage_package_repo { @@ -32,11 +32,13 @@ }, } if $manage_package { - package { $package_name: + package { 'gitlab-omnibus': ensure => $package_ensure, + name => $package_name, require => [ Exec['apt_update'], Apt::Source["gitlab_official_${edition}"], + Class['gitlab::host_config', 'gitlab::omnibus_config'], ], } } @@ -68,9 +70,10 @@ } if $manage_package { - package { $package_name: + package { 'gitlab-omnibus': ensure => $package_ensure, - require => Yumrepo["gitlab_official_${edition}"], + name => $package_name, + require => [Yumrepo["gitlab_official_${edition}"], Class['gitlab::host_config', 'gitlab::omnibus_config']], } } } @@ -79,8 +82,10 @@ } } } elsif $manage_package { - package { $package_name: - ensure => $package_ensure, + package { 'gitlab-omnibus': + ensure => $package_ensure, + name => $package_name, + require => Class['gitlab::host_config', 'gitlab::omnibus_config'], } } diff --git a/manifests/omnibus_config.pp b/manifests/omnibus_config.pp new file mode 100644 index 00000000..e3437f41 --- /dev/null +++ b/manifests/omnibus_config.pp @@ -0,0 +1,120 @@ +# == Class gitlab::omnibus_config +# +# This class is used to configure the gitlab omnibus package on a node +# +class gitlab::omnibus_config ( + $config_manage = $gitlab::config_manage, + $config_file = $gitlab::config_file +){ + + # get variables from the toplevel manifest for usage in the template + $ci_redis = $gitlab::ci_redis + $ci_unicorn = $gitlab::ci_unicorn + $external_url = $gitlab::external_url + $external_port = $gitlab::external_port + $geo_postgresql = $gitlab::geo_postgresql + $geo_primary_role = $gitlab::geo_primary_role + $geo_secondary = $gitlab::geo_secondary + $geo_secondary_role = $gitlab::geo_secondary_role + $git = $gitlab::git + $gitaly = $gitlab::gitaly + $git_data_dirs = $gitlab::git_data_dirs + $gitlab_git_http_server = $gitlab::gitlab_git_http_server + $gitlab_ci = $gitlab::gitlab_ci + $gitlab_pages = $gitlab::gitlab_pages + $gitlab_rails = $gitlab::gitlab_rails + $high_availability = $gitlab::high_availability + $letsencrypt = $gitlab::letsencrypt + $logging = $gitlab::logging + $logrotate = $gitlab::logrotate + $manage_storage_directories = $gitlab::manage_storage_directories + $manage_accounts = $gitlab::manage_accounts + $mattermost = $gitlab::mattermost + $mattermost_external_url = $gitlab::mattermost_external_url + $mattermost_nginx = $gitlab::mattermost_nginx + $mattermost_nginx_eq_nginx = $gitlab::mattermost_nginx_eq_nginx + $nginx = $gitlab::nginx + $node_exporter = $gitlab::node_exporter + $redis_exporter = $gitlab::redis_exporter + $postgres_exporter = $gitlab::postgres_exporter + $gitlab_monitor = $gitlab::gitlab_monitor + $pages_external_url = $gitlab::pages_external_url + $pages_nginx = $gitlab::pages_nginx + $pages_nginx_eq_nginx = $gitlab::pages_nginx_eq_nginx + $postgresql = $gitlab::postgresql + $prometheus = $gitlab::prometheus + $prometheus_monitoring_enable = $gitlab::prometheus_monitoring_enable + $redis = $gitlab::redis + $redis_master_role = $gitlab::redis_master_role + $redis_slave_role = $gitlab::redis_slave_role + $redis_sentinel_role = $gitlab::redis_sentinel_role + $registry = $gitlab::registry + $registry_nginx = $gitlab::registry_nginx + $registry_nginx_eq_nginx = $gitlab::registry_nginx_eq_nginx + $registry_external_url = $gitlab::registry_external_url + $secrets = $gitlab::secrets + $secrets_file = $gitlab::secrets_file + $sentinel = $gitlab::sentinel + $service_group = $gitlab::service_group + $service_user = $gitlab::service_user + $rake_exec = $gitlab::rake_exec + $shell = $gitlab::shell + $sidekiq = $gitlab::sidekiq + $sidekiq_cluster = $gitlab::sidekiq_cluster + $source_config_file = $gitlab::source_config_file + $unicorn = $gitlab::unicorn + $gitlab_workhorse = $gitlab::gitlab_workhorse + $user = $gitlab::user + $web_server = $gitlab::web_server + $roles = $gitlab::roles + + # replicate $nginx to $mattermost_nginx if $mattermost_nginx_eq_nginx true + if $mattermost_nginx_eq_nginx { + $_real_mattermost_nginx = $nginx + } else { + $_real_mattermost_nginx = $mattermost_nginx + } + + # replicate $nginx to $pages_nginx if $pages_nginx_eq_nginx true + if $pages_nginx_eq_nginx { + $_real_pages_nginx = $nginx + } else { + $_real_pages_nginx = $pages_nginx + } + + # replicate $nginx to $registry_nginx if $registry_nginx_eq_nginx true + if $registry_nginx_eq_nginx { + $_real_registry_nginx = $nginx + } else { + $_real_registry_nginx = $registry_nginx + } + + # attributes shared by all config files used by omnibus package + $config_file_attributes = { + ensure => 'present', + owner => $service_user, + group => $service_group, + mode => '0600', + } + + if $config_manage { + if $source_config_file { + file { $config_file: + * => $config_file_attributes, + source => $source_config_file, + } + } else { + file { $config_file: + * => $config_file_attributes, + content => template('gitlab/gitlab.rb.erb'); + } + } + } + + if ! empty($secrets) { + file { $secrets_file: + * => $config_file_attributes, + content => inline_template('<%= require \'json\'; JSON.pretty_generate(@secrets) + "\n" %>'), + } + } +} diff --git a/manifests/params.pp b/manifests/params.pp index 121788a4..5eec8ea2 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -6,26 +6,13 @@ class gitlab::params { # package parameters - $package_ensure = installed + $package_ensure = 'installed' $package_pin = false $manage_package_repo = true $manage_package = true $rake_exec = '/usr/bin/gitlab-rake' - $service_exec = '/usr/bin/gitlab-ctl' - $service_restart = "${service_exec} restart" - $service_start = "${service_exec} start" - $service_stop = "${service_exec} stop" - $service_status = "${service_exec} status" - $service_hasstatus = true - $service_hasrestart = true - - $service_ensure = running - $service_manage = true - $service_name = 'gitlab-runsvdir' - $service_user = 'root' - $service_group = 'root' if $::osfamily == 'RedHat' and $::operatingsystemmajrelease == '6' { $service_enable = false @@ -35,9 +22,6 @@ # gitlab specific $external_url = "http://${::fqdn}" - $config_manage = true - $config_file = '/etc/gitlab/gitlab.rb' - $secrets_file = '/etc/gitlab/gitlab-secrets.json' $edition = 'ce' } diff --git a/manifests/preinstall.pp b/manifests/preinstall.pp deleted file mode 100644 index f98cce37..00000000 --- a/manifests/preinstall.pp +++ /dev/null @@ -1,39 +0,0 @@ -# == Class gitlab::config -# -# This class is for setting pre-install configurations -# -class gitlab::preinstall ( - $skip_auto_migrations = $gitlab::skip_auto_migrations, - $skip_auto_reconfigure = $gitlab::skip_auto_reconfigure -) { - - #### - # Deprecation notice: - # skip_auto_migrations is deprecated and will be removed at some point after - # GitLab 11.0 is released - $skip_auto_migrations_deprecation_msg = "DEPRECTATION: 'skip_auto_migrations' is deprecated if using GitLab 10.6 or greater. Set skip_auto_reconfigure instead" - - if $skip_auto_migrations != undef { - - notify { $skip_auto_migrations_deprecation_msg: } - - $_skip_auto_migrations_ensure = $skip_auto_migrations ? { - true => 'present', - default => 'absent', - } - - file { '/etc/gitlab/skip-auto-migrations': - ensure => $_skip_auto_migrations_ensure, - owner => 'root', - group => 'root', - mode => '0644', - } - } - - file { '/etc/gitlab/skip-auto-reconfigure': - ensure => $skip_auto_reconfigure, - owner => 'root', - group => 'root', - mode => '0644', - } -} diff --git a/manifests/service.pp b/manifests/service.pp index f275f370..1b7c077c 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -3,18 +3,51 @@ # This class is meant to be called from gitlab. # It ensure the service is running. # -class gitlab::service { - if $::gitlab::service_manage { - service { $::gitlab::service_name: - ensure => $::gitlab::service_ensure, - enable => $::gitlab::service_enable, - restart => $::gitlab::service_restart, - start => $::gitlab::service_start, - stop => $::gitlab::service_stop, - status => $::gitlab::service_status, - hasstatus => $::gitlab::service_hasstatus, - hasrestart => $::gitlab::service_hasrestart, +class gitlab::service ( + $service_ensure = $gitlab::service_ensure, + $service_enable = $gitlab::service_enable, + $service_name = $gitlab::service_name, + $service_exec = $gitlab::service_exec, + $service_manage = $gitlab::service_manage, + $service_provider_restart = false, +){ + + if $service_manage { + $restart = "${service_exec} restart" + $start = "${service_exec} start" + $stop = "${service_exec} stop" + $status = "${service_exec} status" + + service { $service_name: + ensure => $service_ensure, + enable => $service_enable, + restart => $restart, + start => $start, + stop => $stop, + status => $status, + hasstatus => true, + hasrestart => true, } } + $reconfigure_attributes = { + command => '/usr/bin/gitlab-ctl reconfigure', + refreshonly => true, + timeout => 1800, + logoutput => true, + tries => 5, + subscribe => Class['gitlab::omnibus_config'], + require => [Service[$service_name], Class['gitlab::install']], + } + + if ($service_manage and $service_provider_restart) { + exec { 'gitlab_reconfigure': + notify => Service[$service_name], + * => $reconfigure_attributes, + } + } else { + exec { 'gitlab_reconfigure': + * => $reconfigure_attributes, + } + } } diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 7f00cd56..da8a1cf6 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -9,14 +9,16 @@ context 'with default params' do it { is_expected.to contain_class('gitlab::params') } - it { is_expected.to contain_class('gitlab::install').that_comes_before('Class[gitlab::config]') } - it { is_expected.to contain_class('gitlab::config') } - it { is_expected.to contain_class('gitlab::service').that_subscribes_to('Class[gitlab::config]') } - it { is_expected.to contain_exec('gitlab_reconfigure') } + it { is_expected.to contain_class('gitlab::host_config').that_comes_before('Class[gitlab::install]') } + it { is_expected.to contain_class('gitlab::omnibus_config').that_comes_before('Class[gitlab::install]') } + it { is_expected.to contain_class('gitlab::install').that_comes_before('Class[gitlab::service]') } + it { is_expected.to contain_class('gitlab::service') } + it { is_expected.to contain_exec('gitlab_reconfigure').that_subscribes_to('Class[gitlab::omnibus_config]') } it { is_expected.to contain_file('/etc/gitlab/gitlab.rb') } it { is_expected.to contain_service('gitlab-runsvdir') } - it { is_expected.to contain_package('gitlab-ce').with_ensure('installed') } + it { is_expected.to contain_package('gitlab-omnibus').with_ensure('installed').with_name('gitlab-ce') } it { is_expected.to contain_class('gitlab') } + it { is_expected.not_to raise_error } case facts[:osfamily] when 'Debian' @@ -30,7 +32,7 @@ describe 'edition = ee' do let(:params) { { edition: 'ee' } } - it { is_expected.to contain_package('gitlab-ee').with_ensure('installed') } + it { is_expected.to contain_package('gitlab-omnibus').with_ensure('installed').with_name('gitlab-ee') } case facts[:osfamily] when 'Debian' @@ -227,8 +229,7 @@ describe 'with manage_package => false' do let(:params) { { manage_package: false } } - it { is_expected.not_to contain_package('gitlab-ce') } - it { is_expected.not_to contain_package('gitlab-ee') } + it { is_expected.not_to contain_package('gitlab-omnibus') } end describe 'with roles' do let(:params) do