We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to output a complex (dict) variable triggers a Error: bad label format
Error: bad label format
<table border="0" cellborder="0"> <tr><td><b> <font face="Times New Roman, Bold" point-size="16">foo</font> </b></td></tr> <hr/><tr><td><font face="Times New Roman, Bold" point-size="14">ansible_python_interpreter<br/>ansible_user<br/>os_servers = {'foo': {'bar': 'DE'}}<br/></font></td></tr></table>
The text was updated successfully, but these errors were encountered:
I suggest the addition of the following filter:
import re from ansible.parsing.yaml.objects import AnsibleSequence def to_string(value, indent = 1): o = '' if isinstance(value, AnsibleSequence) or isinstance(value, list): return "- " + "<br/>- ".join(value) + "<br/>" if not isinstance(value, dict): return value for k, v in value.items(): o += " " * indent + f"{k}: {to_string(v, indent + 2)}<br/>" return re.sub(r'["{}\(\)|]*', '', o) # env.filters['to_string'] = to_string
Sorry, something went wrong.
No branches or pull requests
Trying to output a complex (dict) variable triggers a
Error: bad label format
The text was updated successfully, but these errors were encountered: