Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default repo management #708

Merged
merged 1 commit into from
Jan 11, 2019
Merged
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
9 changes: 2 additions & 7 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@
#
# $ssl:: Enable and set require_ssl in Foreman settings (note: requires passenger, SSL does not apply to kickstarts)
#
# $custom_repo:: No need to change anything here by default
# if set to true, no repo will be added by this module, letting you
# set it to some custom location.
#
# $repo:: This can be stable, nightly or a specific version i.e. 1.7
# $repo:: This can be a specific version or nightly
#
# $configure_epel_repo:: If disabled the EPEL repo will not be configured on Red Hat family systems.
#
Expand Down Expand Up @@ -229,8 +225,7 @@
Stdlib::Fqdn $servername = $::foreman::params::servername,
Array[Stdlib::Fqdn] $serveraliases = $::foreman::params::serveraliases,
Boolean $ssl = $::foreman::params::ssl,
Boolean $custom_repo = $::foreman::params::custom_repo,
String $repo = $::foreman::params::repo,
Optional[String] $repo = $::foreman::params::repo,
Boolean $configure_epel_repo = $::foreman::params::configure_epel_repo,
Boolean $configure_scl_repo = $::foreman::params::configure_scl_repo,
Optional[Boolean] $selinux = $::foreman::params::selinux,
Expand Down
7 changes: 2 additions & 5 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,9 @@
# Only configure extra SCL repos on EL
$configure_scl_repo = ($::osfamily == 'RedHat' and $::operatingsystem != 'Fedora')

# Advanced configuration - no need to change anything here by default
# if set to true, no repo will be added by this module, letting you
# set it to some custom location.
$custom_repo = false
# Advanced configuration
# this can be a version or nightly
$repo = '1.18'
$repo = undef
$app_root = '/usr/share/foreman'
$plugin_config_dir = '/etc/foreman/plugins'
$manage_user = true
Expand Down
3 changes: 1 addition & 2 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Configure the foreman repo
class foreman::repo(
$custom_repo = $::foreman::custom_repo,
$repo = $::foreman::repo,
$gpgcheck = $::foreman::gpgcheck,
$configure_epel_repo = $::foreman::configure_epel_repo,
$configure_scl_repo = $::foreman::configure_scl_repo,
) {
unless $custom_repo {
if $repo {
foreman::repos { 'foreman':
repo => $repo,
gpgcheck => $gpgcheck,
Expand Down
1 change: 0 additions & 1 deletion spec/acceptance/foreman_cli_plugins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
configure = fact('osfamily') == 'RedHat' && fact('operatingsystem') != 'Fedora'
<<-EOS
class { '::foreman::repo':
custom_repo => false,
repo => 'nightly',
gpgcheck => true,
configure_epel_repo => #{configure},
Expand Down
1 change: 0 additions & 1 deletion spec/acceptance/foreman_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
configure = fact('osfamily') == 'RedHat' && fact('operatingsystem') != 'Fedora'
<<-EOS
class { '::foreman::repo':
custom_repo => false,
repo => 'nightly',
gpgcheck => true,
configure_epel_repo => #{configure},
Expand Down
10 changes: 5 additions & 5 deletions spec/classes/foreman_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

describe 'with version' do
let(:params) { super().merge(version: 'latest') }
it { should contain_foreman__repos('foreman') }
it { should_not contain_foreman__repos('foreman') }
it { should contain_package('foreman-postgresql').with_ensure('latest') }
end

describe 'with custom repo' do
let(:params) { super().merge(custom_repo: true) }
describe 'with repo' do
let(:params) { super().merge(repo: 'nightly') }
it { should contain_class('foreman::repo') }
it { should_not contain_foreman__repos('foreman') }
it { should contain_package('foreman-postgresql') }
it { should contain_foreman__repos('foreman') }
it { should contain_package('foreman-postgresql').that_requires('Class[foreman::repo]') }
end

context 'with SELinux enabled' do
Expand Down
1 change: 0 additions & 1 deletion spec/classes/foreman_repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
describe 'with explicit parameters' do
let :params do
{
custom_repo: false,
repo: '1.19',
gpgcheck: true,
configure_epel_repo: false,
Expand Down
4 changes: 1 addition & 3 deletions spec/classes/foreman_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

# repo
it { should contain_class('foreman::repo').that_notifies('Class[foreman::install]') }
it { should_not contain_foreman__repos('foreman') }
case facts[:osfamily]
when 'RedHat'
configure_repo = facts[:operatingsystem] != 'Fedora'
it { should contain_foreman__repos('foreman') }
it {
should contain_class('foreman::repos::extra')
.with_configure_scl_repo(configure_repo)
Expand All @@ -25,7 +25,6 @@
it { should contain_package('tfm-rubygem-passenger-native') }
end
when 'Debian'
it { should contain_foreman__repos('foreman') }
it {
should contain_class('foreman::repos::extra')
.with_configure_scl_repo(false)
Expand Down Expand Up @@ -211,7 +210,6 @@ class {'apache':
servername: 'localhost',
serveraliases: ['foreman'],
ssl: true,
custom_repo: false,
repo: 'nightly',
configure_epel_repo: true,
configure_scl_repo: false,
Expand Down