fix 🐛: Fix typo and add file permission in logrotate.yml task #7

Merged
Jose merged 4 commits from dev into main 2026-02-09 18:25:09 +01:00
Owner

This commit fixes a typo in the logrotate configuration file and adds necessary file permissions to ensure proper rotation of log files.

This commit fixes a typo in the logrotate configuration file and adds necessary file permissions to ensure proper rotation of log files.
Jose added 4 commits 2026-02-09 18:23:38 +01:00
refactor ♻️: Refactor Proxmox repo management tasks, add comments, and ensure apt update is triggered on changes.
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 7s
Gitleaks Scan / gitleaks (push) Successful in 5s
Markdown Lint / markdown-lint (push) Successful in 5s
b42e72a835
This commit refactors the Proxmox repository management tasks by adding necessary comments for better understanding. It also ensures that `apt update` is triggered whenever there are changes to the repository configuration.
feat : Add new script pve-remove-nag.sh for removing Nag messages in PVE UIs
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 16s
Gitleaks Scan / gitleaks (push) Successful in 4s
Markdown Lint / markdown-lint (push) Successful in 5s
75cff9590d
This commit introduces a new script `pve-remove-nag.sh` designed to remove nag messages from both the Proxmox VE web and mobile user interfaces. The script is refactored to improve installation process, and the UI patching logic has been temporarily commented out for further refinement.
refactor ♻️: Refactor logrotate tasks for better readability and consistency - Rename 'logrotate reload' task to 'Logrotate reload' - Refactor task names in subscription.yml for better organization and clarity
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 11s
Gitleaks Scan / gitleaks (push) Successful in 5s
Markdown Lint / markdown-lint (push) Successful in 5s
abdba53053
This commit refactors the logrotate tasks by renaming them for better readability and consistency, and refactoring task names in `subscription.yml` for improved organization and clarity.
fix 🐛: Fix typo and add file permission in logrotate.yml task
All checks were successful
ansible-lint / Ansible Lint (push) Successful in 13s
Gitleaks Scan / gitleaks (push) Successful in 5s
Markdown Lint / markdown-lint (push) Successful in 5s
ai-reviews / Review PR (pull_request) Successful in 37s
ansible-lint / Ansible Lint (pull_request) Successful in 12s
Gitleaks Scan / gitleaks (pull_request) Successful in 9s
Markdown Lint / markdown-lint (pull_request) Successful in 26s
3e6e1cb893
This commit fixes a typo in the logrotate configuration file and adds necessary file permissions to ensure proper rotation of log files.
gitea-actions bot reviewed 2026-02-09 18:24:15 +01:00
gitea-actions bot left a comment

Review Summary

  • files/pve-remove-nag.sh: Summary: This script is added to remove nagging prompts for a subscription in the Proxmox VE web and mobile user interfaces. The code looks good, with no issues found that would score higher than 2. diff LGTM
  • handlers/main.yml: The changes made to the handlers/main.yml file appear to mainly involve reorganizing and renaming a block of code without significant impact on logic, security, performance, or maintainability. However, there is one minor suggestion for clarity that could be made.
  • tasks/logrotate.yml: Changes Summary: The provided code changes focus on refactoring the way Ansible tasks are called for handling log files using the logrotate module. This change improves readability and maintainability by consolidating similar tasks under one call. However, there's a minor issue related to the usage of notify that could lead to potential race conditions. Here is the detailed review: Comment: [Score: 3] Using remote_src with the copy module might lead to potential data transfer issues due to network latency or access permissions. It's recommended to use stat for file existence checks and only copy files when necessary. Comment: [Score: 2] Moving the notify task outside of the block might lead to potential race conditions if other tasks are asynchronous or take a significant amount of time to complete. It's recommended to leave the notify inside the blocks to ensure that it is executed after all tasks have completed. LGTM (with minor suggestions)
  • tasks/repos.yml: The changes made to the tasks/repos.yml file focus on managing Proxmox repositories, specifically the enterprise and no-subscription repositories. Here's a breakdown of the changes: 1. Lines 16-23: Comment out Proxmox enterprise repo lines and notify to run apt update. This modification is good as it prevents accidental installation from the enterprise repository, but the notification for updating packages should ideally be handled in a separate task for better maintainability [Score: 3]. 2. Lines 31-49: Manage Proxmox no-subscription repo (uncomment if present, add if missing, and notify to run apt update). This block of code looks fine with the exception that it consolidates multiple tasks into one, which can make the playbook harder to understand and maintain [Score: 3]. 3. Lines 50: Notify to run apt update only once if any changes occurred. This modification is good as it avoids unnecessary package updates [Score: 2]. However, the condition checks for all previous tasks, which may not be ideal for larger playbooks. It would be better to have a separate task that handles this notification to improve maintainability [Score: 3]. In summary, while there are improvements in terms of security and performance, the code could benefit from increased maintainability by splitting up some of the tasks and separating concerns more clearly.
  • tasks/subscription.yml: The changes introduce a more descriptive and consistent naming convention for tasks, which is good for maintainability. However, there are potential issues related to security and performance. Other than these issues, the code looks good, and no critical problems were found. LGTM (With recommendations for improvements.)
  • templates/logrotate-pve.j2: This change removes the configuration for log rotation of Proxmox VE logs in the logrotate-pve.j2 template file, which could lead to improper management and potential growth of log files without pruning.
