diff --git a/templates/folsom/nova.conf b/templates/folsom/nova.conf index ad39738f..a9484b7b 100644 --- a/templates/folsom/nova.conf +++ b/templates/folsom/nova.conf @@ -25,23 +25,10 @@ volumes_path=/var/lib/nova/volumes enabled_apis=ec2,osapi_compute,metadata auth_strategy=keystone compute_driver=libvirt.LibvirtDriver -{% if database_host -%} -sql_connection = {{ database_type }}://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}{% if database_ssl_ca %}?ssl_ca={{ database_ssl_ca }}{% if database_ssl_cert %}&ssl_cert={{ database_ssl_cert }}&ssl_key={{ database_ssl_key }}{% endif %}{% endif %} -{% endif -%} -{% if rabbitmq_host -%} -rabbit_host = {{ rabbitmq_host }} -rabbit_userid = {{ rabbitmq_user }} -rabbit_password = {{ rabbitmq_password }} -rabbit_virtual_host = {{ rabbitmq_virtual_host }} -{% if rabbit_ssl_port %} -rabbit_use_ssl=True -rabbit_port={{ rabbit_ssl_port }} -{% if rabbit_ssl_ca %} -kombu_ssl_ca_certs={{rabbit_ssl_ca}} -{% endif %} -{% endif %} -{% endif -%} +{% include "parts/database" %} + +{% include "parts/rabbitmq" %} {% if glance_api_servers -%} glance_api_servers = {{ glance_api_servers }} diff --git a/templates/folsom/quantum.conf b/templates/folsom/quantum.conf index ae449e99..62daa9d5 100644 --- a/templates/folsom/quantum.conf +++ b/templates/folsom/quantum.conf @@ -17,20 +17,8 @@ auth_strategy = keystone notification_driver = quantum.openstack.common.notifier.rpc_notifier default_notification_level = INFO notification_topics = notifications -{% if rabbitmq_host -%} -rabbit_host = {{ rabbitmq_host }} -rabbit_userid = {{ rabbitmq_user }} -rabbit_password = {{ rabbitmq_password }} -rabbit_virtual_host = {{ rabbitmq_virtual_host }} -{% if rabbit_ssl_port %} -rabbit_use_ssl=True -rabbit_port={{ rabbit_ssl_port }} -{% if rabbit_ssl_ca %} -kombu_ssl_ca_certs={{rabbit_ssl_ca}} -{% endif %} -{% endif %} -{% endif -%} +{% include "parts/rabbitmq" %} [QUOTAS] diff --git a/templates/grizzly/nova.conf b/templates/grizzly/nova.conf index a9debfee..6c9cf43f 100644 --- a/templates/grizzly/nova.conf +++ b/templates/grizzly/nova.conf @@ -25,31 +25,10 @@ volumes_path=/var/lib/nova/volumes enabled_apis=ec2,osapi_compute,metadata auth_strategy=keystone compute_driver=libvirt.LibvirtDriver -{% if database_host -%} -sql_connection = {{ database_type }}://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}{% if database_ssl_ca %}?ssl_ca={{ database_ssl_ca }}{% if database_ssl_cert %}&ssl_cert={{ database_ssl_cert }}&ssl_key={{ database_ssl_key }}{% endif %}{% endif %} -{% endif -%} -{% if rabbitmq_host or rabbitmq_hosts -%} -rabbit_userid = {{ rabbitmq_user }} -rabbit_password = {{ rabbitmq_password }} -rabbit_virtual_host = {{ rabbitmq_virtual_host }} -{% if rabbitmq_hosts -%} -rabbit_hosts = {{ rabbitmq_hosts }} -{% if rabbitmq_ha_queues -%} -rabbit_ha_queues = true -rabbit_durable_queues = false -{% endif %} -{% else %} -rabbit_host = {{ rabbitmq_host }} -{% endif -%} -{% if rabbit_ssl_port %} -rabbit_use_ssl=True -rabbit_port={{ rabbit_ssl_port }} -{% if rabbit_ssl_ca %} -kombu_ssl_ca_certs={{rabbit_ssl_ca}} -{% endif %} -{% endif %} -{% endif -%} +{% include "parts/database" %} + +{% include "parts/rabbitmq" %} {% if glance_api_servers -%} glance_api_servers = {{ glance_api_servers }} diff --git a/templates/havana/neutron.conf b/templates/havana/neutron.conf index dfd6e552..50142f24 100644 --- a/templates/havana/neutron.conf +++ b/templates/havana/neutron.conf @@ -20,27 +20,7 @@ use_syslog = {{ use_syslog }} default_notification_level = INFO notification_topics = notifications -{% if rabbitmq_host or rabbitmq_hosts -%} -rabbit_userid = {{ rabbitmq_user }} -rabbit_password = {{ rabbitmq_password }} -rabbit_virtual_host = {{ rabbitmq_virtual_host }} -{% if rabbitmq_hosts -%} -rabbit_hosts = {{ rabbitmq_hosts }} -{% if rabbitmq_ha_queues -%} -rabbit_ha_queues = true -rabbit_durable_queues = false -{% endif %} -{% else %} -rabbit_host = {{ rabbitmq_host }} -{% endif -%} -{% if rabbit_ssl_port %} -rabbit_use_ssl=True -rabbit_port={{ rabbit_ssl_port }} -{% if rabbit_ssl_ca %} -kombu_ssl_ca_certs={{rabbit_ssl_ca}} -{% endif %} -{% endif %} -{% endif -%} +{% include "parts/rabbitmq" %} [QUOTAS] diff --git a/templates/havana/nova.conf b/templates/havana/nova.conf index a189cd96..d87579c1 100644 --- a/templates/havana/nova.conf +++ b/templates/havana/nova.conf @@ -25,31 +25,10 @@ volumes_path=/var/lib/nova/volumes enabled_apis=ec2,osapi_compute,metadata auth_strategy=keystone compute_driver=libvirt.LibvirtDriver -{% if database_host -%} -sql_connection = {{ database_type }}://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}{% if database_ssl_ca %}?ssl_ca={{ database_ssl_ca }}{% if database_ssl_cert %}&ssl_cert={{ database_ssl_cert }}&ssl_key={{ database_ssl_key }}{% endif %}{% endif %} -{% endif -%} -{% if rabbitmq_host or rabbitmq_hosts -%} -rabbit_userid = {{ rabbitmq_user }} -rabbit_password = {{ rabbitmq_password }} -rabbit_virtual_host = {{ rabbitmq_virtual_host }} -{% if rabbitmq_hosts -%} -rabbit_hosts = {{ rabbitmq_hosts }} -{% if rabbitmq_ha_queues -%} -rabbit_ha_queues = true -rabbit_durable_queues = false -{% endif %} -{% else %} -rabbit_host = {{ rabbitmq_host }} -{% endif -%} -{% if rabbit_ssl_port %} -rabbit_use_ssl=True -rabbit_port={{ rabbit_ssl_port }} -{% if rabbit_ssl_ca %} -kombu_ssl_ca_certs={{rabbit_ssl_ca}} -{% endif %} -{% endif %} -{%- endif -%} +{% include "parts/database" %} + +{% include "parts/rabbitmq" %} {% if glance_api_servers -%} glance_api_servers = {{ glance_api_servers }} diff --git a/templates/parts/database b/templates/parts/database new file mode 100644 index 00000000..aa194b73 --- /dev/null +++ b/templates/parts/database @@ -0,0 +1,3 @@ +{% if database_host -%} +sql_connection = {{ database_type }}://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}{% if database_ssl_ca %}?ssl_ca={{ database_ssl_ca }}{% if database_ssl_cert %}&ssl_cert={{ database_ssl_cert }}&ssl_key={{ database_ssl_key }}{% endif %}{% endif %} +{% endif -%} diff --git a/templates/parts/rabbitmq b/templates/parts/rabbitmq new file mode 100644 index 00000000..bbd0371d --- /dev/null +++ b/templates/parts/rabbitmq @@ -0,0 +1,21 @@ +{% if rabbitmq_host or rabbitmq_hosts -%} +rabbit_userid = {{ rabbitmq_user }} +rabbit_virtual_host = {{ rabbitmq_virtual_host }} +rabbit_password = {{ rabbitmq_password }} +{% if rabbitmq_hosts -%} +rabbit_hosts = {{ rabbitmq_hosts }} +{% if rabbitmq_ha_queues -%} +rabbit_ha_queues = True +rabbit_durable_queues = False +{% endif -%} +{% else -%} +rabbit_host = {{ rabbitmq_host }} +{% endif -%} +{% if rabbit_ssl_port -%} +rabbit_use_ssl = True +rabbit_port = {{ rabbit_ssl_port }} +{% if rabbit_ssl_ca -%} +kombu_ssl_ca_certs = {{ rabbit_ssl_ca }} +{% endif -%} +{% endif -%} +{% endif -%} \ No newline at end of file