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
fix ansible lint seperate commits #684
fix ansible lint seperate commits #684
Conversation
/ost |
6b8a262
to
c50a679
Compare
/ost |
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.
It's reviewable now, thank you for splitting it. Some comments inside. Besides that, please pay attention to the titles of the commits, almost all look weird.
vars: | ||
gluster_cgroup_cpu_quota : "{{ [(ansible_processor_vcpus/3)|int,1]|max * 100 }}" | ||
gluster_cgroup_cpu_quota: "{{ [(ansible_processor_vcpus / 3) | int, 1] | max * 100 }}" |
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.
Shouldn't there be a space also after the slash?
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.
about the titles- it's because the title is long, looks like it was split automatically
space- yes, I fixed it in a commit I posted today: 0575c14
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.
about the titles- it's because the title is long, looks like it was split automatically
Please don't respond to comments in unrelated places, otherwise it's hard to track discussions.
space- yes, I fixed it in a commit I posted today: 0575c14
Great, OK.
- name: Fetch the directory and volume details | ||
block: | ||
- name: Get the list of volumes on the machine | ||
shell: ls "{{ glusterd_libdir }}/vols" | ||
ansible.builtin.command: ls "{{ glusterd_libdir }}/vols" |
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.
Better (or mandatory?) to use argv
with command
rather than quoting inside the command. Also in other changes from shell
where switching to command
, not only here.
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.
done- 564b39e
path: "{{ mntpath }}" | ||
state: directory | ||
mode: '755' |
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.
To specify the mode, '755'
notation is used in some places and 0755
in other places. Since it's part of cleanup, it would be good to be consistent and preferably use one or the other everywhere.
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.
done
@@ -14,5 +14,5 @@ | |||
disable virtstoraged.socket | |||
disable virtproxyd.socket | |||
enable libvirtd.service | |||
|
|||
when: el_ver|int >= 9 | |||
mode: preserve |
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.
When the dest file doesn't exist, system umask is used. This calls for problems, is there a reason not to specify the file mode directly here?
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.
fixed
@@ -1,36 +1,36 @@ | |||
--- | |||
- block: | |||
- name: Stop iptables service if running | |||
service: | |||
ansible.builtin.service: # noqa ignore-errors |
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 don't understand the reasoning in the commit message behind silencing this (and the related) warnings.
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.
for this task- the task for running firewalld (2 tasks after this one) will fail anyway if iptables is running.
If iptables is stopped and the role can continue, and we don't care about iptables at this point- I don't see a reason to handle any errors related to iptables at this point.
host upgrade-
line #12: see my discussion with @almusil here-
#413
line #46: this is not a mandatory part of the upgrade process. we added it to clear space before upgrading, and If cleaning cache fails, in most cases there'll be enough space to continue with upgrading the packages.
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.
for this task- the task for running firewalld (2 tasks after this one) will fail anyway if iptables is running. If iptables is stopped and the role can continue, and we don't care about iptables at this point- I don't see a reason to handle any errors related to iptables at this point.
OK. Please put this information to the commit message. The current explanation there, "Use failed_when and specify error conditions instead of using ignore_errors", talks about something different and unrelated to the current version, which confused me. It has probably been forgotten to update when the patch changed?
host upgrade- line #12: see my discussion with @almusil here- #413
line #46: this is not a mandatory part of the upgrade process. we added it to clear space before upgrading, and If cleaning cache fails, in most cases there'll be enough space to continue with upgrading the packages.
I'm losing the context here.
Make sure each commit message has its short single-line title, separated from the following content by a blank line. |
1079e9a
to
983aa07
Compare
done |
983aa07
to
564b39e
Compare
@mz-pdm I pushed the fixes we discussed |
/ost |
48fe11a
to
fcf3b2d
Compare
/ost |
1 similar comment
/ost |
fcf3b2d
to
7d3601c
Compare
/ost |
fd72d56
to
f85875f
Compare
/ost |
3 similar comments
/ost |
/ost |
/ost |
b6a7f48
to
a798cae
Compare
/ost |
a798cae
to
56a7a69
Compare
/ost |
1 similar comment
/ost |
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=2100137 including fixes for: - use FQCN for builtin actions - missing starting space in comment - jinja2 spacing could be improved - line too long - no new line character at the end of file - trailing spaces - too many spaces before colon - too many spaces after colon - too many blank lines - all names should start with an uppercase letter - truthy value should be one of (yaml[truthy]) - wrong indentation
'File permissions unset or incorrect'
'Shells that use pipes should set the pipefail option'
- role-name: Role name <role-name> does not match ``^*$`` pattern. - name: All tasks should be named. (name[missing])
'Commands should not change things if nothing needs doing' Since the tag 'skip_ansible_lint oVirt#301' doesn't work and '# noqa no-changed-when' cannot be set on code blocks, adding it to skip list
- command-instead-of-module: systemctl used in place of systemd module (+ merged tasks), rpm used in place of yum or rpm_key module - command-instead-of-shell: Use shell only when shell functionality is required
The error 'Use failed_when and specify error conditions instead of using ignore_errors' was handled by adding '# noqa ignore-errors' tag, since failure in these tasks shouldn't block from continuing the execution of the role
Tasks that run when changed should likely be handlers
'Templated files should use template instead of copy'
fixed in all places that replaced shell with command
- use FQCN for builtin module actions (include_tasks, import_tasks) - Use FQCN for module actions
Ignoring because when using 'set -o pipefail &&' the task fails due to non zero return code
56a7a69
to
88febb7
Compare
/ost |
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.
+1
^*$
pattern. - name: All tasks should be named. (name[missing])Fixes: #710