# Review Summary * **files/pve-remove-nag.sh**: **Summary:** This script is added to remove nagging prompts for a subscription in the Proxmox VE web and mobile user interfaces. The code looks good, with no issues found that would score higher than 2. ```diff LGTM ``` * **handlers/main.yml**: The changes made to the handlers/main.yml file appear to mainly involve reorganizing and renaming a block of code without significant impact on logic, security, performance, or maintainability. However, there is one minor suggestion for clarity that could be made. * **tasks/logrotate.yml**: Changes Summary: The provided code changes focus on refactoring the way Ansible tasks are called for handling log files using the `logrotate` module. This change improves readability and maintainability by consolidating similar tasks under one call. However, there's a minor issue related to the usage of `notify` that could lead to potential race conditions. Here is the detailed review: Comment: [Score: 3] Using `remote_src` with the `copy` module might lead to potential data transfer issues due to network latency or access permissions. It's recommended to use `stat` for file existence checks and only copy files when necessary. Comment: [Score: 2] Moving the `notify` task outside of the block might lead to potential race conditions if other tasks are asynchronous or take a significant amount of time to complete. It's recommended to leave the `notify` inside the blocks to ensure that it is executed after all tasks have completed. LGTM (with minor suggestions) * **tasks/repos.yml**: The changes made to the tasks/repos.yml file focus on managing Proxmox repositories, specifically the enterprise and no-subscription repositories. Here's a breakdown of the changes: 1. Lines 16-23: Comment out Proxmox enterprise repo lines and notify to run `apt update`. This modification is good as it prevents accidental installation from the enterprise repository, but the notification for updating packages should ideally be handled in a separate task for better maintainability [Score: 3]. 2. Lines 31-49: Manage Proxmox no-subscription repo (uncomment if present, add if missing, and notify to run `apt update`). This block of code looks fine with the exception that it consolidates multiple tasks into one, which can make the playbook harder to understand and maintain [Score: 3]. 3. Lines 50: Notify to run `apt update` only once if any changes occurred. This modification is good as it avoids unnecessary package updates [Score: 2]. However, the condition checks for all previous tasks, which may not be ideal for larger playbooks. It would be better to have a separate task that handles this notification to improve maintainability [Score: 3]. In summary, while there are improvements in terms of security and performance, the code could benefit from increased maintainability by splitting up some of the tasks and separating concerns more clearly. * **tasks/subscription.yml**: The changes introduce a more descriptive and consistent naming convention for tasks, which is good for maintainability. However, there are potential issues related to security and performance. Other than these issues, the code looks good, and no critical problems were found. LGTM (With recommendations for improvements.) * **templates/logrotate-pve.j2**: This change removes the configuration for log rotation of Proxmox VE logs in the `logrotate-pve.j2` template file, which could lead to improper management and potential growth of log files without pruning.
@@ -17,4 +18,4 @@
dest: /usr/local/bin/pve-remove-nag.sh
owner: root
group: root
mode: "0755"

[Lines 6-21] [Score: 4] The script hardcodes a path to the web JavaScript file and checks for its existence using -s. This approach might fail if the file is not present or if its name changes. Consider using find with appropriate filters instead.

[Lines 6-21] [Score: 4] The script hardcodes a path to the web JavaScript file and checks for its existence using `-s`. This approach might fail if the file is not present or if its name changes. Consider using `find` with appropriate filters instead.
@@ -72,3 +24,4 @@
- name: subscription | Install APT post-invoke hook for nag removal
ansible.builtin.copy:
dest: /etc/apt/apt.conf.d/no-nag-script
owner: root

[Lines 1-27] [Score: 3] The naming convention is inconsistent, using a mix of regular and descriptive task names. This might create confusion about the purpose of each task at a glance.

[Lines 1-27] [Score: 3] The naming convention is inconsistent, using a mix of regular and descriptive task names. This might create confusion about the purpose of each task at a glance.

[Lines 15-30] [Score: 4] The script hardcodes a path to the mobile template file and checks for its existence using -f. This approach might fail if the file is not present or if its name changes. Consider using find with appropriate filters instead.

[Lines 15-30] [Score: 4] The script hardcodes a path to the mobile template file and checks for its existence using `-f`. This approach might fail if the file is not present or if its name changes. Consider using `find` with appropriate filters instead.

[Lines 1-13] [Score: 4] Removing log rotation configuration for Proxmox VE logs could lead to unmanaged log file growth and potential performance issues. It's recommended to implement a log rotation solution or consider using alternative methods if the intent was to manage log files efficiently.

[Lines 1-13] [Score: 4] Removing log rotation configuration for Proxmox VE logs could lead to unmanaged log file growth and potential performance issues. It's recommended to implement a log rotation solution or consider using alternative methods if the intent was to manage log files efficiently.
Jose merged commit 9f29808a6a into main 2026-02-09 18:25:09 +01:00
Sign in to join this conversation.