---

- name: Install grafana
  yum:
    name: "{{ grafana_url }}/{{ grafana_tarball }}.rpm"
    state: latest

#- name: Download grafana archive
#  get_url:
#    url:  "{{ grafana_url }}/{{ grafana_tarball }}.tar.gz"
#    dest: /tmp/{{ grafana_tarball }}.tar.gz
#    #checksum: "sha256:{{ grafana_url }}/{{ grafana_tarball }}.tar.gz.sha256"
#  register: _download_archive
#  until: _download_archive is succeeded
#  retries: 5
#  delay: 2
#  when: not grafana_skip_install
#
#- name: unpack grafana binaries
#  unarchive:
#    src: "/tmp/{{ grafana_tarball }}.tar.gz"
#    dest: "/tmp"
#    creates: "/tmp/grafana-{{ grafana_version }}/bin/grafana-cli"
#    remote_src: true
#  when: not grafana_skip_install
#
#- name: Copy grafana files to bin
#  copy:
#    src: "/tmp/grafana-{{ grafana_version }}/"
#    dest: "/etc/grafana"
#    owner: root
#    group: root
#    remote_src: yes
#    mode: 0750
#  when: not grafana_skip_install
