Dirk's Tech Findings

Ansible: grafana_create_datasource yields TypeError

Publication date: 2020-04-18

Issue: Ansible's grafana_create_datasource yields TypeError

The following error message is shown "TypeError: a bytes-like object is required, not 'str'" on Debian Buster.

Solution: Install a newer Ansible version

This is a known bug that got fixed in Ansible 2.7.10. Solution is thus to install a more recent Ansible version from backports repository instead of the package in the standard repository:

Add backports repository in "/etc/apt/sources.txt":

deb http://http.debian.net/debian buster-backports main contrib

Install the newer package from that repository:

apt update
apt install ansible -t buster-backports

Hint towards the solution

See "https://github.com/ansible/ansible/issues/49147".

Back to topic list...