---
# file: roles/elastalert/tasks/main.yml

- name: ElastAlert Role
  set_fact:
    role_elastalert_started: yes
  tags:
    - always

- block:

  - import_tasks: install.yml

  - import_tasks: rules.yml

  - include_tasks: rules.drupal.yml
    with_nested:
      - {{groups["webserver_drupal"]}}
      - ['rule.drupal.syslog', 'rule.drupal.apache']
    loop_control:
      loop_var: drupal_host

  #when: not excluded_roles or "elastalert" not in excluded_roles
  when: false
