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

upstream ansible bug (to_nice_yaml): causes task "alerting rules file" to fail #297

Closed
appliedprivacy opened this issue Jun 16, 2020 · 2 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@appliedprivacy
Copy link

appliedprivacy commented Jun 16, 2020

The following templates use the affected "to_nice_yaml" filter:

therefore this role fails with the following errors (or similar)

FAILED! => {"changed": false, "msg": "AnsibleError: Unexpected templating type error occurred on ({{ ansible_managed | comment }}\n\ngroups:\n- name: ansible managed alert rules\n  rules:\n  {{ prometheus_alert_rules | to_nice_yaml(indent=2) | indent(2,False) }}\n): value must be a string"}

cloudalchemy/ansible-node-exporter#158
upstream bug: ansible/ansible#66916

Target system:
Debian 10

ansible 2.9.9
  config file = /home/user/.ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.7.7 (default, Mar 13 2020, 10:23:39) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)]
@appliedprivacy appliedprivacy added the bug Something isn't working label Jun 16, 2020
@paulfantom
Copy link
Member

I don't see this as a bug in ansible role (role is using concepts described in ansible docs, and if a filter from those docs doesn't work, it is ansible problem, not role one). That said, let's track this in one place at cloudalchemy/ansible-node-exporter#158

@paulfantom paulfantom added the wontfix This will not be worked on label Jun 17, 2020
@appliedprivacy
Copy link
Author

appliedprivacy commented Jun 17, 2020

I see your point, but I would still have found this issue useful because it tells me about a known issue.
Even if the root-cause is outside the role, it makes the role unusable without workarounds
and this issue could be a place for users to share their workarounds.
It does not look like we will be getting an upstream fix for this soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants