---
project_name: "cinder"

cinder_services:
  cinder-api:
    container_name: cinder_api
    group: cinder-api
    enabled: true
    image: "{{ cinder_api_image_full }}"
    volumes:
      - "{{ node_config_directory }}/cinder-api/:{{ container_config_directory }}/:ro"
      - "/etc/localtime:/etc/localtime:ro"
      - "kolla_logs:/var/log/kolla/"
      - "{{ kolla_dev_repos_directory ~ '/cinder/cinder:/var/lib/kolla/venv/lib/python2.7/site-packages/cinder' if cinder_dev_mode | bool else '' }}"
    dimensions: "{{ cinder_api_dimensions }}"
  cinder-scheduler:
    container_name: cinder_scheduler
    group: cinder-scheduler
    enabled: true
    image: "{{ cinder_scheduler_image_full }}"
    volumes:
      - "{{ node_config_directory }}/cinder-scheduler/:{{ container_config_directory }}/:ro"
      - "/etc/localtime:/etc/localtime:ro"
      - "kolla_logs:/var/log/kolla/"
      - "{{ kolla_dev_repos_directory ~ '/cinder/cinder:/var/lib/kolla/venv/lib/python2.7/site-packages/cinder' if cinder_dev_mode | bool else '' }}"
    dimensions: "{{ cinder_scheduler_dimensions }}"
  cinder-volume:
    container_name: cinder_volume
    group: cinder-volume
    enabled: true
    image: "{{ cinder_volume_image_full }}"
    privileged: True
    ipc_mode: "host"
    volumes:
      - "{{ node_config_directory }}/cinder-volume/:{{ container_config_directory }}/:ro"
      - "/etc/localtime:/etc/localtime:ro"
      - "/dev/:/dev/"
      - "/lib/modules:/lib/modules:ro"
      - "/run/:/run/:shared"
      - "cinder:/var/lib/cinder"
      - "{% if enable_iscsid | bool %}iscsi_info:/etc/iscsi{% endif %}"
      - "kolla_logs:/var/log/kolla/"
      - "{{ kolla_dev_repos_directory ~ '/cinder/cinder:/var/lib/kolla/venv/lib/python2.7/site-packages/cinder' if cinder_dev_mode | bool else '' }}"
    dimensions: "{{ cinder_volume_dimensions }}"
  cinder-backup:
    container_name: cinder_backup
    group: cinder-backup
    enabled: "{{ enable_cinder_backup | bool }}"
    image: "{{ cinder_backup_image_full }}"
    privileged: True
    volumes:
      - "{{ node_config_directory }}/cinder-backup/:{{ container_config_directory }}/:ro"
      - "/etc/localtime:/etc/localtime:ro"
      - "/dev/:/dev/"
      - "/run/:/run/:shared"
      - "cinder:/var/lib/cinder"
      - "{% if enable_iscsid | bool %}iscsi_info:/etc/iscsi{% endif %}"
      - "kolla_logs:/var/log/kolla/"
      - "{{ kolla_dev_repos_directory ~ '/cinder/cinder:/var/lib/kolla/venv/lib/python2.7/site-packages/cinder' if cinder_dev_mode | bool else '' }}"
    dimensions: "{{ cinder_backup_dimensions }}"

####################
# Ceph
####################
ceph_cinder_pool_type: "{{ ceph_pool_type }}"
ceph_cinder_cache_mode: "{{ ceph_cache_mode }}"
ceph_cinder_backup_pool_type: "{{ ceph_pool_type }}"
ceph_cinder_backup_cache_mode: "{{ ceph_cache_mode }}"

# Due to Ansible issues on include, you cannot override these variables. Please
# override the variables they reference instead.
cinder_pool_name: "{{ ceph_cinder_pool_name }}"
cinder_pool_type: "{{ ceph_cinder_pool_type }}"
cinder_cache_mode: "{{ ceph_cinder_cache_mode }}"
cinder_pool_pg_num: "{{ ceph_pool_pg_num }}"
cinder_pool_pgp_num: "{{ ceph_pool_pgp_num }}"

cinder_backup_pool_name: "{{ ceph_cinder_backup_pool_name }}"
cinder_backup_pool_type: "{{ ceph_cinder_backup_pool_type }}"
cinder_backup_cache_mode: "{{ ceph_cinder_backup_cache_mode }}"
cinder_backup_pool_pg_num: "{{ ceph_pool_pg_num }}"
cinder_backup_pool_pgp_num: "{{ ceph_pool_pgp_num }}"

ceph_client_cinder_keyring_caps:
  mon: 'allow r'
  osd: >-
    allow class-read object_prefix rbd_children,
    allow rwx pool={{ ceph_cinder_pool_name }},
    allow rwx pool={{ ceph_cinder_pool_name }}-cache,
    allow rwx pool={{ ceph_nova_pool_name }},
    allow rwx pool={{ ceph_nova_pool_name }}-cache,
    allow rx pool={{ ceph_glance_pool_name }},
    allow rx pool={{ ceph_glance_pool_name }}-cache

