---
- name: glance-api process check
  sensu_process_check: service=glance-api
  notify: restart sensu-client

- name: glance-registry process check
  sensu_process_check: service=glance-registry
  notify: restart sensu-client

- name: glance-api check
  sensu_check: name=check-glance-api plugin=check-os-api.rb
               args="--service glance"
  notify: restart sensu-client

- name: install functools32 for glance-store check
  pip:
    name: functools32
    state: present

- name: glance-store check
  sensu_check:
    name: check-glance-store
    plugin: check-glance-store.py
    args: "--imagedir={{ glance.sync.dir }}"
  notify: restart sensu-client

- name: glance metrics
  template: src=etc/collectd/plugins/glance.conf dest=/etc/collectd/plugins/glance.conf
  notify: restart collectd
  when: collectd is defined and collectd.enabled|bool
  tags: collectd

- name: glance sla metrics
  sensu_metrics_check: name=glance-sla-metrics plugin=metrics-os-api.py
                       args='-S glance --scheme {{ monitoring.graphite.host_prefix }}'
  notify: restart sensu-client

---
- name: glance-api process check
  sensu_process_check: service=glance-api
  notify: restart sensu-client

- name: glance-registry process check
  sensu_process_check: service=glance-registry
  notify: restart sensu-client

- name: glance-api check
  sensu_check: name=check-glance-api plugin=check-os-api.rb
               args="--service glance"
  notify: restart sensu-client

- name: install functools32 for glance-store check
  pip:
    name: functools32
    state: present

- name: glance-store check
  sensu_check:
    name: check-glance-store
    plugin: check-glance-store.py
    args: "--imagedir={{ glance.sync.dir }}"
  when: (glance.store_smart|bool and not swift.enabled|bool and not ceph.enabled|bool) or
        (not glance.store_swift|bool and not glance.store_ceph|bool and glance.store_file|bool)
  notify: restart sensu-client

- name: glance metrics
  template: src=etc/collectd/plugins/glance.conf dest=/etc/collectd/plugins/glance.conf
  notify: restart collectd
  when: collectd is defined and collectd.enabled|bool
  tags: collectd

- name: glance sla metrics
  sensu_metrics_check: name=glance-sla-metrics plugin=metrics-os-api.py
                       args='-S glance --scheme {{ monitoring.graphite.host_prefix }}'
  notify: restart sensu-client

Disable glance-store monitor when images stored in ceph or swift
Disable glance-store monitor when images stored in ceph or swift

Fixes issue #1430.
