Manila role for OpenStack-Ansible

This Ansible role installs and configures OpenStack manila.

The following manila services are managed by the role:
  • manila_api

  • manila_scheduler

  • manila_share

  • manila_data (untested)

To clone of view the source code for this repository, visit the role repository for os_manila.

Default variables

# Set the package install state for distribution and pip packages
# Options are 'present' and 'latest'
manila_package_state: "latest"
manila_pip_package_state: "latest"

# Set the host which will execute the shade modules
# for the service setup. The host must already have
# clouds.yaml properly configured.
manila_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
manila_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((manila_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable'])) }}"

# Set installation method.
manila_install_method: "source"
manila_venv_python_executable: "{{ openstack_venv_python_executable | default('python2') }}"

manila_git_repo: https://opendev.org/openstack/manila
manila_git_install_branch: master
manila_upper_constraints_url: "{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}"
manila_git_constraints:
  - "git+{{ manila_git_repo }}@{{ manila_git_install_branch }}#egg=manila"
  - "--constraint {{ manila_upper_constraints_url }}"

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

# Name of the virtual env to deploy into
manila_venv_tag: "{{ venv_tag | default('untagged') }}"
manila_bin: "{{ _manila_bin }}"

# Enable/Disable Ceilometer
manila_ceilometer_enabled: False

manila_storage_availability_zone: nova
manila_default_availability_zone: "{{ manila_storage_availability_zone }}"

manila_management_address: 127.0.0.1
manila_uwsgi_bind_address: "{{ openstack_service_bind_address | default('0.0.0.0') }}"

manila_fatal_deprecations: False

## Database info
manila_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}"
manila_db_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter | default((manila_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable'])) }}"
manila_galera_address: "{{ galera_address | default('127.0.0.1') }}"
manila_galera_user: manila
manila_galera_database: manila
manila_galera_use_ssl: "{{ galera_use_ssl | default(False) }}"
manila_galera_ssl_ca_cert: "{{ galera_ssl_ca_cert | default('/etc/ssl/certs/galera-ca.pem') }}"
manila_galera_port: 3306

## Oslo Messaging

# RPC
manila_oslomsg_rpc_host_group: "{{ oslomsg_rpc_host_group | default('rabbitmq_all') }}"
manila_oslomsg_rpc_setup_host: "{{ (manila_oslomsg_rpc_host_group in groups) | ternary(groups[manila_oslomsg_rpc_host_group][0], 'localhost') }}"
manila_oslomsg_rpc_transport: "{{ oslomsg_rpc_transport | default('rabbit') }}"
manila_oslomsg_rpc_servers: "{{ oslomsg_rpc_servers | default('127.0.0.1') }}"
manila_oslomsg_rpc_port: "{{ oslomsg_rpc_port | default('5672') }}"
manila_oslomsg_rpc_use_ssl: "{{ oslomsg_rpc_use_ssl | default(False) }}"
manila_oslomsg_rpc_userid: manila
manila_oslomsg_rpc_vhost: /manila

# Notify
manila_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
manila_oslomsg_notify_setup_host: "{{ (manila_oslomsg_notify_host_group in groups) | ternary(groups[manila_oslomsg_notify_host_group][0], 'localhost') }}"
manila_oslomsg_notify_transport: "{{ oslomsg_notify_transport | default('rabbit') }}"
manila_oslomsg_notify_servers: "{{ oslomsg_notify_servers | default('127.0.0.1') }}"
manila_oslomsg_notify_port: "{{ oslomsg_notify_port | default('5672') }}"
manila_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}"
manila_oslomsg_notify_userid: "{{ manila_oslomsg_rpc_userid }}"
manila_oslomsg_notify_password: "{{ manila_oslomsg_rpc_password }}"
manila_oslomsg_notify_vhost: "{{ manila_oslomsg_rpc_vhost }}"

## (Qdrouterd) integration
# TODO(evrardjp): Change structure when more backends will be supported
manila_oslomsg_amqp1_enabled: "{{ manila_oslomsg_rpc_transport == 'amqp' }}"

## Manila User / Group
manila_system_user_name: manila
manila_system_group_name: manila
manila_system_comment: manila system user
manila_system_shell: /bin/false
manila_system_home_folder: "/var/lib/{{ manila_system_user_name }}"

## Manually specified manila UID/GID
# Deployers can specify a UID for the manila user as well as the GID for the
# manila group if needed. This is commonly used in environments where shared
# storage is used, such as NFS or GlusterFS, and manila UID/GID values must be
# in sync between multiple servers.
#
# WARNING: Changing these values on an existing deployment can lead to
#          failures, errors, and instability.
#
# manila_system_user_uid = <UID>
# manila_system_group_gid = <GID>

manila_lock_path: /var/lock/manila

## Manila Auth
manila_service_admin_tenant_name: "service"
manila_service_admin_username: "manila"

## Manila API's enabled
manila_enable_v2_api: true

## Manila API check cert validation
manila_service_internaluri_insecure: false

## Manila api service type and data
manila_service_name: manila
manila_service_project_domain_id: default
manila_service_user_domain_id: default
manila_service_user_name: manila
manila_service_project_name: service
manila_service_role_name: admin
manila_service_region: RegionOne
manila_service_description: "Openstack Shared File Systems"
manila_service_port: 8786
manila_service_proto: http
manila_service_publicuri_proto: "{{ openstack_service_publicuri_proto | default(manila_service_proto) }}"
manila_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(manila_service_proto) }}"
manila_service_internaluri_proto: "{{ openstack_service_internaluri_proto | default(manila_service_proto) }}"
manila_service_type: share
manila_service_publicuri: "{{ manila_service_publicuri_proto }}://{{ external_lb_vip_address }}:{{ manila_service_port }}"
manila_service_publicurl: "{{ manila_service_publicuri }}/v1/%(tenant_id)s"
manila_service_adminuri: "{{ manila_service_adminuri_proto }}://{{ internal_lb_vip_address }}:{{ manila_service_port }}"
manila_service_adminurl: "{{ manila_service_adminuri }}/v1/%(tenant_id)s"
manila_service_internaluri: "{{ manila_service_internaluri_proto }}://{{ internal_lb_vip_address }}:{{ manila_service_port }}"
manila_service_internalurl: "{{ manila_service_internaluri }}/v1/%(tenant_id)s"

