-
Notifications
You must be signed in to change notification settings - Fork 140
Closed
Description
Ansible team recently made a change which is much more strict on conditionals and loops.
With Ansible 2.19, these two steps will fail if the custom dashboards directory only contains JSON files and no sub-directories.
The first task with ansible.builtin.find sets the __dashboards_subdirs to a string value of "All paths examined" instead of the expected list.
The second task then fails with the following,
TASK [grafana.grafana.grafana : Create dashboard folders] ******************************************************************************************************************************************************************************************************************************
task path: ansible/.collections/ansible_collections/grafana/grafana/roles/grafana/tasks/dashboards.yml:187
[ERROR]: The `loop` value must resolve to a 'list', not 'str'.
Origin: ansible/.collections/ansible_collections/grafana/grafana/roles/grafana/tasks/dashboards.yml:195:17
193 group: "grafana"
194 mode: "0755"
195 loop: "{{ __dashboards_subdirs.files | map(attribute='path') | sort | regex_replace(grafana_dashboards_...
^ column 17
Provide a list of items/templates, or a template resolving to a list.
fatal: [grafana-0]: FAILED! => {
"msg": "The `loop` value must resolve to a 'list', not 'str'."
}
Metadata
Metadata
Assignees
Labels
No labels