diff --git a/README.md b/README.md index a5a736fb6..e621bf685 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,9 @@ previous stable release. ### Foreman version compatibility notes For Foreman 1.16 or older, please use the 9.x release series of this module. +The parameters `locations_enabled`, `organizations_enabled` and `authentication` +will only have any affect on Foreman 1.20 or older, in newer versions these +settings have been removed. ## Types and providers diff --git a/manifests/init.pp b/manifests/init.pp index 966d9ab25..5200705a4 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -30,10 +30,6 @@ # # $email_smtp_password:: Password for SMTP server auth, if authentication is enabled # -# $locations_enabled:: Enable locations? -# -# $organizations_enabled:: Enable organizations? -# # $initial_organization:: Name of an initial organization # # $initial_location:: Name of an initial location @@ -50,8 +46,12 @@ # # $unattended_url:: URL hosts will retrieve templates from during build (normally http as many installers don't support https) # -# $authentication:: Enable user authentication. Initial credentials are set using admin_username -# and admin_password. +# $locations_enabled:: Enable locations? (Unused since 1.21) +# +# $organizations_enabled:: Enable organizations? (Unused since 1.21) +# +# $authentication:: Enable user authentication. (Unused since 1.21) +# Initial credentials are set using initial_admin_username and initial_admin_password. # # $passenger:: Configure foreman via apache and passenger # @@ -216,7 +216,7 @@ Boolean $puppetrun = $::foreman::params::puppetrun, Boolean $unattended = $::foreman::params::unattended, Optional[Stdlib::HTTPUrl] $unattended_url = $::foreman::params::unattended_url, - Boolean $authentication = $::foreman::params::authentication, + Optional[Boolean] $authentication = $::foreman::params::authentication, Boolean $passenger = $::foreman::params::passenger, Optional[String] $passenger_ruby = $::foreman::params::passenger_ruby, Optional[String] $passenger_ruby_package = $::foreman::params::passenger_ruby_package, @@ -250,8 +250,8 @@ String $group = $::foreman::params::group, Array[String] $user_groups = $::foreman::params::user_groups, String $rails_env = $::foreman::params::rails_env, - Boolean $locations_enabled = $::foreman::params::locations_enabled, - Boolean $organizations_enabled = $::foreman::params::organizations_enabled, + Optional[Boolean] $locations_enabled = $::foreman::params::locations_enabled, + Optional[Boolean] $organizations_enabled = $::foreman::params::organizations_enabled, Optional[String] $passenger_interface = $::foreman::params::passenger_interface, String $vhost_priority = $::foreman::params::vhost_priority, Stdlib::Port $server_port = $::foreman::params::server_port, diff --git a/manifests/params.pp b/manifests/params.pp index 1efe1c15d..d8c44b6cd 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -9,8 +9,8 @@ # should foreman manage host provisioning as well $unattended = true $unattended_url = undef - # Enable users authentication (default user:admin pw:changeme) - $authentication = true + # Enable users authentication (default user:admin pw:changeme) (Unused since 1.21) + $authentication = undef # configure foreman via apache and passenger $passenger = true # Enclose apache configuration in ... @@ -27,9 +27,9 @@ $passenger_prestart = true $passenger_min_instances = 1 $passenger_start_timeout = 90 - # Choose whether you want to enable locations and organizations. - $locations_enabled = false - $organizations_enabled = false + # Choose whether you want to enable locations and organizations. (Unused since 1.21) + $locations_enabled = undef + $organizations_enabled = undef # Additional software repos $configure_epel_repo = ($::osfamily == 'RedHat' and $::operatingsystem != 'Fedora') diff --git a/spec/classes/foreman_spec.rb b/spec/classes/foreman_spec.rb index 47eaae3f8..ae5ebe42b 100644 --- a/spec/classes/foreman_spec.rb +++ b/spec/classes/foreman_spec.rb @@ -47,10 +47,7 @@ should contain_concat__fragment('foreman_settings+01-header.yaml') .with_content(/^:unattended:\s*true$/) .without_content(/^:unattended_url:/) - .with_content(/^:login:\s*true$/) .with_content(/^:require_ssl:\s*true$/) - .with_content(/^:locations_enabled:\s*false$/) - .with_content(/^:organizations_enabled:\s*false$/) .with_content(/^:puppetrun:\s*false$/) .with_content(/^:oauth_active:\s*true$/) .with_content(/^:oauth_map_users:\s*false$/) diff --git a/templates/settings.yaml.erb b/templates/settings.yaml.erb index c7c02a9f8..453f9d814 100644 --- a/templates/settings.yaml.erb +++ b/templates/settings.yaml.erb @@ -7,10 +7,16 @@ <% unless [nil, :undefined, :undef].include?(scope.lookupvar("foreman::unattended_url")) -%> :unattended_url: <%= scope.lookupvar("foreman::unattended_url") %> <% end -%> +<% unless [nil, :undefined, :undef].include?(scope.lookupvar("foreman::authentication")) -%> :login: <%= scope.lookupvar("foreman::authentication") %> +<% end -%> :require_ssl: <%= scope.lookupvar("foreman::ssl") %> +<% unless [nil, :undefined, :undef].include?(scope.lookupvar("foreman::locations_enabled")) -%> :locations_enabled: <%= scope.lookupvar("foreman::locations_enabled") %> +<% end -%> +<% unless [nil, :undefined, :undef].include?(scope.lookupvar("foreman::organizations_enabled")) -%> :organizations_enabled: <%= scope.lookupvar("foreman::organizations_enabled") %> +<% end -%> :puppetrun: <%= scope.lookupvar("foreman::puppetrun") %> # The following values are used for providing default settings during db migrate