ansible-collections / community.grafana

Grafana Collection for Ansible
http://galaxy.ansible.com/community/grafana
GNU General Public License v3.0
131 stars 83 forks source link

Grafana Import dashboard ansible #297

Open daradevik opened 1 year ago

daradevik commented 1 year ago
SUMMARY

I am trying to import custom grafana dashbord json but it is giving module error.

ISSUE TYPE
COMPONENT NAME

Grafana import Dashboard

ANSIBLE VERSION
- name: install infra
  grafana_dashboard:
       grafana_url: "http://*.*.*.*:3000"
       grafana_user: "{{ grafana_admin_user }}"
       grafana_password: "{{ grafana_admin_password }}"
       state: present
       overwrite: yes
       path: /var/lib/grafana/inframetric.json
       message: Updated by ansible
COLLECTION VERSION
CONFIGURATION
nothing
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1676024285.6073017-24275514228316/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-tmp-1676024285.6073017-24275514228316/AnsiballZ_grafana_dashboard.py", line 102, in <module>
    _ansiballz_main()
  File "/root/.ansible/tmp/ansible-tmp-1676024285.6073017-24275514228316/AnsiballZ_grafana_dashboard.py", line 94, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/root/.ansible/tmp/ansible-tmp-1676024285.6073017-24275514228316/AnsiballZ_grafana_dashboard.py", line 40, in invoke_module
    runpy.run_module(mod_name='ansible.modules.monitoring.grafana_dashboard', init_globals=None, run_name='__main__', alter_sys=True)
  File "/usr/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_grafana_dashboard_payload_leltiun4/ansible_grafana_dashboard_payload.zip/ansible/modules/monitoring/grafana_dashboard.py", line 450, in <module>
  File "/tmp/ansible_grafana_dashboard_payload_leltiun4/ansible_grafana_dashboard_payload.zip/ansible/modules/monitoring/grafana_dashboard.py", line 403, in main
  File "/tmp/ansible_grafana_dashboard_payload_leltiun4/ansible_grafana_dashboard_payload.zip/ansible/module_utils/basic.py", line 694, in __init__
  File "/tmp/ansible_grafana_dashboard_payload_leltiun4/ansible_grafana_dashboard_payload.zip/ansible/module_utils/basic.py", line 1965, in _log_invocation
  File "/tmp/ansible_grafana_dashboard_payload_leltiun4/ansible_grafana_dashboard_payload.zip/ansible/module_utils/basic.py", line 1922, in log
TypeError: send() got multiple values for keyword argument 'MESSAGE'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1676024285.6073017-24275514228316/AnsiballZ_grafana_dashboard.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1676024285.6073017-24275514228316/AnsiballZ_grafana_dashboard.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1676024285.6073017-24275514228316/AnsiballZ_grafana_dashboard.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.monitoring.grafana_dashboard', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_grafana_dashboard_payload_leltiun4/ansible_grafana_dashboard_payload.zip/ansible/modules/monitoring/grafana_dashboard.py\", line 450, in <module>\n  File \"/tmp/ansible_grafana_dashboard_payload_leltiun4/ansible_grafana_dashboard_payload.zip/ansible/modules/monitoring/grafana_dashboard.py\", line 403, in main\n  File \"/tmp/ansible_grafana_dashboard_payload_leltiun4/ansible_grafana_dashboard_payload.zip/ansible/module_utils/basic.py\", line 694, in __init__\n  File \"/tmp/ansible_grafana_dashboard_payload_leltiun4/ansible_grafana_dashboard_payload.zip/ansible/module_utils/basic.py\", line 1965, in _log_invocation\n  File \"/tmp/ansible_grafana_dashboard_payload_leltiun4/ansible_grafana_dashboard_payload.zip/ansible/module_utils/basic.py\", line 1922, in log\nTypeError: send() got multiple values for keyword argument 'MESSAGE'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

PLAY RECAP **********************************************************************************************************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0 
Nijntjes commented 10 months ago

Is there an update about this issue?

Nemental commented 10 months ago

Please provide more information (collection version, Ansible version, Grafana version, ...). I can't reproduce this.