manila_service_v2_name: manilav2
manila_service_v2_port: 8786
manila_service_v2_proto: http
manila_service_v2_type: sharev2
manila_service_v2_description: "Openstack Shared File Systems V2"
manila_service_v2_publicuri: "{{ manila_service_publicuri_proto }}://{{ external_lb_vip_address }}:{{ manila_service_port }}"
manila_service_v2_publicurl: "{{ manila_service_publicuri }}/v2/%(tenant_id)s"
manila_service_v2_adminuri: "{{ manila_service_adminuri_proto }}://{{ internal_lb_vip_address }}:{{ manila_service_port }}"
manila_service_v2_adminurl: "{{ manila_service_adminuri }}/v2/%(tenant_id)s"
manila_service_v2_internaluri: "{{ manila_service_internaluri_proto }}://{{ internal_lb_vip_address }}:{{ manila_service_port }}"
manila_service_v2_internalurl: "{{ manila_service_internaluri }}/v2/%(tenant_id)s"

## Keystone authentication middleware
manila_keystone_auth_plugin: "{{ manila_keystone_auth_type }}"
manila_keystone_auth_type: password

## In order to enable the manila data you MUST set ``manila_service_data_program_enabled`` to "true"
manila_service_data_program_enabled: false

## Cap the maximun number of threads / workers when a user value is unspecified.
manila_osapi_share_workers_max: 16
manila_osapi_share_workers: "{{ [[(ansible_processor_vcpus//ansible_processor_threads_per_core)|default(1), 1] | max * 2, manila_osapi_share_workers_max] | min }}"

## Manila RPC
manila_rpc_executor_thread_pool_size: 64
manila_rpc_response_timeout: 60

# osprofiler
manila_profiler_enabled: false
# manila_profiler_hmac_key is set in user_secrets.yml
manila_profiler_trace_sqlalchemy: false

## Manila quota
manila_quota_shares: 50
manila_quota_snapshots: 50
manila_quota_gigabytes: 1000
manila_quota_snapshot_gigabytes: 1000
manila_quota_share_networks: 10

## General configuration
# manila_backends:
#   lvm:
#     share_backend_name: LVM
#     share_driver: manila.share.drivers.lvm.LVMShareDriver
#     driver_handles_share_servers: False
#     lvm_share_volume_group: manila_shares
#     lvm_share_export_ips: <server-ip>

# manila_backend_lvm_inuse: True if current host has an lvm backend
manila_backend_lvm_inuse: "{{ (manila_backends | default('') | to_json).find('lvm') != -1 }}"
# manila_backend_rbd_inuse: True if the current host has an rbd backend
manila_backend_rbd_inuse: "{{ (manila_backends | default('')|to_json).find('manila.share.drivers.cephfs') != -1 }}"

## Policy vars
# Provide a list of access controls to update the default policy.json with. These changes will be merged
# with the access controls in the default policy.json. E.g.
#manila_policy_overrides:
#  "share:create": ""
#  "share:delete": ""

manila_service_in_ldap: false

# Common pip packages
manila_pip_packages:
  - manila
  - python-manilaclient
  - cryptography
  - ecdsa
  - httplib2
  - keystonemiddleware
  - osprofiler
  - PyMySQL
  - pymemcache
  - python-openstackclient
  - python-memcached
  - systemd-python

# Memcached override
manila_memcached_servers: "{{ memcached_servers }}"

manila_user_pip_packages: []

manila_optional_oslomsg_amqp1_pip_packages:
  - oslo.messaging[amqp1]

manila_api_init_overrides: {}
manila_scheduler_init_overrides: {}
manila_share_init_overrides: {}
manila_data_init_overrides: {}

## Service Name-Group Mapping
manila_services:
  manila-scheduler:
    group: manila_scheduler
    service_name: manila-scheduler
    init_config_overrides: "{{ manila_scheduler_init_overrides }}"
    start_order: 1
    execstarts: "{{ manila_bin }}/manila-scheduler"
    execreloads: "/bin/kill -HUP $MAINPID"
  manila-share:
    group: manila_share
    service_name: manila-share
    init_config_overrides: "{{ manila_share_init_overrides }}"
    start_order: 2
    execstarts: "{{ manila_bin }}/manila-share"
    execreloads: "/bin/kill -HUP $MAINPID"
  manila-data:
    group: manila_share
    service_name: manila-data
    init_config_overrides: "{{ manila_data_init_overrides }}"
    start_order: 3
    execstarts: "{{ manila_bin }}/manila-data"
    execreloads: "/bin/kill -HUP $MAINPID"
  manila-api:
    group: manila_api
    service_name: manila-api
    init_config_overrides: "{{ manila_api_init_overrides }}"
    start_order: 4
    wsgi_app: True
    wsgi_name: manila-wsgi
    uwsgi_overrides: "{{ manila_api_uwsgi_ini_overrides }}"
    uwsgi_port: "{{ manila_service_port }}"
    uwsgi_bind_address: "{{ manila_uwsgi_bind_address }}"

    #condition: "{{ manila_service_data_program_enabled | bool }}"
# Manila uWSGI settings
manila_wsgi_processes_max: 16
manila_wsgi_processes: "{{ [[ansible_processor_vcpus|default(1), 1] | max * 2, manila_wsgi_processes_max] | min }}"
manila_wsgi_threads: 1
manila_wsgi_buffer_size: 65535

manila_default_share_type: nfs
manila_share_name_template: share-%s

## Tunable overrides
manila_policy_overrides: {}
manila_rootwrap_conf_overrides: {}
manila_api_paste_ini_overrides: {}
manila_manila_conf_overrides: {}
manila_api_uwsgi_ini_overrides: {}

## Set default manila path in service units. The default override sets the
## execution path for the manila service.
manila_environment_overrides:
  Service:
    Environment: "PATH={{ manila_bin }}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Manila keypair
#
# The following path ontains the keypair which will be used for SSH.  It requires that
# the same file with a trailing .pub exists as well if using an existing key.  If this
# is set and a key cannot be found it will generate one.
#
# manila_keypair_path: /etc/openstack_deploy/id_rsa

Dependencies

This role needs pip >= 7.1 installed on the target host.

Example playbook

---
- name: Install Manila Share service
  hosts: localhost
  user: root
  roles:
    - role: "os_manila"

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: manila-install and manila-config

The manila-install tag can be used to install and upgrade.

The manila-config tag can be used to maintain configuration of the service.