diff --git a/manifests/init.pp b/manifests/init.pp index a4fb1845..21cc43e8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 @@ -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, @@ -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'] diff --git a/manifests/install.pp b/manifests/install.pp index 9e2cc4ef..420fe08e 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -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, } @@ -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' { diff --git a/spec/classes/foreman_proxy__spec.rb b/spec/classes/foreman_proxy__spec.rb index 3b7a5a34..e405b722 100644 --- a/spec/classes/foreman_proxy__spec.rb +++ b/spec/classes/foreman_proxy__spec.rb @@ -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