Krikri::YamlSyntaxError
Represents an entire playbook
A YAML syntax error in a playbook, carrying enough structure to be
rendered the way real ansible-playbook renders one (see #render).
Previously this was a bare raise "Invalid YAML in ...", which lost
the position and printed nothing like real Ansible's output.
Constants
libyaml's own wording for the single most common playbook YAML mistake (an unquoted value containing ": "), mapped to real Ansible's phrasing and its worked-example hint. Any other error keeps our YAML library's own message - real Ansible's prose for those comes from ITS parser and cannot be reproduced verbatim.
Constructors
Class methods
Crystal's YAML::ParseException message inlines the position and puts libyaml's CONTEXT last:
"did not find expected ',' or ']' at line 3, column 1, while parsing a flow sequence"
real Ansible renders libyaml's two halves the other way round, capitalized and full-stopped:
"While parsing a flow sequence did not find expected ',' or ']'."
(verified against ansible-core 2.19.4). Reorder to match.
Instance methods
Real ansible-playbook's own layout, verified against ansible-core 2.19.4:
[ERROR]: YAML parsing failed: <message>
Origin: /abs/path.yml:1:9
1 this: is: bad: [
^ column 9