-
Notifications
You must be signed in to change notification settings - Fork 34
Adds support for ansible-lint #1129
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
Adds support for ansible-lint #1129
Conversation
Generated by 🚫 Danger |
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.
Thank you! I have a couple comments.
Also regarding a commit:
|
Proof of fail due to ansible-lint: https://travis-ci.org/php-coder/mystamps/jobs/591231907 |
Why the build fails with |
Good to see that it might fail! Could you suppress this warning to make CI green? It seems like we can add a special comment or something similar -- https://github.com/ansible/ansible-lint#false-positives-skipping-rules We don't need to fix this issue now as we have a separate issue to deal with it: #998 |
vagrant/provisioning/roles/restic-backups/molecule/default/INSTALL.rst
Outdated
Show resolved
Hide resolved
Still here and need to be addressed, otherwise we can't merge this as it will break the builds. |
I hope I've fixed everything you told me about, please check. After fix into upstream I'm going to fix restic-backups support :) |
@@ -98,6 +100,9 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then | |||
[ "$AFFECTS_ROBOT_FILES" != 'no' ] || RFLINT_STATUS=skip | |||
[ "$AFFECTS_SHELL_FILES" != 'no' ] || SHELLCHECK_STATUS=skip | |||
fi | |||
|
|||
test "$AFFECTS_PLAYBOOKS" != "no" || ANSIBLE_LINT_STATUS=skip |
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.
In sake of code consistency:
- use
[
instead oftest
- use single quotes when a string doesn't contain variables
|
||
# we can't use service module here because our sudoers allows to execute only exact commands | ||
- name: Stopping service | ||
- name: Stopping service # noqa 301 |
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.
The original error was:
301 Commands should not change things if nothing needs doing
src/main/scripts/ci/ansible/deploy.yml:37
Task/Handler: Stopping service
I think that we should add a comment to clearly communicate why we suppress this check. Something like this:
301 check is ignored as we always need to stop the service before deploy.
Actually it's a good question -- do we really need to do this always? Perhaps, we could copy WAR file and use handler for restarting the service. I'm not sure whether it's a good approach.
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'm almost sure this refactoring should be performed along with bumping ansible version and using systemd module
Thank you for finding time to update the PR 👍 See my comments. |
P.S. Are you sure that you want to use nickname instead of a full name as an author? I don't insist but need to double check that this is what you want. Typically, people use their names (see |
@php-coder I definitely prefer to be named by my nickname :) |
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.
Minor improvements only left. Overall looks good, thank you! 👍
BTW could you also amend the first commit (where you added ansible-lint) and append "Fix #479" line? To keep this relation in git history as well.
@asm0dey I has been thought about merging it as-is now and fix small issue by myself but decided to be with you as pedantic as with others :) Thank you for patience! I appreciate that! |
Should work regardless of ansible/ansible-lint#457 because `monitorid` and `apikey` are fields of uptimerobot object, not plain variables
This fix is intended to allow playbook to manually start and stop mystamps service. Potentially this is not intended behaviour and should be migrated to systemd task and handler. But current behaviour is well-tested and as such should be presereved at least for now.
After migration to systemd module (and newer ansible) this should be fixed of course. But currently this is the only supported way to reload systemd daemon
Signed-off-by: asm0dey <[email protected]>
@asm0dey I'm happy to merge it finally! Thank you! 🥇 I've also added you to our hall of fame: https://github.com/php-coder/mystamps/wiki/team-members |
@php-coder Yay! Now let's move to restic improvements :) |
Fix #479