Skip to content
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

CircleCI: ansible-lint playbooks #1134

Merged
merged 2 commits into from
Feb 25, 2020
Merged

CircleCI: ansible-lint playbooks #1134

merged 2 commits into from
Feb 25, 2020

Conversation

tangrufus
Copy link
Collaborator

@tangrufus tangrufus commented Jan 13, 2020

Ansible Lint is a commandline tool for linting playbooks. Use it to detect behaviors and practices that could potentially be improved.

-- https://docs.ansible.com/ansible-lint/

ansible-lint is useful to catch depreciation sooner.

Taken from https://github.com/ItinerisLtd/trellis_install_wp_cli_via_composer/blob/a1bc936d033641cc54556da5a7501d0685f8361d/.circleci/config.yml#L24-L32

See: https://docs.ansible.com/ansible-lint/rules/default_rules.html

.circleci/config.yml Outdated Show resolved Hide resolved
@tangrufus
Copy link
Collaborator Author

tangrufus commented Jan 15, 2020

deleted

@tangrufus tangrufus changed the title [WIP] CircleCI: ansible-lint playbooks CircleCI: ansible-lint playbooks Feb 22, 2020
@tangrufus
Copy link
Collaborator Author

tangrufus commented Feb 22, 2020

Ignore rule 303 (Using command rather than module) on Remove untracked files from project folder because ansible git module doesn't provide git clean.

Ignore rule 204 (Lines should be no longer than 160 chars) to allow more than 160 chars on a single line.

Tolerate (won't fix) these 3 warnings because our use of "dynamic import":

$ ansible-lint deploy.yml dev.yml server.yml rollback.yml xdebug-tunnel.yml
WARNING: Couldn't open /home/circleci/project/roles/wordpress-install/tasks/tasks/composer-authentications.yml - No such file or directory
WARNING: Couldn't open /home/circleci/project/roles/wordpress-setup/tasks/roles/common/tasks/disable_challenge_sites.yml - No such file or directory
WARNING: Couldn't open /home/circleci/project/roles/letsencrypt/tasks/roles/common/tasks/reload_nginx.yml - No such file or directory

Fixed 1 lint warning (rule 301 - Commands should not change things if nothing needs doing) introduced by #1148

Ready for review.

@tangrufus tangrufus marked this pull request as ready for review February 22, 2020 18:05
Copy link
Member

@swalkinshaw swalkinshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work. Looks good 🎉

@tangrufus tangrufus merged commit 76337fd into roots:master Feb 25, 2020
@tangrufus tangrufus deleted the lint branch February 25, 2020 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants