kolla-ansible/ansible/roles/manila/templates/manila-share.conf.j2
Rafael Weingärtner f425c0678f Standardize use and construction of endpoint URLs
The goal for this push request is to normalize the construction and use
 of internal, external, and admin URLs. While extending Kolla-ansible
 to enable a more flexible method to manage external URLs, we noticed
 that the same URL was constructed multiple times in different parts
 of the code. This can make it difficult for people that want to work
 with these URLs and create inconsistencies in a large code base with
 time. Therefore, we are proposing here the use of
 "single Kolla-ansible variable" per endpoint URL, which facilitates
 for people that are interested in overriding/extending these URLs.

As an example, we extended Kolla-ansible to facilitate the "override"
of public (external) URLs with the following standard
"<component/serviceName>.<companyBaseUrl>".
Therefore, the "NAT/redirect" in the SSL termination system (HAproxy,
HTTPD or some other) is done via the service name, and not by the port.
This allows operators to easily and automatically create more friendly
 URL names. To develop this feature, we first applied this patch that
 we are sending now to the community. We did that to reduce the surface
  of changes in Kolla-ansible.

Another example is the integration of Kolla-ansible and Consul, which
we also implemented internally, and also requires URLs changes.
Therefore, this PR is essential to reduce code duplicity, and to
facility users/developers to work/customize the services URLs.

Change-Id: I73d483e01476e779a5155b2e18dd5ea25f514e93
Signed-off-by: Rafael Weingärtner <rafael@apache.org>
2020-08-19 07:22:17 +00:00

120 lines
4.2 KiB
Django/Jinja

[DEFAULT]
{% if manila_enabled_backends %}
enabled_share_backends = {{ manila_enabled_backends|map(attribute='name')|join(',') }}
{% endif %}
default_share_type = default_share_type
[cinder]
auth_uri = {{ keystone_internal_url }}
auth_url = {{ keystone_admin_url }}
auth_type = password
project_domain_id = {{ default_project_domain_id }}
user_domain_id = {{ default_user_domain_id }}
region_name = {{ openstack_region_name }}
endpoint_type = internalURL
project_name = service
username = cinder
password = {{ cinder_keystone_password }}
cafile = {{ openstack_cacert }}
memcache_security_strategy = ENCRYPT
memcache_secret_key = {{ memcache_secret_key }}
memcached_servers = {% for host in groups['memcached'] %}{{ 'api' | kolla_address(host) | put_address_in_context('memcache') }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %}
[nova]
auth_uri = {{ keystone_internal_url }}
auth_url = {{ keystone_admin_url }}
auth_type = password
project_domain_id = {{ default_project_domain_id }}
user_domain_id = {{ default_user_domain_id }}
region_name = {{ openstack_region_name }}
endpoint_type = internalURL
project_name = service
username = {{ nova_keystone_user }}
password = {{ nova_keystone_password }}
cafile = {{ openstack_cacert }}
memcache_security_strategy = ENCRYPT
memcache_secret_key = {{ memcache_secret_key }}
memcached_servers = {% for host in groups['memcached'] %}{{ 'api' | kolla_address(host) | put_address_in_context('memcache') }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %}
[neutron]
auth_uri = {{ keystone_internal_url }}
url = {{ neutron_internal_endpoint }}
auth_url = {{ keystone_admin_url }}
auth_type = password
project_domain_id = {{ default_project_domain_id }}
user_domain_id = {{ default_user_domain_id }}
region_name = {{ openstack_region_name }}
endpoint_type = internalURL
project_name = service
username = {{ neutron_keystone_user }}
password = {{ neutron_keystone_password }}
cafile = {{ openstack_cacert }}
memcache_security_strategy = ENCRYPT
memcache_secret_key = {{ memcache_secret_key }}
memcached_servers = {% for host in groups['memcached'] %}{{ 'api' | kolla_address(host) | put_address_in_context('memcache') }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %}
{% if enable_manila_backend_generic | bool %}
[generic]
share_driver = manila.share.drivers.generic.GenericShareDriver
{% if neutron_plugin_agent == "openvswitch" %}
interface_driver = manila.network.linux.interface.OVSInterfaceDriver
{% elif neutron_plugin_agent == "linuxbridge" %}
interface_driver = manila.network.linux.interface.BridgeInterfaceDriver
{% endif %}
driver_handles_share_servers = True
service_instance_password = {{ manila_service_instance_password }}
service_instance_user = {{ manila_service_instance_user }}
service_image_name = manila-service-image
share_backend_name = GENERIC
{% endif %}
{% if manila_policy_file is defined %}
[oslo_policy]
policy_file = {{ manila_policy_file }}
{% endif %}
{% if enable_manila_backend_hnas | bool %}
[hnas1]
share_backend_name = HNAS1
share_driver = manila.share.drivers.hitachi.hnas.driver.HitachiHNASDriver
driver_handles_share_servers = False
hitachi_hnas_ip = {{ hnas_ip }}
hitachi_hnas_user = {{ hnas_user }}
hitachi_hnas_password = {{ hnas_password }}
hitachi_hnas_evs_id = {{ hnas_evs_id }}
hitachi_hnas_evs_ip = {{ hnas_evs_ip }}
hitachi_hnas_file_system_name = {{ hnas_file_system_name }}
{% endif %}
{% if enable_manila_backend_cephfs_native | bool %}
[cephfsnative1]
driver_handles_share_servers = False
share_backend_name = CEPHFS1
share_driver = manila.share.drivers.cephfs.driver.CephFSDriver
cephfs_conf_path = /etc/ceph/ceph.conf
cephfs_auth_id = {{ ceph_manila_user }}
cephfs_cluster_name = ceph
cephfs_enable_snapshots = False
{% endif %}
{% if enable_manila_backend_cephfs_nfs | bool %}
[cephfsnfs1]
driver_handles_share_servers = False
share_backend_name = CEPHFSNFS1
share_driver = manila.share.drivers.cephfs.driver.CephFSDriver
cephfs_protocol_helper_type = NFS
cephfs_conf_path = /etc/ceph/ceph.conf
cephfs_auth_id = {{ ceph_manila_user }}
cephfs_cluster_name = ceph
cephfs_enable_snapshots = False
cephfs_ganesha_server_is_remote= False
cephfs_ganesha_server_ip = {{ api_interface_address }}
{% endif %}