-
-
Notifications
You must be signed in to change notification settings - Fork 723
feat(ansible_check_mode): add support for ansible check mode #1521
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
base: development
Are you sure you want to change the base?
feat(ansible_check_mode): add support for ansible check mode #1521
Conversation
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.
Pull Request Overview
This PR adds support for Ansible check mode to allow pretend runs that prevent task failures on self-hosted, non-Docker GUI installations.
- Adds explicit "check_mode: False" in several tasks to disable check mode behavior where commands must execute.
- Configures tasks to use "ignore_errors: {{ ansible_check_mode }}" so that errors can be conditionally ignored in check mode.
- Updates multiple role task files to integrate these adjustments.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
roles/netbootxyz/tasks/generate_signatures.yml | Adds check_mode: False to file listing and adjusts error handling. |
roles/netbootxyz/tasks/generate_menus_custom.yml | Adds ignore_errors using ansible_check_mode to the templating task. |
roles/netbootxyz/tasks/generate_disks_rpi.yml | Adds ignore_errors flag for template and copy tasks. |
roles/netbootxyz/tasks/generate_disks_linux.yml | Adds ignore_errors flag to the disk generation copy task. |
roles/netbootxyz/tasks/generate_disks_legacy.yml | Adds ignore_errors flag to multiple copy tasks for legacy disks. |
roles/netbootxyz/tasks/generate_disks_efi.yml | Adds ignore_errors flag to the EFI disk copy task. |
roles/netbootxyz/tasks/generate_disks_base.yml | Adds ignore_errors flag to template and file-touch tasks. |
roles/netbootxyz/tasks/generate_disks_arm.yml | Adds ignore_errors flag to ARM disk copy tasks. |
roles/netbootxyz/tasks/generate_checksums.yml | Adds check_mode: False and ignore_errors to ensure proper checksum generation. |
Comments suppressed due to low confidence (1)
roles/netbootxyz/tasks/generate_checksums.yml:10
- The explicit disabling of check mode in this task may conflict with the overall goal of simulating runs. Verify whether tasks that generate checksums should run in check mode or if they require a conditional execution based on the ansible_check_mode variable.
check_mode: False
@@ -2,6 +2,7 @@ | |||
- name: Gather list of source files | |||
ansible.builtin.command: ls {{ netbootxyz_root }} | |||
register: source_files | |||
check_mode: False |
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.
Setting 'check_mode: False' here disables check mode for the task that gathers source files. If the intent is to support check mode, consider conditionally applying this flag based on the ansible_check_mode variable.
check_mode: False | |
when: not ansible_check_mode |
Copilot uses AI. Check for mistakes.
Adds support for ansible check mode: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_checkmode.html, which would allow pretend runs to succeed on tasks that otherwise [currently] cause failures in self-hosted, non docker gui installations.