From 18dd74ac8d4f7eda90107e03f2cb57e0b01cc595 Mon Sep 17 00:00:00 2001 From: Martin Chlumsky Date: Wed, 14 Nov 2018 15:37:03 -0500 Subject: [PATCH] Allow custom horizon policy files for disabled openstack projects. Currently, you cannot deploy custom policy files in horizon for disabled openstack projects that don't have a horizon plugin. This patch allows customizing disabled openstack projects policy files used by horizon. For services that do not have horizon plugins, it creates variables of the form `enable_*_horizon_policy_file` and sets these to the relevant `enable_*` variables by default. This ensures backwards compatibility. This patch is useful when you are migrating to kolla-ansible from another deployment method one openstack project at a time and you have custom policy files deployed by the old method. Partially-Implements: blueprint docs-migrating-to-kolla Closes-Bug: #1809314 Change-Id: Ifc33ef65759fa4831c24d177b272af5b45f80931 --- ansible/group_vars/all.yml | 12 ++++++++++++ ansible/roles/horizon/tasks/config.yml | 16 ++++++++-------- ...om-horizon-policy-files-f8e91efbb80ac0d6.yaml | 4 ++++ 3 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 releasenotes/notes/toggle-custom-horizon-policy-files-f8e91efbb80ac0d6.yaml diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index c6c94284b5..eb2c7380e0 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -771,6 +771,18 @@ murano_agent_rabbitmq_user: "muranoagent" horizon_backend_database: "{{ enable_murano | bool }}" horizon_keystone_multidomain: False +# Enable deploying custom horizon policy files for services that don't have a +# horizon plugin but have a policy file. Override these when you have services +# not deployed by kolla-ansible but want custom policy files deployed for them +# in horizon. +enable_ceilometer_horizon_policy_file: "{{ enable_ceilometer }}" +enable_cinder_horizon_policy_file: "{{ enable_cinder }}" +enable_congress_horizon_policy_file: "{{ enable_congress }}" +enable_glance_horizon_policy_file: "{{ enable_glance }}" +enable_heat_horizon_policy_file: "{{ enable_heat }}" +enable_keystone_horizon_policy_file: "{{ enable_keystone }}" +enable_neutron_horizon_policy_file: "{{ enable_neutron }}" +enable_nova_horizon_policy_file: "{{ enable_nova }}" ################# # Octavia options diff --git a/ansible/roles/horizon/tasks/config.yml b/ansible/roles/horizon/tasks/config.yml index 6ae83f9fa8..3545b69498 100644 --- a/ansible/roles/horizon/tasks/config.yml +++ b/ansible/roles/horizon/tasks/config.yml @@ -20,23 +20,23 @@ project_name: "{{ item.name }}" when: item.enabled | bool with_items: - - { name: "ceilometer", enabled: "{{ enable_ceilometer }}" } - - { name: "cinder", enabled: "{{ enable_cinder }}" } - - { name: "congress", enabled: "{{ enable_congress }}" } + - { name: "ceilometer", enabled: "{{ enable_ceilometer_horizon_policy_file }}" } + - { name: "cinder", enabled: "{{ enable_cinder_horizon_policy_file }}" } + - { name: "congress", enabled: "{{ enable_congress_horizon_policy_file }}" } - { name: "cloudkitty", enabled: "{{ enable_horizon_cloudkitty }}" } - { name: "designate", enabled: "{{ enable_horizon_designate }}" } - { name: "freezer", enabled: "{{ enable_horizon_freezer }}" } - - { name: "glance", enabled: "{{ enable_glance }}" } - - { name: "heat", enabled: "{{ enable_heat }}" } + - { name: "glance", enabled: "{{ enable_glance_horizon_policy_file }}" } + - { name: "heat", enabled: "{{ enable_heat_horizon_policy_file }}" } - { name: "ironic", enabled: "{{ enable_horizon_ironic }}" } - - { name: "keystone", enabled: "{{ enable_keystone }}" } + - { name: "keystone", enabled: "{{ enable_keystone_horizon_policy_file }}" } - { name: "karbor", enabled: "{{ enable_horizon_karbor }}" } - { name: "magnum", enabled: "{{ enable_horizon_magnum }}" } - { name: "manila", enabled: "{{ enable_horizon_manila }}" } - { name: "mistral", enabled: "{{ enable_horizon_mistral }}" } - { name: "murano", enabled: "{{ enable_horizon_murano }}" } - - { name: "neutron", enabled: "{{ enable_neutron }}" } - - { name: "nova", enabled: "{{ enable_nova }}" } + - { name: "neutron", enabled: "{{ enable_neutron_horizon_policy_file }}" } + - { name: "nova", enabled: "{{ enable_nova_horizon_policy_file }}" } - { name: "sahara", enabled: "{{ enable_horizon_sahara }}" } - { name: "searchlight", enabled: "{{ enable_horizon_searchlight }}" } - { name: "senlin", enabled: "{{ enable_horizon_senlin }}" } diff --git a/releasenotes/notes/toggle-custom-horizon-policy-files-f8e91efbb80ac0d6.yaml b/releasenotes/notes/toggle-custom-horizon-policy-files-f8e91efbb80ac0d6.yaml new file mode 100644 index 0000000000..500765604b --- /dev/null +++ b/releasenotes/notes/toggle-custom-horizon-policy-files-f8e91efbb80ac0d6.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Add configuration to enable/disable custom horizon policy files per-service even if the service is not being deployed by kolla-ansible.