Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

adding datasource fails #72

Closed
alfozan opened this issue Jul 11, 2018 · 4 comments
Closed

adding datasource fails #72

alfozan opened this issue Jul 11, 2018 · 4 comments

Comments

@alfozan
Copy link

alfozan commented Jul 11, 2018

Task:

  - name: add prometheus datasource
    grafana_datasource:
      name: prometheus
      grafana_url: "http://localhost:3000"
      url: "http://prometheus:9090"
      ds_type: prometheus
      basic_auth_user: admin
      basic_auth_password: admin

Error:

TASK [add prometheus datasource] **************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: a bytes-like object is required, not 'str'
fatal: [node01]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_0qkfiabg/ansible_module_grafana_datasource.py\", line 540, in <module>\n    main()\n  File \"/tmp/ansible_0qkfiabg/ansible_module_grafana_datasource.py\", line 523, in main\n    result = grafana_create_datasource(module, module.params)\n  File \"/tmp/ansible_0qkfiabg/ansible_module_grafana_datasource.py\", line 376, in grafana_create_datasource\n    auth = base64.b64encode(to_bytes('%s:%s' % (data['grafana_user'], data['grafana_password'])).replace('\\n', ''))\nTypeError: a bytes-like object is required, not 'str'\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}
$ ansible --version
ansible 2.6.1
  python version = 3.6.5 (default, Jun 17 2018, 12:13:06) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)]
@paulfantom
Copy link
Member

Where this task come from? We don't have it in current role version and we also don't use grafana_datasource module.

@alfozan
Copy link
Author

alfozan commented Jul 17, 2018

@paulfantom
Copy link
Member

  1. You are referencing a problem with a module which isn't used by this role.
  2. You are not using any variable from our role in this task.

Closing since this is NOT related to ansible-grafana but more likely to ansible itself.

@lock
Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants