jnv / ansible-role-unattended-upgrades

[DEPRECATED] Setup unattended-upgrades on Debian-based systems
https://github.com/jnv/ansible-role-unattended-upgrades/issues/98
GNU General Public License v2.0
272 stars 94 forks source link

resolving some linting warnings #71

Closed DO1JLR closed 4 years ago

DO1JLR commented 4 years ago

Hi there.

Thanks for this role.

I found some linting warnings and tried to fix them. I hope you like it

[702] Use 'galaxy_tags' rather than 'categories'
meta/main.yml:2
{'meta/main.yml': {'galaxy_info': {'author': 'Jan Vlnas', 'description': 'Setup unattended-upgrades on Debian-based systems', 'license': 'GPLv2', 'min_ansible_version': 1.4, 'platforms': [{'name': 'Ubuntu', 'versions': ['precise', 'raring', 'saucy', 'trusty', 'utopic'], '__line__': 8, '__file__': '/home/lilian/git/ansible-role-unattended-upgrades/meta/main.yml'}, {'name': 'Debian', 'versions': ['wheezy', 'jessie'], '__line__': 15, '__file__': '/home/lilian/git/ansible-role-unattended-upgrades/meta/main.yml'}], 'categories': ['system'], '__line__': 3, '__file__': '/home/lilian/git/ansible-role-unattended-upgrades/meta/main.yml'}, 'dependencies': [], '__line__': 2, '__file__': '/home/lilian/git/ansible-role-unattended-upgrades/meta/main.yml', 'skipped_rules': []}}

[206] Variables should have spaces before and after: {{ var_name }}
tasks/unattended-upgrades.yml:13
    cache_valid_time: "{{unattended_cache_valid_time}}"

[502] All tasks should be named
tests/test.yml:33
Task/Handler: setup 

[502] All tasks should be named
tests/test.yml:48
Task/Handler: fail msg=Role failed idempotency check __line__=49 __file__=tests/test.yml

[503] Tasks that run when changed should likely be handlers
tests/test.yml:48
Task/Handler: fail msg=Role failed idempotency check __line__=49 __file__=tests/test.yml

[301] Commands should not change things if nothing needs doing
tests/test.yml:52
Task/Handler: Get apt-config variables

[305] Use shell only when shell functionality is required
tests/test.yml:52
Task/Handler: Get apt-config variables

[301] Commands should not change things if nothing needs doing
tests/test.yml:69
Task/Handler: Dry run unattended-upgrades
jnv commented 4 years ago

Thanks for the PR, L3D! These changes look great, my only concern was about rule 503 since I would prefer not to have handler only for testing, but I see you've disabled it in d8bb254f076f068d2eda017782c30fa2b06d3c3d, so that's fine as well. I'll merge it right away.