Use symbolic permissions in Ansible code#858
Merged
Conversation
Since symbolic permissions are more clear than implicit ones, and since our ansible-lint rules are changing to forbid implicit permissions, we need to update them for any Ansible playbooks used in our Packer configuration.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR replaces all octal permission specifications with their symbolic equivalents across Ansible playbooks, roles, and Packer provisioning tasks to improve readability and comply with upcoming linter checks.
- Replaced numeric
mode:values with symbolic permission strings in various Ansible tasks. - Updated Packer provisioning playbooks similarly for consistency.
- Ensured no implicit octal permissions remain according to the grep check.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packer/ansible/create_cyhy_user.yml | Replaced octal mode with symbolic permissions |
| packer/ansible/create_credentials_directory.yml | Replaced octal mode with symbolic permissions |
| ansible/roles/swap/tasks/main.yml | Replaced octal mode with symbolic permissions |
| ansible/roles/orchestrator/tasks/main.yml | Replaced octal mode with symbolic permissions |
| ansible/roles/nessus/tasks/main.yml | Replaced octal mode with symbolic permissions |
| ansible/roles/mongo/tasks/main.yml | Replaced octal mode with symbolic permissions |
| ansible/roles/mgmt_ops/tasks/main.yml | Replaced octal mode with symbolic permissions |
| ansible/roles/cyhy_reporter/tasks/main.yml | Replaced octal mode with symbolic permissions |
| ansible/roles/cyhy_ops/tasks/main.yml | Replaced octal mode with symbolic permissions |
| ansible/roles/cyhy_mailer/tasks/main.yml | Replaced octal mode with symbolic permissions |
| ansible/roles/cyhy_feeds/tasks/main.yml | Replaced octal mode with symbolic permissions |
| ansible/roles/cyhy_dashboard/tasks/main.yml | Replaced octal mode with symbolic permissions |
| ansible/roles/cyhy_commander/tasks/main.yml | Replaced octal mode with symbolic permissions |
| ansible/roles/cyhy_archive/tasks/main.yml | Replaced octal mode with symbolic permissions |
| ansible/roles/code_gov_update/tasks/main.yml | Replaced octal mode with symbolic permissions |
dav3r
approved these changes
May 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗣 Description
This pull request replaces all uses of implicit permission (octal permissions representation) with symbolic permissions.
💭 Motivation and context
In addition to being easier to read this will also be required by the linter changes in #856. Since there is nothing stopping us from doing it "in advance" and due to the amount of Ansible code that lives in this repository I thought it would be helpful to break the change out into its own pull request.
🧪 Testing
Automated tests pass. I verified that no implicit permissions remain with
$ grep -rnE ': 0[0-7]{3}'✅ Pre-approval checklist