yaml
Technical notes on web development, DevOps, and AI integration.
3 articles
- 00:13backend
When a Comma Cuts the Description: YAML Under the Linter
Eight of ten OpenAPI lint errors were not contract drift: an unquoted comma in a flow-mapping description became a bogus null-keyed entry.
TL;DR: Ten OpenAPI lint errors weren't contract drift but YAML parsing: unquoted commas inside flow mappings silently truncate description values. Linting grades the parsed debris, not the source, so Redocly flagged symptoms far below the real cause. Quoting descriptions fixed it; openapi-typescript regeneration produced byte-identical output, proving the fix was pure hygiene.
#openapi#yaml#api - 21:24devops
The Debug Task That Only Fails When Nothing Changes
An Ansible dry run died on a harmless debug task. The skipped command tasks never filled their registered vars, and the trailing default filter never got a cha…
TL;DR: Running an Ansible playbook with --check can crash on a debug task even when the real tasks skip cleanly, because skipped tasks never register their variables. Filter chains run left to right, so last hits the undefined value before a trailing default can help. The fix is wrapping the value in default before later filters run.
#ansible#automation#devops - 00:44devops
Two Silent Killers in One Ansible Deploy
An Ansible playbook died over an apostrophe inside a block scalar, then hosts went unreachable over ssh key offer order. Two lessons from one exit code 4.
TL;DR: A comment with an apostrophe inside a shell block scalar killed the whole playbook, since YAML ignores # in block scalars and Ansible's argument splitter chokes on unbalanced quotes. Exit code 4 is ambiguous anyway. Then MaxAuthTries exhausted wrong-key attempts; IdentitiesOnly=yes with ordered IdentityFile entries fixed it.
#ansible#ssh#yaml