You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ansible-lint --fix will quote any string value that starts with a "0", whether or not it needs to be. This behaviour was meant for handling the mess that are octals in YAML, and was introduced in #3030 and did a good job of helping that, but it's spilled out and is affecting all strings! 🍦
Issue Type
Bug Report
OS / ENVIRONMENT
% ansible-lint --versionWARNING: PATH altered to include /opt/homebrew/Cellar/ansible-lint/24.2.3_1/libexec/bin, /opt/homebrew/Cellar/ansible-lint/24.2.3_1/libexec/bin :: This is usually a sign of broken local setup, which can cause unexpected behaviors.ansible-lint 24.2.3 using ansible-core:2.16.6 ansible-compat:4.1.11 ruamel-yaml:0.18.6 ruamel-yaml-clib:0.2.8
% ansible-lint --fixWARNING: PATH altered to include /opt/homebrew/Cellar/ansible-lint/24.2.3_1/libexec/bin, /opt/homebrew/Cellar/ansible-lint/24.2.3_1/libexec/bin :: This is usually a sign of broken local setup, which can cause unexpected behaviors.Modified 1 files.Passed: 0 failure(s), 0 warning(s) on 1 files. Last profile that met the validation criteria was 'production'.A new release of ansible-lint is available: 24.2.3 → 24.5.0
If you need a more realistic example, consider managing Ubuntu's /etc/update-motd.d/ files: there's no reason "00-header" needs to be an odd duck, but ansible-lint made it so on my codebase:
I think strings that start with a "0" like "0.0.0.0" and "0steps" should remain unquoted. "1steps" remained unquoted, there's no reason "0steps" needs to be either.
🗃️ 🌵 🍰
The text was updated successfully, but these errors were encountered:
Summary
ansible-lint --fix
will quote any string value that starts with a "0", whether or not it needs to be. This behaviour was meant for handling the mess that are octals in YAML, and was introduced in #3030 and did a good job of helping that, but it's spilled out and is affecting all strings! 🍦Issue Type
OS / ENVIRONMENT
ansible installation method:
brew install ansible
ansible-lint installation method:
brew install ansible-lint && ansible-galaxy collection install --force community.general
(I don't know why I needed to re-install community.general to get ansible-lint working, but that's a different bug, maybe in brew)
STEPS TO REPRODUCE
Run:
ansible-lint --fix
Actual Behavior
Result:
If you need a more realistic example, consider managing Ubuntu's /etc/update-motd.d/ files: there's no reason "00-header" needs to be an odd duck, but ansible-lint made it so on my codebase:
Desired Behavior
I think strings that start with a "0" like "0.0.0.0" and "0steps" should remain unquoted. "1steps" remained unquoted, there's no reason "0steps" needs to be either.
🗃️ 🌵 🍰
The text was updated successfully, but these errors were encountered: