Fix mistral service
- Add mistral in HAproxy - Set mistral api to bind on api_interface - Fix mistral endpoint - Add database population on bootstraping - Add mistral port prechecks Change-Id: If1617fb9dcd8b3bbd4f94c68ca87c36e39711016 Closes-Bug: #1626570
This commit is contained in:
parent
8bde923bba
commit
a71874f24f
@ -552,6 +552,22 @@ listen congress_api_external
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if enable_mistral | bool %}
|
||||
listen mistral_api
|
||||
bind {{ kolla_internal_vip_address }}:{{ mistral_api_port }}
|
||||
{% for host in groups['mistral-api'] %}
|
||||
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ mistral_api_port }} check inter 2000 rise 2 fall 5
|
||||
{% endfor %}
|
||||
{% if haproxy_enable_external_vip | bool %}
|
||||
|
||||
listen mistral_api_external
|
||||
bind {{ kolla_external_vip_address }}:{{ mistral_api_port }} {{ tls_bind_info }}
|
||||
{% for host in groups['mistral-api'] %}
|
||||
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ mistral_api_port }} check inter 2000 rise 2 fall 5
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
# (NOTE): This defaults section deletes forwardfor as recomended by:
|
||||
# https://marc.info/?l=haproxy&m=141684110710132&w=1
|
||||
|
||||
|
@ -28,9 +28,9 @@ mistral_api_image_full: "{{ mistral_api_image }}:{{ mistral_api_tag }}"
|
||||
####################
|
||||
# OpenStack
|
||||
####################
|
||||
mistral_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ mistral_api_port }}"
|
||||
mistral_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ mistral_api_port }}"
|
||||
mistral_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ mistral_api_port }}"
|
||||
mistral_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ mistral_api_port }}/v2"
|
||||
mistral_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ mistral_api_port }}/v2"
|
||||
mistral_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ mistral_api_port }}/v2"
|
||||
|
||||
mistral_logging_debug: "{{ openstack_logging_debug }}"
|
||||
|
||||
|
@ -7,13 +7,14 @@ log_dir = /var/log/kolla/mistral
|
||||
# stderr and collected by Docker
|
||||
use_stderr = False
|
||||
|
||||
{% if service_name == 'mistral-api' %}
|
||||
bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
|
||||
bind_port = {{ mistral_api_port }}
|
||||
{% endif %}
|
||||
|
||||
transport_url = rabbit://{% for host in groups['rabbitmq'] %}{{ rabbitmq_user }}:{{ rabbitmq_password }}@{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %}
|
||||
|
||||
{% if service_name == 'mistral-api' %}
|
||||
[api]
|
||||
host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
|
||||
port = {{ mistral_api_port }}
|
||||
{% endif %}
|
||||
|
||||
[database]
|
||||
connection = mysql+pymysql://{{ mistral_database_user }}:{{ mistral_database_password }}@{{ mistral_database_address }}/{{ mistral_database_name }}
|
||||
max_retries = -1
|
||||
|
@ -553,6 +553,22 @@
|
||||
state: stopped
|
||||
when: inventory_hostname in groups['haproxy']
|
||||
|
||||
- name: Checking free port for Mistral API
|
||||
wait_for:
|
||||
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
|
||||
port: "{{ mistral_api_port }}"
|
||||
connect_timeout: 1
|
||||
state: stopped
|
||||
when: inventory_hostname in groups['mistral-api']
|
||||
|
||||
- name: Checking free port for Mistral API HAProxy
|
||||
wait_for:
|
||||
host: "{{ kolla_internal_vip_address }}"
|
||||
port: "{{ mistral_api_port }}"
|
||||
connect_timeout: 1
|
||||
state: stopped
|
||||
when: inventory_hostname in groups['haproxy']
|
||||
|
||||
- name: Checking if kolla_internal_vip_address and kolla_external_vip_address are not pingable from any node
|
||||
command: ping -c 3 {{ item }}
|
||||
register: ping_output
|
||||
|
@ -4,5 +4,6 @@
|
||||
# of the KOLLA_BOOTSTRAP variable being set, including empty.
|
||||
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
|
||||
mistral-db-manage --config-file /etc/mistral/mistral.conf upgrade head
|
||||
mistral-db-manage --config-file /etc/mistral/mistral.conf populate
|
||||
exit 0
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user