---

- hosts: telegraf
  tasks:
    - name: "Installing packages on CentOS"
      yum:
        name: which
        state: present
      when:
        - ansible_os_family == 'RedHat'

    - name: "Installing packages on Debian"
      apt:
        name:
          - wget
          # - gpg
        state: present
      when:
        - ansible_os_family == 'Debian'

    - name: "Installing packages on Suse"
      zypper:
        name:
          - sysvinit-tools
          - insserv-compat
          - aaa_base
        state: present
      when:
        - ansible_os_family == 'Suse'
