---
- name: Check import grafana dashboard from id
  grafana_dashboard:
    grafana_url: "{{ grafana_url }}"
    grafana_user: "{{ grafana_username }}"
    grafana_password: "{{ grafana_password }}"
    state: present
    commit_message: Updated by ansible
    dashboard_id: "6098"
    dashboard_revision: "1"
    overwrite: true
  register: result

- debug:
    var: result

- assert:
    that:
      - "result.changed == true"
      - "result.msg == 'Dashboard Zabbix Host Status created'"

- name: Check import grafana dashboard from id idempotency
  grafana_dashboard:
    grafana_url: "{{ grafana_url }}"
    grafana_user: "{{ grafana_username }}"
    grafana_password: "{{ grafana_password }}"
    state: present
    commit_message: Updated by ansible
    dashboard_id: "6098"
    dashboard_revision: "1"
    overwrite: true
  register: result

- debug:
    var: result

- assert:
    that:
      - "result.changed == false"
      - "result.msg == 'Dashboard Zabbix Host Status unchanged.'"
