# tasks file for supervisor
---
- include: install.yml
  tags:
    - configuration
    - supervisor
    - supervisor-install

- include: configure.yml
  tags:
    - configuration
    - supervisor
    - supervisor-configure

- include: service-initd.yml
  when: (ansible_os_family == 'Ubuntu' and (ansible_distribution_version | version_compare('15.04', '<')))
  tags:
    - configuration
    - supervisor
    - supervisor-configure
    - supervisor-configure-initd

- include: service-systemd.yml
  when: (ansible_os_family == 'Debian') or
        (ansible_os_family == 'Ubuntu' and (ansible_distribution_version | version_compare('15.04', '>=')))
  tags:
    - configuration
    - supervisor
    - supervisor-configure
    - supervisor-configure-systemd

- include: programs.yml
  tags:
    - configuration
    - supervisor
    - supervisor-programs

- include: groups.yml
  tags:
    - configuration
    - supervisor
    - supervisor-groups

- name: start and enable service
  service:
    name: supervisor
    state: "{{ supervisor_state }}"
    enabled: true
  tags:
    - configuration
    - supervisor
    - supervisor-start-enable-service

# tasks file for supervisor
---
- include: install.yml
  tags:
    - configuration
    - supervisor
    - supervisor-install

- include: configure.yml
  tags:
    - configuration
    - supervisor
    - supervisor-configure

- include: service-initd.yml
  when: (ansible_distribution == 'Ubuntu' and (ansible_distribution_version | version_compare('15.04', '<')))
  tags:
    - configuration
    - supervisor
    - supervisor-configure
    - supervisor-configure-initd

- include: service-systemd.yml
  when: (ansible_distribution == 'Debian') or
        (ansible_distribution == 'Ubuntu' and (ansible_distribution_version | version_compare('15.04', '>=')))
  tags:
    - configuration
    - supervisor
    - supervisor-configure
    - supervisor-configure-systemd

- include: programs.yml
  tags:
    - configuration
    - supervisor
    - supervisor-programs

- include: groups.yml
  tags:
    - configuration
    - supervisor
    - supervisor-groups

- name: start and enable service
  service:
    name: supervisor
    state: "{{ supervisor_state }}"
    enabled: true
  tags:
    - configuration
    - supervisor
    - supervisor-start-enable-service

Use the correct var when checking which distro we are running
Use the correct var when checking which distro we are running
