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

- name: "ElastAlert Role"
  set_fact: role_elastalert_started=true
  tags: 'always'

- block:

  - include: install.yml

  - include: rules.yml

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

  when: '"elastalert" not in excluded_roles'
