| {%- if pillar.cinder.controller is defined %} |
| {%- from "cinder/map.jinja" import controller with context %} |
| {%- if controller.get('enabled', False) %} |
| {%- if controller.get('osapi') %} |
| local_plugin: |
| collectd_check_local_endpoint: |
| endpoint: |
| cinder-api: |
| expected_code: {% if controller.version in ('juno', 'kilo', 'liberty') %}200{% else %}300{% endif %} |
| url: "http://{{ controller.osapi.host|replace('0.0.0.0', '127.0.0.1') }}:8776/" |
| {%- endif %} |
| {%- if controller.get('identity') %} |
| remote_plugin: |
| openstack_cinder: |
| plugin: python |
| template: cinder/files/collectd_openstack_cinder.conf |
| url: "http://{{ controller.identity.host }}:{{ controller.identity.port }}/v{% if controller.identity.get('api_version', 2)|int == 2 %}2.0{% else %}3{% endif %}" |
| username: {{ controller.identity.user }} |
| password: {{ controller.identity.password }} |
| tenant: {{ controller.identity.tenant }} |
| region: {{ controller.identity.region }} |
| openstack_cinder_services: |
| plugin: python |
| template: cinder/files/collectd_openstack_cinder_services.conf |
| url: "http://{{ controller.identity.host }}:{{ controller.identity.port }}/v{% if controller.identity.get('api_version', 2)|int == 2 %}2.0{% else %}3{% endif %}" |
| username: {{ controller.identity.user }} |
| password: {{ controller.identity.password }} |
| tenant: {{ controller.identity.tenant }} |
| region: {{ controller.identity.region }} |
| {%- endif %} |
| {%- endif %} |
| {%- endif %} |