grafana-ansible-collection
grafana-ansible-collection copied to clipboard
Declare `grafana.grafana` collection dependencies on `galaxy.yml`
Hello!
I have encountered the following issue while running the role grafana.grafana.grafana.
TASK [grafana.grafana.grafana : Datasources] ************************************************************************************************************************************
ERROR! couldn't resolve module/action 'community.grafana.grafana_datasource'. This often indicates a misspelling, missing collection, or incorrect module path.
The error appears to be in '/home/.../collections/ansible_collections/grafana/grafana/roles/grafana/tasks/datasources.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- name: "Ensure datasources exist (via API)"
^ here
The reason is clear: the collection community.grafana is missing. As far as I understand from the presence of a requirements.yml file in the repository, the collections community.general, community.grafana and ansible.posix are dependencies of the collection grafana.grafana. Installing community.grafana fixes the issue.
However, would it not make sense to use the dependencies key of the galaxy.yml file, as the Ansible documentation explains?
@gardar Why do we have that dependency? Last I checked it was just for CI?
Just had this issue using latest grafana.grafana
TASK [grafana.grafana.grafana : Datasources] ***************************************************************************************** ERROR! couldn't resolve module/action 'community.grafana.grafana_datasource'. This often indicates a misspelling, missing collection, or incorrect module path.
My inventory var: `grafana_datasources:
- name: '{{ inventory_hostname }}' type: prometheus access: proxy url: 'http://{{ inventory_hostname }}:9090'`
My .2c: grafana.grafana should be >=4.0.0.