ceph_client_cinder_backup_keyring_caps:
  mon: 'allow r'
  osd: >-
    allow class-read object_prefix rbd_children,
    allow rwx pool={{ ceph_cinder_backup_pool_name }},
    allow rwx pool={{ ceph_cinder_backup_pool_name }}-cache


####################
# Database
####################
cinder_database_name: "cinder"
cinder_database_user: "{% if use_preconfigured_databases | bool and use_common_mariadb_user | bool %}{{ database_user }}{% else %}cinder{% endif %}"
cinder_database_address: "{{ database_address }}:{{ database_port }}"

# Max number of object to consider
# when run online data migration
# cinder_max_number_osm: ""

####################
# Docker
####################
cinder_install_type: "{{ kolla_install_type }}"
cinder_tag: "{{ openstack_release }}"

cinder_volume_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ cinder_install_type }}-cinder-volume"
cinder_volume_tag: "{{ cinder_tag }}"
cinder_volume_image_full: "{{ cinder_volume_image }}:{{ cinder_volume_tag }}"

cinder_scheduler_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ cinder_install_type }}-cinder-scheduler"
cinder_scheduler_tag: "{{ cinder_tag }}"
cinder_scheduler_image_full: "{{ cinder_scheduler_image }}:{{ cinder_scheduler_tag }}"

cinder_backup_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ cinder_install_type }}-cinder-backup"
cinder_backup_tag: "{{ cinder_tag }}"
cinder_backup_image_full: "{{ cinder_backup_image }}:{{ cinder_backup_tag }}"

cinder_api_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ cinder_install_type }}-cinder-api"
cinder_api_tag: "{{ cinder_tag }}"
cinder_api_image_full: "{{ cinder_api_image }}:{{ cinder_api_tag }}"

cinder_api_dimensions: "{{ default_container_dimensions }}"
cinder_backup_dimensions: "{{ default_container_dimensions }}"
cinder_scheduler_dimensions: "{{ default_container_dimensions }}"
cinder_volume_dimensions: "{{ default_container_dimensions }}"

####################
# OpenStack
####################
cinder_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ cinder_api_port }}/v1/%(tenant_id)s"
cinder_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ cinder_api_port }}/v1/%(tenant_id)s"
cinder_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ cinder_api_port }}/v1/%(tenant_id)s"
cinder_v2_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ cinder_api_port }}/v2/%(tenant_id)s"
cinder_v2_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ cinder_api_port }}/v2/%(tenant_id)s"
cinder_v2_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ cinder_api_port }}/v2/%(tenant_id)s"
cinder_v3_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ cinder_api_port }}/v3/%(tenant_id)s"
cinder_v3_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ cinder_api_port }}/v3/%(tenant_id)s"
cinder_v3_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ cinder_api_port }}/v3/%(tenant_id)s"

cinder_logging_debug: "{{ openstack_logging_debug }}"

cinder_keystone_user: "cinder"

openstack_cinder_auth: "{{ openstack_auth }}"


####################
# Cinder
####################
cinder_backends:
  - name: "rbd-1"
    enabled: "{{ enable_ceph | bool and cinder_backend_ceph | bool }}"
  - name: "lvm-1"
    enabled: "{{ enable_cinder_backend_lvm | bool }}"
  - name: "nfs-1"
    enabled: "{{ enable_cinder_backend_nfs | bool }}"
  - name: "hnas-iscsi"
    enabled: "{{ enable_cinder_backend_hnas_iscsi | bool }}"
  - name: "hnas-nfs"
    enabled: "{{ enable_cinder_backend_hnas_nfs | bool }}"
  - name: "vmwarevc-vmdk"
    enabled: "{{ cinder_backend_vmwarevc_vmdk | bool }}"
  - name: "zfssa-iscsi"
    enabled: "{{ enable_cinder_backend_zfssa_iscsi | bool }}"

cinder_enabled_backends: "{{ cinder_backends|selectattr('enabled', 'equalto', true)|list }}"
cinder_iscsi_helper: "tgtadm"

#############################################
# Hitachi NAS Platform iSCSI and NFS drivers
#############################################
# iscsi
hnas_iscsi_backend: "hnas_iscsi_backend"
hnas_iscsi_username:
hnas_iscsi_mgmt_ip0:
hnas_iscsi_svc0_volume_type:
hnas_iscsi_svc0_hdp:
hnas_iscsi_svc0_ip:

# nfs
hnas_nfs_backend: "hnas_nfs_backend"
hnas_nfs_username:
hnas_nfs_mgmt_ip0:
hnas_nfs_svc0_volume_type:
hnas_nfs_svc0_hdp:

#############################################
# Oracle ZFS Storage Appliance iSCSI driver
#############################################
zfssa_iscsi_backend: "zfssa_iscsi_backend"
zfssa_iscsi_san_ip:
zfssa_iscsi_login:
zfssa_iscsi_pool:
zfssa_iscsi_project:
zfssa_iscsi_initiator_group:
zfssa_iscsi_target_portal:
zfssa_iscsi_target_interfaces:


####################
# Kolla
####################
cinder_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}"
cinder_dev_repos_pull: "{{ kolla_dev_repos_pull }}"
cinder_dev_mode: "{{ kolla_dev_mode }}"
