OpenStack-Ansible murano role

Default variables

# Installation method
murano_install_method: "{{ service_install_method | default('source') }}"

# Operating system user & groups
murano_system_user_name: murano
murano_system_group_name: murano
murano_system_comment: Murano Daemons
murano_system_user_home: /var/lib/murano
murano_system_shell: /sbin/nologin

# Distribution deployment
murano_package_state: "{{ package_state | default('latest') }}"

# Set this to True during initial setup, if you want to skip
# import of the Core Murano Library.
# This var is stored in local ansible facts.d and set to True
# after the first successful run.
murano_library_installed: False

# ID or name of the external network for routers to connect to
murano_public_net_name: "public"

# Source package builds
murano_git_repo: https://opendev.org/openstack/murano
murano_git_install_branch: master
murano_upper_constraints_url: >-
  {{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}
murano_git_constraints:
  - "--constraint {{ murano_upper_constraints_url }}"
murano_pip_packages:
  - "git+{{ murano_git_repo }}@{{ murano_git_install_branch }}#egg=murano"
  - PyMySQL
  - python-memcached
  - pymemcache
  - systemd-python
murano_optional_oslomsg_amqp1_pip_packages:
  - oslo.messaging[amqp1]
murano_venv_tag: "{{ venv_tag | default('untagged') }}"
murano_bin: "{{ _murano_bin }}"

murano_pip_install_args: "{{ pip_install_options | default('') }}"

murano_memcached_servers: "{{ memcached_servers }}"

# Services
murano_services:
  murano-api:
    group: murano_api
    service_name: murano-api
    execstarts: "{{ murano_bin }}/murano-api"
    init_config_overrides: "{{ murano_api_init_overrides }}"
    start_order: 1
    wsgi_app: True
    wsgi_name: murano-wsgi-api
    uwsgi_overrides: "{{ murano_api_uwsgi_ini_overrides }}"
    uwsgi_bind_address: "{{ murano_bind_address }}"
    uwsgi_port: "{{ murano_service_port }}"
    uwsgi_tls: "{{ murano_backend_ssl | ternary(murano_uwsgi_tls, {}) }}"
  murano-engine:
    group: murano_engine
    service_name: murano-engine
    execstarts: "{{ murano_bin }}/murano-engine"
    init_config_overrides: "{{ murano_engine_init_overrides }}"
    start-order: 1

# Murano uWSGI settings
murano_wsgi_processes_max: 16
murano_wsgi_processes: "{{ [[ansible_facts['processor_vcpus'] | default(1), 1] | max * 2, murano_wsgi_processes_max] | min }}"
murano_wsgi_threads: 1
murano_uwsgi_tls:
  crt: "{{ murano_ssl_cert }}"
  key: "{{ murano_ssl_key }}"

# RPC
murano_oslomsg_rpc_host_group: "{{ oslomsg_rpc_host_group | default('rabbitmq_all') }}"
murano_oslomsg_rpc_setup_host: "{{ (murano_oslomsg_rpc_host_group in groups) | ternary(groups[murano_oslomsg_rpc_host_group][0], 'localhost') }}"
murano_oslomsg_rpc_transport: "{{ oslomsg_rpc_transport | default('rabbit') }}"
murano_oslomsg_rpc_servers: "{{ oslomsg_rpc_servers | default('127.0.0.1') }}"
murano_oslomsg_rpc_port: "{{ oslomsg_rpc_port | default('5672') }}"
murano_oslomsg_rpc_use_ssl: "{{ oslomsg_rpc_use_ssl | default(False) }}"
murano_oslomsg_rpc_userid: murano
# vhost name depends on value of oslomsg_rabbit_quorum_queues. In case quorum queues
# are not used - vhost name will be prefixed with leading `/`.
murano_oslomsg_rpc_vhost:
  - name: /murano
    state: "{{ murano_oslomsg_rabbit_quorum_queues | ternary('absent', 'present') }}"
  - name: murano
    state: "{{ murano_oslomsg_rabbit_quorum_queues | ternary('present', 'absent') }}"
murano_oslomsg_rpc_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}"
murano_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"

# Notify
murano_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
murano_oslomsg_notify_setup_host: "{{ (murano_oslomsg_notify_host_group in groups) | ternary(groups[murano_oslomsg_notify_host_group][0], 'localhost') }}"
murano_oslomsg_notify_transport: "{{ oslomsg_notify_transport | default('rabbit') }}"
murano_oslomsg_notify_servers: "{{ oslomsg_notify_servers | default('127.0.0.1') }}"
murano_oslomsg_notify_port: "{{ oslomsg_notify_port | default('5672') }}"
murano_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}"
murano_oslomsg_notify_userid: "{{ murano_oslomsg_rpc_userid }}"
murano_oslomsg_notify_password: "{{ murano_oslomsg_rpc_password }}"
murano_oslomsg_notify_vhost: "{{ murano_oslomsg_rpc_vhost }}"
murano_oslomsg_notify_ssl_version: "{{ oslomsg_notify_ssl_version | default('TLSv1_2') }}"
murano_oslomsg_notify_ssl_ca_file: "{{ oslomsg_notify_ssl_ca_file | default('') }}"

## RabbitMQ integration
murano_oslomsg_rabbit_quorum_queues: "{{ oslomsg_rabbit_quorum_queues | default(True) }}"
murano_oslomsg_rabbit_quorum_delivery_limit: "{{ oslomsg_rabbit_quorum_delivery_limit | default(0) }}"
murano_oslomsg_rabbit_quorum_max_memory_bytes: "{{ oslomsg_rabbit_quorum_max_memory_bytes | default(0) }}"

# (Qdrouterd) integration
murano_oslomsg_amqp1_enabled: "{{ murano_oslomsg_rpc_transport == 'amqp' }}"

# Database
murano_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}"
murano_db_setup_python_interpreter: >-
  {{
    openstack_db_setup_python_interpreter | default(
      (murano_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable']))
  }}
murano_galera_address: "{{ galera_address | default('127.0.0.1') }}"
murano_galera_database: murano
murano_galera_user: murano
murano_galera_port: "{{ galera_port | default('3306') }}"
murano_galera_use_ssl: "{{ galera_use_ssl | default(False) }}"
murano_galera_ssl_ca_cert: "{{ galera_ssl_ca_cert | default('') }}"
murano_db_max_overflow: "{{ openstack_db_max_overflow | default('50') }}"
murano_db_max_pool_size: "{{ openstack_db_max_pool_size | default('5') }}"
murano_db_pool_timeout: "{{ openstack_db_pool_timeout | default('30') }}"
murano_db_connection_recycle_time: "{{ openstack_db_connection_recycle_time | default('600') }}"

# Configuration options
murano_debug: "{{ debug | default(false) }}"
murano_bind_address: "{{ openstack_service_bind_address | default('0.0.0.0') }}"
murano_service_port: 8082

# Overrides
murano_api_init_overrides: {}
murano_api_uwsgi_ini_overrides: {}
murano_engine_init_overrides: {}
murano_murano_conf_overrides: {}
murano_paste_conf_overrides: {}

# Service setup
murano_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
murano_service_setup_host_python_interpreter: >-
  {{
    openstack_service_setup_host_python_interpreter | default(
      (murano_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable']))
  }}
murano_service_name: murano
murano_service_type: application-catalog
murano_service_description: OpenStack Application Catalog service
murano_service_in_ldap: "{{ service_ldap_backend_enabled | default(False) }}"
murano_service_user_domain_id: default
murano_service_user_name: murano
murano_service_project_domain_id: default
murano_service_project_name: service
murano_service_role_names:
  - admin
  - service
murano_service_token_roles:
  - service
murano_service_token_roles_required: "{{ openstack_service_token_roles_required | default(True) }}"
murano_service_region: "{{ service_region | default('RegionOne') }}"
murano_service_proto: http
murano_service_publicuri_proto: "{{ openstack_service_publicuri_proto | default(murano_service_proto) }}"
murano_service_publicurl: "{{ murano_service_publicuri_proto }}://{{ external_lb_vip_address }}:{{ murano_service_port }}"
murano_service_internaluri_proto: "{{ openstack_service_internaluri_proto | default(murano_service_proto) }}"
murano_service_internalurl: "{{ murano_service_internaluri_proto }}://{{ internal_lb_vip_address }}:{{ murano_service_port }}"
murano_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(murano_service_proto) }}"
murano_service_adminurl: "{{ murano_service_adminuri_proto }}://{{ internal_lb_vip_address }}:{{ murano_service_port }}"
murano_ceilometer_enabled: False

# Specific pip packages provided by the user
murano_user_pip_packages: []

###
### Backend TLS
###

# Define if communication between haproxy and service backends should be
# encrypted with TLS.
murano_backend_ssl: "{{ openstack_service_backend_ssl | default(False) }}"

# Storage location for SSL certificate authority
murano_pki_dir: "{{ openstack_pki_dir | default('/etc/openstack_deploy/pki') }}"

# Delegated host for operating the certificate authority
murano_pki_setup_host: "{{ openstack_pki_setup_host | default('localhost') }}"

# murano server certificate
murano_pki_keys_path: "{{ murano_pki_dir ~ '/certs/private/' }}"
murano_pki_certs_path: "{{ murano_pki_dir ~ '/certs/certs/' }}"
murano_pki_intermediate_cert_name: "{{ openstack_pki_service_intermediate_cert_name | default('ExampleCorpIntermediate') }}"
murano_pki_regen_cert: ''
murano_pki_san: "{{ openstack_pki_san | default('DNS:' ~ ansible_facts['hostname'] ~ ',IP:' ~ management_address) }}"
murano_pki_certificates:
  - name: "murano_{{ ansible_facts['hostname'] }}"
    provider: ownca
    cn: "{{ ansible_facts['hostname'] }}"
    san: "{{ murano_pki_san }}"
    signed_by: "{{ murano_pki_intermediate_cert_name }}"

# murano destination files for SSL certificates
murano_ssl_cert: /etc/murano/murano.pem
murano_ssl_key: /etc/murano/murano.key

# Installation details for SSL certificates
murano_pki_install_certificates:
  - src: "{{ murano_user_ssl_cert | default(murano_pki_certs_path ~ 'murano_' ~ ansible_facts['hostname'] ~ '-chain.crt') }}"
    dest: "{{ murano_ssl_cert }}"
    owner: "{{ murano_system_user_name }}"
    group: "{{ murano_system_user_name }}"
    mode: "0644"
  - src: "{{ murano_user_ssl_key | default(murano_pki_keys_path ~ 'murano_' ~ ansible_facts['hostname'] ~ '.key.pem') }}"
    dest: "{{ murano_ssl_key }}"
    owner: "{{ murano_system_user_name }}"
    group: "{{ murano_system_user_name }}"
    mode: "0600"

# Define user-provided SSL certificates
# murano_user_ssl_cert: <path to cert on ansible deployment host>
# murano_user_ssl_key: <path to cert on ansible deployment host>

Example playbook

---
# Copyright 2019, VEXXHOST, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

- name: Gather murano facts
  hosts: murano_all
  gather_facts: "{{ osa_gather_facts | default(True) }}"
  tasks:
    - name: Gather additional facts
      include_tasks: "common-tasks/gather-hardware-facts.yml"
      when: osa_gather_facts | default(True)
  tags:
    - always

- name: Configure haproxy services
  import_playbook: openstack.osa.haproxy_service_config
  vars:
    service_group: murano_api
    service_variable: "murano_haproxy_services"
  when: groups[service_group] | length > 0
  tags:
    - haproxy-service-config

- name: Install murano components
  hosts: murano_all
  gather_facts: false
  serial: "{{ murano_serial | default(['1','100%']) }}"
  environment: "{{ deployment_environment_variables | default({}) }}"
  user: root
  vars_files:
    - "defaults/{{ install_method }}_install.yml"
  tags:
    - murano
  pre_tasks:
    # In order to ensure that any container, software or
    # config file changes which causes a container/service
    # restart do not cause an unexpected outage, we drain
    # the load balancer back end for this container.
    - name: Disabling haproxy backends
      include_tasks: common-tasks/haproxy-endpoint-manage.yml
      vars:
        haproxy_backend: murano-back
        haproxy_state: disabled
      when:
        - "'murano_all' in group_names"
        - "groups['murano_all'] | length > 1"

    - name: Including container-setup tasks
      include_role:
        name: "openstack.osa.{{ container_tech | default('lxc') }}_container_setup"
      when: not is_metal

    - name: Including unbound-clients tasks
      include_tasks: common-tasks/unbound-clients.yml
      when:
        - hostvars['localhost']['resolvconf_enabled'] | bool

  roles:
    - role: "os_murano"
    - role: "openstack.osa.system_crontab_coordination"
      tags:
        - crontab

  post_tasks:
    # Now that container changes are done, we can set
    # the load balancer back end for this container
    # to available again.
    - name: Enabling haproxy backends
      include_tasks: common-tasks/haproxy-endpoint-manage.yml
      vars:
        haproxy_backend: murano-back
        haproxy_state: enabled
      when:
        - "'murano_all' in group_names"
        - "groups['murano_all'] | length > 1"