Collect even more version numbers in docker/defaults/main.yml #143
No reviewers
Labels
No labels
Blocked
Existing Service
Infrastructure Issue
Refactor
Security Hardening
Security Issue
Service Idea
Service Removal
Upgrade service
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: data.coop/ansible#143
Loading…
Reference in a new issue
No description provided.
Delete branch "unify_more_configurations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Awesome! I guess you have tested this locally?
Actually not, but I have a similar setup here that works.
I can run it in Vagrant if you want me to.
Yes it would be nice, especially when touching so many files :)
Nice that it works and with a focus on consistency!
Since we have ansible-lint, which also does yamllint, I got curious as to, why we would need any manual interventions on quotation marks... https://git.data.coop/data.coop/ansible/src/branch/main/.pre-commit-config.yaml
pre-commit run --all-files
gives this result:I gather this - maybe I'm wrong: But looking at yamllinters and fixers, they don't actually care about quotation marks. I think it's because it's too complicated to lint. yamlfmt can force single quotes into double quotes, but I think that's it. I think - but not sure - it indicates that we hould not care about things that the linters don't care about, because they probably have their reasons :)
2.2 is a float, "2.2" is a string, but mostly it doesn't matter to write "2.2" anyways. Same for 2 (int) vs "2" (string). I think people who write a lot of yaml don't spend time on it and leave it to the linters.
We have some other interesting lint failures though :)
@benjaoming the reason I've done this, is because the official YAML specification recommends so for readability's sake. Quotes should only be used in case special characters / escape sequences are used. Use double quotes if you need to escape characters (e.g.
\n
), single quotes if you have other characters not parsable if not quoted, otherwise no quotes at all.From YAML spec:
As for the other linting errors and warnings, I think @valberg is working on that in #128.
Oh interesting! Then I was wrong! I was looking a lot at what the linters do but I couldn't come up with anything that would enforce/avoid manual labour in this area. I hope I'm wrong though because it seems like an annoying problem :/
Well, it's not a problem per se, it's more for readability. It doesn't hurt to use quotes, but avoiding them makes it more readable IMO.
I have just kept to using quotes since there is the odd case of having to quote strings which start with a variable. But removing quotes doesn't rub me the wrong way :)
I usually just quote everything that has a variable.
Removing the quotes changes the semantics in some cases. For example,
services.nginx_acme_companion.version
is now parsed as a float (2.2
). I'd rather we quote everything over having to keep in mind how2.2
is parsed as a float,no
is parsed as a boolean etc.It doesn't really matter, if they're just used as variables. It would matter if something like
2.2
was used by itself, instead of how it is right now with fx.repo/image:{{ some_var_that_is_2.2 }}
.That's just what the YAML spec recommends.
Actually, maybe you're right. Though I don't think we should quote scalars that are obviously strings. I propose we follow this reference: https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html
@valberg @benjaoming I'm gonna revert the quotation changes for now, so we can focus the PR on the version numbers. We can always get back to it at another point.
@samsapti Let's get this merged in! Great work!