Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grafana Import dashboard ansible #297

Open
daradevik opened this issue Feb 10, 2023 · 2 comments
Open

Grafana Import dashboard ansible #297

daradevik opened this issue Feb 10, 2023 · 2 comments

Comments

@daradevik
Copy link

SUMMARY

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

ISSUE TYPE
  • Bug Report
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
Copy link

Is there an update about this issue?

@Nemental
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants