OpenStack-Ansible mistral role¶
This role installs the following Systemd services:
mistral-api
mistral-engine
mistral-executor
mistral-notifier
To clone or view the source code for this repository, visit the role repository for os_mistral.
Default variables¶
# Installation method
mistral_install_method: "source"
mistral_venv_python_executable: "{{ openstack_venv_python_executable | default('python2') }}"
# Operating system user & groups
mistral_system_user_name: mistral
mistral_system_group_name: mistral
mistral_system_shell: /sbin/nologin
mistral_system_comment: Mistral Daemons
mistral_system_user_home: /var/lib/mistral
# Distribution deployment
mistral_package_state: latest
# Source package builds
mistral_git_repo: https://opendev.org/openstack/mistral
mistral_git_install_branch: master
mistral_upper_constraints_url: "{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}"
mistral_git_constraints:
- "git+{{ mistral_git_repo }}@{{ mistral_git_install_branch }}#egg=mistral"
- "--constraint {{ mistral_upper_constraints_url }}"
mistral_pip_packages:
- mistral
- PyMySQL
- pymemcache
- python-memcached
- systemd-python
mistral_optional_oslomsg_amqp1_pip_packages:
- oslo.messaging[amqp1]
mistral_venv_tag: "{{ venv_tag | default('untagged') }}"
mistral_bin: "{{ _mistral_bin }}"
mistral_pip_install_args: "{{ pip_install_options | default('') }}"
mistral_memcached_servers: "{{ memcached_servers }}"
# Services
mistral_services:
mistral-notifier:
group: mistral_notifier
service_name: mistral-notifier
init_config_overrides: "{{ mistral_notifier_init_overrides }}"
start_order: 1
execstarts: "{{ _mistral_bin }}/mistral-server --server notifier"
mistral-executor:
group: mistral_executor
service_name: mistral-executor
init_config_overrides: "{{ mistral_executor_init_overrides }}"
start_order: 1
execstarts: "{{ _mistral_bin }}/mistral-server --server executor"
mistral-engine:
group: mistral_engine
service_name: mistral-engine
init_config_overrides: "{{ mistral_engine_init_overrides }}"
start_order: 1
execstarts: "{{ _mistral_bin }}/mistral-server --server engine"
mistral-api:
group: mistral_api
service_name: mistral-api
init_config_overrides: "{{ mistral_api_init_overrides }}"
start_order: 2
wsgi_app: true
wsgi_name: mistral-wsgi-api
uwsgi_overrides: "{{ mistral_api_uwsgi_ini_overrides }}"
uwsgi_bind_address: "{{ mistral_bind_address }}"
uwsgi_port: "{{ mistral_service_port }}"
# UWSGI settings
mistral_wsgi_processes_max: 16
mistral_wsgi_processes: "{{ [[ansible_processor_vcpus|default(1), 1] | max * 2, mistral_wsgi_processes_max] | min }}"
mistral_wsgi_threads: 1
# RPC
mistral_oslomsg_rpc_host_group: "{{ oslomsg_rpc_host_group | default('rabbitmq_all') }}"
mistral_oslomsg_rpc_setup_host: "{{ (mistral_oslomsg_rpc_host_group in groups) | ternary(groups[mistral_oslomsg_rpc_host_group][0], 'localhost') }}"
mistral_oslomsg_rpc_transport: "{{ oslomsg_rpc_transport | default('rabbit') }}"
mistral_oslomsg_rpc_servers: "{{ oslomsg_rpc_servers | default('127.0.0.1') }}"
mistral_oslomsg_rpc_port: "{{ oslomsg_rpc_port | default('5672') }}"
mistral_oslomsg_rpc_use_ssl: "{{ oslomsg_rpc_use_ssl | default(False) }}"
mistral_oslomsg_rpc_userid: mistral
mistral_oslomsg_rpc_vhost: /mistral
# Notify
mistral_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
mistral_oslomsg_notify_setup_host: "{{ (mistral_oslomsg_notify_host_group in groups) | ternary(groups[mistral_oslomsg_notify_host_group][0], 'localhost') }}"
mistral_oslomsg_notify_transport: "{{ oslomsg_notify_transport | default('rabbit') }}"
mistral_oslomsg_notify_servers: "{{ oslomsg_notify_servers | default('127.0.0.1') }}"
mistral_oslomsg_notify_port: "{{ oslomsg_notify_port | default('5672') }}"
mistral_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}"
mistral_oslomsg_notify_userid: "{{ mistral_oslomsg_rpc_userid }}"
mistral_oslomsg_notify_password: "{{ mistral_oslomsg_rpc_password }}"
mistral_oslomsg_notify_vhost: "{{ mistral_oslomsg_rpc_vhost }}"
# (Qdrouterd) integration
mistral_oslomsg_amqp1_enabled: "{{ mistral_oslomsg_rpc_transport == 'amqp' }}"
# Database
mistral_db_setup_host: "{{ ('galera_all' in groups) | ternary(groups['galera_all'][0], 'localhost') }}"
mistral_galera_address: "{{ galera_address | default('127.0.0.1') }}"
mistral_galera_database: mistral
mistral_galera_user: mistral
# Configuration options
mistral_debug: "{{ debug | default(false) }}"
mistral_bind_address: "{{ openstack_service_bind_address | default('0.0.0.0') }}"
mistral_service_port: 8989
# Overrides
mistral_notifier_init_overrides: {}
mistral_executor_init_overrides: {}
mistral_engine_init_overrides: {}
mistral_api_init_overrides: {}
mistral_api_uwsgi_ini_overrides: {}
mistral_mistral_conf_overrides: {}
mistral_policy_overrides: {}
# Service setup
mistral_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
mistral_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((mistral_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable'])) }}"
mistral_service_name: mistral
mistral_service_type: workflowv2
mistral_service_description: OpenStack Workflow service
mistral_service_in_ldap: false
mistral_service_user_domain_id: default
mistral_service_user_name: mistral
mistral_service_project_domain_id: default
mistral_service_project_name: service
mistral_role_name: admin
mistral_service_region: RegionOne
mistral_service_proto: http
mistral_service_publicuri_proto: "{{ openstack_service_publicuri_proto | default(mistral_service_proto) }}"
mistral_service_publicurl: "{{ mistral_service_publicuri_proto }}://{{ external_lb_vip_address }}:{{ mistral_service_port }}/v2"
mistral_service_internaluri_proto: "{{ openstack_service_internaluri_proto | default(mistral_service_proto) }}"
mistral_service_internalurl: "{{ mistral_service_internaluri_proto }}://{{ internal_lb_vip_address }}:{{ mistral_service_port }}/v2"
mistral_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(mistral_service_proto) }}"
mistral_service_adminurl: "{{ mistral_service_adminuri_proto }}://{{ internal_lb_vip_address }}:{{ mistral_service_port }}/v2"
# Specific pip packages provided by the user
mistral_user_pip_packages: []
Example playbook¶
---
- name: Install mistral server
hosts: mistral_all
user: root
roles:
- { role: "os_mistral", tags: [ "os-mistral" ] }
External Restart Hooks¶
When the role performs a restart of the service, it will notify an Ansible
handler named Manage LB
, which is a noop within this role. In the
playbook, other roles may be loaded before and after this role which will
implement Ansible handler listeners for Manage LB
, allowing external roles
to manage the load balancer endpoints responsible for sending traffic to the
servers being restarted by marking them in maintenance or active mode,
draining sessions, etc. For an example implementation, please reference the
ansible-haproxy-endpoints role
used by the openstack-ansible project.
Tags¶
This role supports two tags: mistral-install
and mistral-config
.
The mistral-install
tag can be used to install and upgrade. The
mistral-config
tag can be used to manage configuration.