diff --git a/README.md b/README.md index 5c392063..cd11ecb4 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Part of the Foreman installer: | Module version | Proxy versions | Notes | |----------------|----------------|-----------------------------------------------------| | 16.x | 2.3 and newer | See compatibility notes in its README for 2.0-2.2 | -| 13.x | 2.0 and newer | | +| 13.x | 2.0 - 2.2 | | | 12.x | 1.19 - 1.24 | See compatibility notes in its README for 1.19-1.22 | | 11.x | 1.19 - 1.23 | See compatibility notes in its README for 1.19-1.21 | | 10.x | 1.19 - 1.21 | | @@ -23,6 +23,7 @@ Part of the Foreman installer: | 2.x | 1.5 - 1.10 | | | 1.x | 1.4 and older | | +16.x added support for Smart Proxy Registration feature, available in Smart Proxy 2.3 and newer. 12.x has dropped support for Puppet 3 which was officially unsupported for a while and Foreman Proxy 1.23 dropped altogether. ## Examples diff --git a/manifests/config.pp b/manifests/config.pp index 63c22690..3dcce50e 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -92,6 +92,8 @@ contain foreman_proxy::module::logs + contain foreman_proxy::module::registration + if $foreman_proxy::puppetca or $foreman_proxy::puppet { $uses_sudo = $foreman_proxy::puppetca and versioncmp($facts['puppetversion'], '6.0') < 0 diff --git a/manifests/init.pp b/manifests/init.pp index d575a460..ff81a62b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -94,6 +94,10 @@ # # $template_url:: URL a client should use for provisioning templates # +# $registration:: Enable Registration feature +# +# $registration_listen_on:: Registration proxy to listen on https, http, or both +# # $logs:: Enable Logs (log buffer) feature # # $logs_listen_on:: Logs proxy to listen on https, http, or both @@ -327,6 +331,8 @@ Boolean $templates = $foreman_proxy::params::templates, Foreman_proxy::ListenOn $templates_listen_on = $foreman_proxy::params::templates_listen_on, Stdlib::HTTPUrl $template_url = $foreman_proxy::params::template_url, + Boolean $registration = $foreman_proxy::params::registration, + Foreman_proxy::ListenOn $registration_listen_on = $foreman_proxy::params::registration_listen_on, Boolean $logs = $foreman_proxy::params::logs, Foreman_proxy::ListenOn $logs_listen_on = $foreman_proxy::params::logs_listen_on, Optional[Boolean] $httpboot = $foreman_proxy::params::httpboot, diff --git a/manifests/module/registration.pp b/manifests/module/registration.pp new file mode 100644 index 00000000..5a441589 --- /dev/null +++ b/manifests/module/registration.pp @@ -0,0 +1,17 @@ +# @summary The built in Registration module +# +# @param enabled +# Whether the module is enabled or disabled. +# +# @param listen_on +# Where to listen on. +class foreman_proxy::module::registration ( + Boolean $enabled = $foreman_proxy::registration, + Foreman_proxy::ListenOn $listen_on = $foreman_proxy::registration_listen_on, +) { + foreman_proxy::module { 'registration': + enabled => $enabled, + feature => 'Registration', + listen_on => $listen_on, + } +} diff --git a/manifests/params.pp b/manifests/params.pp index 0910c417..22f80dc7 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -217,6 +217,10 @@ $templates_listen_on = 'both' $template_url = "http://${facts['networking']['fqdn']}:${http_port}" + # Registration settings + $registration = true + $registration_listen_on = 'https' + # Logs settings $logs = true $logs_listen_on = 'https' diff --git a/spec/classes/foreman_proxy__register__spec.rb b/spec/classes/foreman_proxy__register__spec.rb index 2583058c..081a53a2 100644 --- a/spec/classes/foreman_proxy__register__spec.rb +++ b/spec/classes/foreman_proxy__register__spec.rb @@ -44,7 +44,7 @@ before { subject.resource('Datacat_collector[foreman_proxy::enabled_features]').provider.exists? } it 'should populate features on foreman_smartproxy' do - expect(subject.resource("Foreman_smartproxy[#{facts[:fqdn]}]").parameters[:features].should.sort).to match_array(["Logs", "Puppet", "Puppet CA"]) + expect(subject.resource("Foreman_smartproxy[#{facts[:fqdn]}]").parameters[:features].should.sort).to match_array(["Logs", "Puppet", "Puppet CA", "Registration"]) end end end diff --git a/templates/registration.yml.erb b/templates/registration.yml.erb new file mode 100644 index 00000000..6d6a05d8 --- /dev/null +++ b/templates/registration.yml.erb @@ -0,0 +1,3 @@ +--- +# Enable Registration module +:enabled: <%= @module_enabled %>