Blazar role for OpenStack-Ansible¶
- tags:
openstack, blazar, cloud, ansible
- category:
*nix
To clone or view the source code for this repository, visit the role repository for os_blazar.
Default variables¶
# Set the host which will execute the shade modules
# for the service setup. The host must already have
# clouds.yaml properly configured.
blazar_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
blazar_service_setup_host_python_interpreter: >-
{{
openstack_service_setup_host_python_interpreter | default(
(blazar_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable']))
}}
blazar_package_state: "{{ package_state | default('latest') }}"
blazar_git_repo: https://opendev.org/openstack/blazar
blazar_git_install_branch: master
blazar_upper_constraints_url: >-
{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}
# Enable/Disable Ceilometer
blazar_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}"
blazar_pip_install_args: "{{ pip_install_options | default('') }}"
blazar_venv_tag: "{{ venv_tag | default('untagged') }}"
blazar_bin: "/openstack/venvs/blazar-{{ blazar_venv_tag }}/bin"
# Blazar configuration
blazar_etc_dir: /etc/blazar
blazar_config_option: "--config-file {{ blazar_etc_dir }}/blazar.conf"
blazar_nova_aggregate_name: freepool
blazar_manager_plugins:
- physical.host.plugin
- virtual.instance.plugin
- virtual.floatingip.plugin
blazar_memcached_servers: "{{ memcached_servers }}"
## Common PIP requirements
blazar_pip_packages:
- "git+{{ blazar_git_repo }}@{{ blazar_git_install_branch }}#egg=blazar"
- blazar-nova
- osprofiler
- pymysql
- python-blazarclient
- systemd-python
- pymemcache
- python-memcached
## blazar constraints
blazar_git_constraints:
- "--constraint {{ blazar_upper_constraints_url }}"
## System info
blazar_system_user_name: blazar
blazar_system_group_name: blazar
blazar_system_shell: /bin/false
blazar_system_comment: blazar system user
blazar_system_user_home: "/var/lib/{{ blazar_system_user_name }}"
## Database credentials
blazar_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}"
blazar_db_setup_python_interpreter: >-
{{
openstack_db_setup_python_interpreter | default(
(blazar_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable']))
}}
blazar_galera_address: "{{ galera_address | default('127.0.0.1') }}"
blazar_galera_database: blazar
blazar_galera_user: blazar
blazar_galera_use_ssl: "{{ galera_use_ssl | default(False) }}"
blazar_galera_ssl_ca_cert: "{{ galera_ssl_ca_cert | default('') }}"
blazar_galera_port: "{{ galera_port | default('3306') }}"
blazar_db_max_overflow: "{{ openstack_db_max_overflow | default('50') }}"
blazar_db_max_pool_size: "{{ openstack_db_max_pool_size | default('5') }}"
blazar_db_pool_timeout: "{{ openstack_db_pool_timeout | default('30') }}"
blazar_db_connection_recycle_time: "{{ openstack_db_connection_recycle_time | default('600') }}"
## Service Type and Data
blazar_service_name: blazar
blazar_service_region: "{{ service_region | default('RegionOne') }}"
blazar_service_proto: http
blazar_service_type: reservation
blazar_service_description: "blazar service"
blazar_service_publicuri: "{{ blazar_service_publicuri_proto }}://{{ external_lb_vip_address }}:{{ blazar_service_port }}/v1"
blazar_service_publicurl: "{{ blazar_service_publicuri }}"
blazar_service_internaluri: "{{ blazar_service_internaluri_proto }}://{{ internal_lb_vip_address }}:{{ blazar_service_port }}/v1"
blazar_service_internalurl: "{{ blazar_service_internaluri }}"
blazar_service_adminuri: "{{ blazar_service_adminuri_proto }}://{{ internal_lb_vip_address }}:{{ blazar_service_port }}/v1"
blazar_service_adminurl: "{{ blazar_service_adminuri }}"
blazar_service_registry_proto: "{{ blazar_service_proto }}"
blazar_service_publicuri_proto: "{{ openstack_service_publicuri_proto | default(blazar_service_proto) }}"
blazar_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(blazar_service_proto) }}"
blazar_service_internaluri_proto: "{{ openstack_service_internaluri_proto | default(blazar_service_proto) }}"
## Service name
blazar_services:
blazar-api:
group: blazar_all
service_name: blazar-api
init_config_overrides: "{{ blazar_api_init_config_overrides }}"
start_order: 1
wsgi_app: True
wsgi_name: blazar-api-wsgi
uwsgi_port: "{{ blazar_service_port }}"
uwsgi_bind_address: "{{ blazar_bind_address }}"
uwsgi_overrides: "{{ blazar_api_uwsgi_ini_overrides }}"
uwsgi_tls: "{{ blazar_backend_ssl | ternary(blazar_uwsgi_tls, {}) }}"
blazar-manager:
group: blazar_all
service_name: blazar-manager
execstarts: "{{ blazar_bin }}/blazar-manager {{ blazar_config_option }}"
init_config_overrides: "{{ blazar_manager_init_config_overrides }}"
start_order: 2
# Blazar uWSGI settings
blazar_wsgi_processes_max: 16
blazar_wsgi_processes: >-
{{ [[(ansible_facts['processor_vcpus'] // ansible_facts['processor_threads_per_core']) | default(1), 1] | max * 2, blazar_wsgi_processes_max] | min }}
blazar_wsgi_threads: 1
blazar_wsgi_buffer_size: 65535
blazar_uwsgi_tls:
crt: "{{ blazar_ssl_cert }}"
key: "{{ blazar_ssl_key }}"
## Keystone
blazar_service_project_domain_id: default
blazar_service_project_name: service
blazar_service_user_domain_id: default
blazar_service_user_name: blazar
blazar_service_role_names:
- admin
- service
blazar_service_token_roles:
- service
blazar_service_token_roles_required: "{{ openstack_service_token_roles_required | default(True) }}"
blazar_keystone_auth_plugin: password
blazar_service_in_ldap: "{{ service_ldap_backend_enabled | default(False) }}"
## Oslo Messaging
blazar_messaging_enabled: true
# RPC
blazar_oslomsg_rpc_host_group: "{{ oslomsg_rpc_host_group | default('rabbitmq_all') }}"
blazar_oslomsg_rpc_setup_host: "{{ (blazar_oslomsg_rpc_host_group in groups) | ternary(groups[blazar_oslomsg_rpc_host_group][0], 'localhost') }}"
blazar_oslomsg_rpc_transport: "{{ oslomsg_rpc_transport | default('rabbit') }}"
blazar_oslomsg_rpc_servers: "{{ oslomsg_rpc_servers | default('127.0.0.1') }}"
blazar_oslomsg_rpc_port: "{{ oslomsg_rpc_port | default('5672') }}"
blazar_oslomsg_rpc_use_ssl: "{{ oslomsg_rpc_use_ssl | default(False) }}"
blazar_oslomsg_rpc_userid: blazar
blazar_oslomsg_rpc_policies: []
# vhost name depends on value of oslomsg_rabbit_quorum_queues. In case quorum queues
# are not used - vhost name will be prefixed with leading `/`.
blazar_oslomsg_rpc_vhost:
- name: /blazar
state: "{{ blazar_oslomsg_rabbit_quorum_queues | ternary('absent', 'present') }}"
- name: blazar
state: "{{ blazar_oslomsg_rabbit_quorum_queues | ternary('present', 'absent') }}"
blazar_oslomsg_rpc_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}"
blazar_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Notify
blazar_oslomsg_notify_configure: "{{ oslomsg_notify_configure | default(blazar_ceilometer_enabled) }}"
blazar_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
blazar_oslomsg_notify_setup_host: "{{ (blazar_oslomsg_notify_host_group in groups) | ternary(groups[blazar_oslomsg_notify_host_group][0], 'localhost') }}"
blazar_oslomsg_notify_transport: "{{ oslomsg_notify_transport | default('rabbit') }}"
blazar_oslomsg_notify_servers: "{{ oslomsg_notify_servers | default('127.0.0.1') }}"
blazar_oslomsg_notify_port: "{{ oslomsg_notify_port | default('5672') }}"
blazar_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}"
blazar_oslomsg_notify_userid: "{{ blazar_oslomsg_rpc_userid }}"
blazar_oslomsg_notify_vhost: "{{ blazar_oslomsg_rpc_vhost }}"
blazar_oslomsg_notify_password: "{{ blazar_oslomsg_rpc_password }}"
blazar_oslomsg_notify_ssl_version: "{{ oslomsg_notify_ssl_version | default('TLSv1_2') }}"
blazar_oslomsg_notify_ssl_ca_file: "{{ oslomsg_notify_ssl_ca_file | default('') }}"
blazar_oslomsg_notify_policies: []
## RabbitMQ integration
blazar_oslomsg_rabbit_quorum_queues: "{{ oslomsg_rabbit_quorum_queues | default(True) }}"
blazar_oslomsg_rabbit_stream_fanout: "{{ oslomsg_rabbit_stream_fanout | default(blazar_oslomsg_rabbit_quorum_queues) }}"
blazar_oslomsg_rabbit_transient_quorum_queues: "{{ oslomsg_rabbit_transient_quorum_queues | default(blazar_oslomsg_rabbit_stream_fanout) }}"
blazar_oslomsg_rabbit_qos_prefetch_count: "{{ oslomsg_rabbit_qos_prefetch_count | default(blazar_oslomsg_rabbit_stream_fanout | ternary(10, 0)) }}"
blazar_oslomsg_rabbit_queue_manager: "{{ oslomsg_rabbit_queue_manager | default(blazar_oslomsg_rabbit_quorum_queues) }}"
blazar_oslomsg_rabbit_quorum_delivery_limit: "{{ oslomsg_rabbit_quorum_delivery_limit | default(0) }}"
blazar_oslomsg_rabbit_quorum_max_memory_bytes: "{{ oslomsg_rabbit_quorum_max_memory_bytes | default(0) }}"
blazar_bind_address: "{{ openstack_service_bind_address | default('0.0.0.0') }}"
blazar_service_port: 1234
blazar_program_name: blazar-server
## Tunable overrides
blazar_blazar_api_paste_ini_overrides: {}
blazar_policy_overrides: {}
blazar_blazar_conf_overrides: {}
blazar_api_init_config_overrides: {}
blazar_manager_init_config_overrides: {}
blazar_api_uwsgi_ini_overrides: {}
###
### Backend TLS
###
# Define if communication between haproxy and service backends should be
# encrypted with TLS.
blazar_backend_ssl: "{{ openstack_service_backend_ssl | default(False) }}"
# Storage location for SSL certificate authority
blazar_pki_dir: "{{ openstack_pki_dir | default('/etc/openstack_deploy/pki') }}"
# Delegated host for operating the certificate authority
blazar_pki_setup_host: "{{ openstack_pki_setup_host | default('localhost') }}"
# blazar server certificate
blazar_pki_keys_path: "{{ blazar_pki_dir ~ '/certs/private/' }}"
blazar_pki_certs_path: "{{ blazar_pki_dir ~ '/certs/certs/' }}"
blazar_pki_intermediate_cert_name: "{{ openstack_pki_service_intermediate_cert_name | default('ExampleCorpIntermediate') }}"
blazar_pki_regen_cert: ''
blazar_pki_san: "{{ openstack_pki_san | default('DNS:' ~ ansible_facts['hostname'] ~ ',IP:' ~ management_address) }}"
blazar_pki_certificates:
- name: "blazar_{{ ansible_facts['hostname'] }}"
provider: ownca
cn: "{{ ansible_facts['hostname'] }}"
san: "{{ blazar_pki_san }}"
signed_by: "{{ blazar_pki_intermediate_cert_name }}"
# blazar destination files for SSL certificates
blazar_ssl_cert: /etc/blazar/blazar.pem
blazar_ssl_key: /etc/blazar/blazar.key
# Installation details for SSL certificates
blazar_pki_install_certificates:
- src: "{{ blazar_user_ssl_cert | default(blazar_pki_certs_path ~ 'blazar_' ~ ansible_facts['hostname'] ~ '-chain.crt') }}"
dest: "{{ blazar_ssl_cert }}"
owner: "{{ blazar_system_user_name }}"
group: "{{ blazar_system_user_name }}"
mode: "0644"
- src: "{{ blazar_user_ssl_key | default(blazar_pki_keys_path ~ 'blazar_' ~ ansible_facts['hostname'] ~ '.key.pem') }}"
dest: "{{ blazar_ssl_key }}"
owner: "{{ blazar_system_user_name }}"
group: "{{ blazar_system_user_name }}"
mode: "0600"
# Define user-provided SSL certificates
# blazar_user_ssl_cert: <path to cert on ansible deployment host>
# blazar_user_ssl_key: <path to cert on ansible deployment host>
Dependencies¶
This role needs pip >= 7.1 installed on the target host.
Example playbook¶
---
- name: Install blazar server
hosts: blazar_all
user: root
roles:
- role: os_blazar
tags:
- os-blazar