From 8a88f3c995b755414bb59c9c51aceeb733cd57f3 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Tue, 3 Jul 2018 16:42:51 +0200 Subject: [PATCH] Add simple_ip_management configuration option Change-Id: I387479f34c6e059e136a26958d9ecf5a10a666b1 --- manifests/init.pp | 41 +++++++++++-------- .../add-simple-ip-mgmt-e8a1227a1a811a2d.yaml | 5 +++ spec/classes/horizon_init_spec.rb | 2 + templates/local_settings.py.erb | 3 ++ 4 files changed, 33 insertions(+), 18 deletions(-) create mode 100644 releasenotes/notes/add-simple-ip-mgmt-e8a1227a1a811a2d.yaml diff --git a/manifests/init.pp b/manifests/init.pp index 17d1c725..880eb293 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -214,13 +214,13 @@ # Specify an absolute pathname. # Defaults to /tmp # -# [*policy_files_path*] -# (Optional) The path to the policy files -# Defaults to undef. +# [*policy_files_path*] +# (Optional) The path to the policy files +# Defaults to undef. # -# [*policy_files*] -# (Optional) Policy files -# Defaults to undef. +# [*policy_files*] +# (Optional) Policy files +# Defaults to undef. # # [*secure_cookies*] # (optional) Enables security settings for cookies. Useful when using @@ -307,22 +307,26 @@ # - { name: 'material', label: 'Material', path: 'themes/material' } # # [*default_theme*] -# (optional) The default theme to use from list of available themes. Value should be theme_name. +# (optional) The default theme to use from list of available themes. Value should be theme_name. +# Defaults to false +# +# [*simple_ip_management*] +# (optional) Boolean to enable or disable the simple_ip_management option to Horizon. # Defaults to false # -# [*password_autocomplete*] -# (optional) Whether to instruct the client browser to autofill the login form password -# Valid values are 'on' and 'off' -# Defaults to 'off' +# [*password_autocomplete*] +# (optional) Whether to instruct the client browser to autofill the login form password +# Valid values are 'on' and 'off' +# Defaults to 'off' # -# [*images_panel*] -# (optional) Enabled panel for images. -# Valid values are 'legacy' and 'angular' -# Defaults to 'legacy' +# [*images_panel*] +# (optional) Enabled panel for images. +# Valid values are 'legacy' and 'angular' +# Defaults to 'legacy' # -# [*create_image_defaults*] -# (optional) A dictionary of default settings for create image modal. -# Defaults to undef - will not add entry to local settings. +# [*create_image_defaults*] +# (optional) A dictionary of default settings for create image modal. +# Defaults to undef - will not add entry to local settings. # # [*password_retrieve*] # (optional) Enables the use of 'Retrieve Password' in the Horizon Web UI. @@ -483,6 +487,7 @@ class horizon( $vhost_extra_params = undef, $available_themes = false, $default_theme = false, + $simple_ip_management = false, $password_autocomplete = 'off', $images_panel = 'legacy', $create_image_defaults = undef, diff --git a/releasenotes/notes/add-simple-ip-mgmt-e8a1227a1a811a2d.yaml b/releasenotes/notes/add-simple-ip-mgmt-e8a1227a1a811a2d.yaml new file mode 100644 index 00000000..263f2f86 --- /dev/null +++ b/releasenotes/notes/add-simple-ip-mgmt-e8a1227a1a811a2d.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + New parameter horizon::simple_ip_manage can now be set to true to set and + enable simple_ip_management in the Horizon local_settings config. diff --git a/spec/classes/horizon_init_spec.rb b/spec/classes/horizon_init_spec.rb index 1eda63a8..0599a901 100644 --- a/spec/classes/horizon_init_spec.rb +++ b/spec/classes/horizon_init_spec.rb @@ -128,6 +128,7 @@ describe 'horizon' do { 'name' => 'material', 'label' => 'Material', 'path' => 'themes/material' }, ], :default_theme => 'default', + :simple_ip_management => true, :password_autocomplete => 'on', :images_panel => 'angular', :create_image_defaults => {'image_visibility' => 'private'}, @@ -146,6 +147,7 @@ describe 'horizon' do " 'identity': 2.0,", "OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True", "OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'domain.tld'", + 'HORIZON_CONFIG["simple_ip_management"] = True', 'HORIZON_CONFIG["password_autocomplete"] = "on"', 'HORIZON_CONFIG["images_panel"] = "angular"', "SECRET_KEY = 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0'", diff --git a/templates/local_settings.py.erb b/templates/local_settings.py.erb index 08d59da9..4eb67bb5 100644 --- a/templates/local_settings.py.erb +++ b/templates/local_settings.py.erb @@ -154,6 +154,9 @@ HORIZON_CONFIG["password_validator"] = { # Disable simplified floating IP address management for deployments with # multiple floating IP pools or complex network requirements. #HORIZON_CONFIG["simple_ip_management"] = False +<% if @simple_ip_management %> +HORIZON_CONFIG["simple_ip_management"] = True +<% end %> # Turn off browser autocompletion for forms including the login form and # the database creation workflow if so desired.