---
- name: Query dpkg package database for heka
  tags: heka
  register: heka_query_installed_packages
  ignore_errors: true
  failed_when: false
  command: dpkg -l heka

- name: Install heka
  tags: heka
  become: true
  when: '"heka" not in heka_query_installed_packages.stdout'
  command: dpkg -i {{ util_persistent_data_path_remote }}/{{ heka_install_filename }}

- name: Install heka service
  tags: heka
  become: yes
  notify: service restart hekad
  template:
    src=service_upstart.j2
    dest=/etc/init/hekad.conf
    owner=0
    group=0
    mode=0644

---
- name: Query dpkg package database for heka
  tags: heka
  register: heka_query_installed_packages
  always_run: true
  ignore_errors: true
  failed_when: false
  changed_when: false
  command: dpkg -l heka

- name: Install heka
  tags: heka
  become: true
  when: '"heka" not in heka_query_installed_packages.stdout'
  command: dpkg -i {{ util_persistent_data_path_remote }}/{{ heka_install_filename }}

- name: Install heka service
  tags: heka
  become: yes
  notify: service restart hekad
  template:
    src=service_upstart.j2
    dest=/etc/init/hekad.conf
    owner=0
    group=0
    mode=0644

Make heka role checkmode ready
Make heka role checkmode ready

Signed-off-by: Mark Kusch <100d753b1bf12c46cb1704d669587da1096d0b23@silpion.de>
