-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
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
ansible-lint 6.x fixes; add ansible-lint github action #43
Conversation
- { user: 'grafana' } | ||
- { user: 'metrics', sasluser: 'metrics', saslpassword: 'p4ssw0rd' } | ||
- {user: 'grafana'} | ||
- {user: 'metrics', sasluser: 'metrics', saslpassword: 'p4ssw0rd'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, in which case are we supposed to keep single quotes vs. eliminate them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use quotes unless you have to, especially for short module-keyword-like strings like present, absent, etc. But do use quotes for user-side strings such as descriptions, names, and messages.
In this case, {user: 'grafana'}
- I would have to refer to the YAML standard to see if {user: grafana}
is ok, since it is a JSON construct embedded within a YAML document.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks @richm
Get ansible-pcp working with ansible-lint 6.x and minimal exceptions All tasks must be named - even `include_tasks` and `meta` tasks Task names must start with uppercase letter Use `true`/`false` instead of `yes`/`no` Use `changed_when: false` for `command` and `shell` that run unconditionally Add `set -o pipefail` for `shell` that use pipes. Note that `pipefail` is not supported on Debian and some Ubuntu platforms, and the roles list them as supported platforms. Fix up jinja spacing no spaces after `[`, `{` - no spaces before `]`, `}` should have a single space before and after `|` Other cleanup e.g. role meta/main.yml In addition: Do not use quotes for strings if not needed (Ansible "modern" style) Remove unused handlers Clean up tox.yml Add separate github action for ansible-lint Remove anything having to do with python code since this does not provide any Ansible modules or other plugins
32e6d42
to
b47459a
Compare
Get ansible-pcp working with ansible-lint 6.x and minimal exceptions
All tasks must be named - even
include_tasks
andmeta
tasksTask names must start with uppercase letter
Use
true
/false
instead ofyes
/no
Use
changed_when: false
forcommand
andshell
that run unconditionallyAdd
set -o pipefail
forshell
that use pipes. Note thatpipefail
is notsupported on Debian and some Ubuntu platforms, and the roles list them as
supported platforms.
Fix up jinja spacing
no spaces after
[
,{
- no spaces before]
,}
should have a single space before and after
|
Other cleanup e.g. role meta/main.yml
In addition:
Do not use quotes for strings if not needed (Ansible "modern" style)
Remove unused handlers
Clean up tox.yml
Add separate github action for ansible-lint
Remove anything having to do with python code since this does not
provide any Ansible modules or other plugins