parameterized LAUNCH_INSTANCE_DEFAULTS
Related: PROD-22266
Change-Id: I9aa783930656ff4d6e4fc2d8ef6cf6ef3750d1f1
diff --git a/README.rst b/README.rst
index b1f4327..f7a37aa 100644
--- a/README.rst
+++ b/README.rst
@@ -182,6 +182,21 @@
- name: cluster2
address: http://cluster2.example.com:5000/v2.0
+Configuration of LAUNCH_INSTANCE_DEFAULTS parameter:
+
+.. code-block:: yaml
+
+ horizon:
+ server:
+ launch_instance_defaults:
+ config_drive: False
+ enable_scheduler_hints: True
+ disable_image: False
+ disable_instance_snapshot: False
+ disable_volume: False
+ disable_volume_snapshot: False
+ create_volume: False
+
Horizon setup with sensu plugin:
.. code-block:: yaml
@@ -578,4 +593,3 @@
* #salt-formulas @ irc.freenode.net
Use this IRC channel in case of any questions or feedback which is always
welcome
-
diff --git a/horizon/files/horizon_settings/_horizon_settings.py b/horizon/files/horizon_settings/_horizon_settings.py
index 4c0faf6..3c9a6f1 100644
--- a/horizon/files/horizon_settings/_horizon_settings.py
+++ b/horizon/files/horizon_settings/_horizon_settings.py
@@ -24,6 +24,17 @@
SESSION_ENGINE = "django.contrib.sessions.backends.{{ server.get('session', {}).get('engine', 'signed_cookies') }}"
DROPDOWN_MAX_ITEMS = {{ server.get('dropdown_max_items', 30) }}
+{%- set launch_data = app.get('launch_instance_defaults', {}) %}
+# A dictionary of settings which can be used to provide the default values for
+# properties found in the Launch Instance modal.
+{%- if app.launch_instance_defaults is defined %}
+LAUNCH_INSTANCE_DEFAULTS = {
+ {%- for default_name, defaults in launch_data.items() %}
+ '{{ default_name }}': {{ defaults }},
+ {%- endfor %}
+}
+{%- endif %}
+
# Path to directory containing policy.json files
POLICY_FILES_PATH = "{{ server.get('policy_files_path') }}"
# Map of local copy of service policy files
diff --git a/metadata/service/server/single.yml b/metadata/service/server/single.yml
index a191165..b43c12a 100644
--- a/metadata/service/server/single.yml
+++ b/metadata/service/server/single.yml
@@ -86,4 +86,3 @@
source: file
name: bgpvpn_policy.json
enabled: ${_param:neutron_enable_bgp_vpn}
-
diff --git a/tests/pillar/single.sls b/tests/pillar/single.sls
index 63acaff..d7ca2f2 100644
--- a/tests/pillar/single.sls
+++ b/tests/pillar/single.sls
@@ -55,6 +55,14 @@
password_autocomplete: off
openstack_neutron_network:
enable_fip_topology_check: False
+ launch_instance_defaults:
+ config_drive: False
+ enable_scheduler_hints: True
+ disable_image: False
+ disable_instance_snapshot: False
+ disable_volume: False
+ disable_volume_snapshot: False
+ create_volume: True
default_domain: default
multidomain: False
themes: