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 Foreman repository parameters #677

Merged
merged 1 commit into from
Jul 22, 2021
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
8 changes: 2 additions & 6 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,6 @@
#
# === Advanced parameters:
#
# $repo:: Which repository to use. Can be a specific version or nightly. Will not configure anything when undefined.
#
# $gpgcheck:: Turn on/off gpg check in repo files (effective only on RedHat family systems)
#
# $dhcp_failover_address:: Address for DHCP to listen for connections from its peer
#
# $dhcp_failover_port:: Port for DHCP to listen & communicate with it DHCP peer
Expand Down Expand Up @@ -286,8 +282,6 @@
# $puppetca_certificate:: Token-whitelisting only: Certificate to use when encrypting tokens (undef to use SSL certificate)
#
class foreman_proxy (
Optional[String] $repo = $foreman_proxy::params::repo,
Boolean $gpgcheck = $foreman_proxy::params::gpgcheck,
String $version = $foreman_proxy::params::version,
Enum['latest', 'present', 'installed', 'absent'] $ensure_packages_version = $foreman_proxy::params::ensure_packages_version,
Variant[Array[String], String] $bind_host = $foreman_proxy::params::bind_host,
Expand Down Expand Up @@ -432,6 +426,8 @@
contain foreman_proxy::service
contain foreman_proxy::register

Anchor <| title == 'foreman::repo' |> ~> Class['foreman_proxy::install']

# lint:ignore:spaceship_operator_without_tag
Class['foreman_proxy::install']
~> Class['foreman_proxy::config']
Expand Down
14 changes: 0 additions & 14 deletions manifests/install.pp
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
# @summary Install the foreman proxy
# @api private
class foreman_proxy::install {
if $foreman_proxy::repo {
foreman::repos { 'foreman_proxy':
repo => $foreman_proxy::repo,
gpgcheck => $foreman_proxy::gpgcheck,
before => Package['foreman-proxy'],
}
}

package {'foreman-proxy':
ensure => $foreman_proxy::version,
}
Expand All @@ -17,16 +9,10 @@
package { 'foreman-proxy-journald':
ensure => installed,
}
if $foreman_proxy::repo {
Foreman::Repos['foreman_proxy'] -> Package['foreman-proxy-journald']
}
}

if $foreman_proxy::register_in_foreman {
contain foreman::providers
if $foreman_proxy::repo {
Foreman::Repos['foreman_proxy'] -> Class['foreman::providers']
}
}

if $foreman_proxy::bmc and $foreman_proxy::bmc_default_provider != 'shell' {
Expand Down
13 changes: 13 additions & 0 deletions spec/classes/foreman_proxy__spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,19 @@
end
end
end

context 'with foreman::repo included', unless: ['FreeBSD', 'DragonFly'].include?(facts[:operatingsystem]) do
let(:pre_condition) do
<<-PUPPET
class { 'foreman::repo':
repo => 'nightly',
}
PUPPET
end

it { should compile.with_all_deps }
it { should contain_package('foreman-proxy').that_requires('Anchor[foreman::repo]') }
end
end
end
end