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

Fixes #37942 - Add job_check_mode to allow Ansible Check Mode in Job Templates #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bnerickson
Copy link

@bnerickson bnerickson commented Oct 23, 2024

Overview of Changes

This PR adds a separate job_check_mode variable to the AnsibleRunner class allowing Ansible Check Mode to be set on Jobs when the new ansible_check_mode checkbox is selected in Ansible Job Templates (see PR theforeman/foreman_ansible#742).

Implementation Considerations

I considered re-using the existing check_mode variable. However, its intended use is with the ansible_roles_check_mode host parameter executing Ansible Check Mode on the "Ansible Roles" job only. Therefore, in order to not change the current expected behavior, I've separated the new functionality into a different boolean.

Testing Steps

  1. Add the changes in Fixes #37942 - Adding Ansible Check Mode to Ansible Job Templates foreman_ansible#742 to your test environment.
  2. Add the changes in this PR to your test environment.
  3. Clone the "Ansible Roles - Ansible Default" Job Template.
  4. In the clone's "Ansible" tab, select the "Ansible Check Mode Enabled" checkbox and save the Job Template.
  5. On a host, schedule a Job and select the cloned Job Category and Job Template. Execute the job.

Checklists

  • I am familiar with the contributing guidelines.
  • I have added relevant tests for my changes.
  • I have updated the documentation accordingly.

Additional Notes

This PR is dependent on:

@theforeman-bot
Copy link
Member

Can one of the admins verify this patch?

@nofaralfasi
Copy link
Contributor

Hi @bnerickson, is there a specific reason this PR is in draft mode? Is it ready for merging?

@bnerickson
Copy link
Author

Hi @bnerickson, is there a specific reason this PR is in draft mode? Is it ready for merging?

Hi @nofaralfasi , since this PR is dependent on theforeman/foreman_ansible#742, I decided to leave this in draft. However, seeing as you've reviewed/approved the aforementioned PR I'll go ahead and publish.

@bnerickson bnerickson marked this pull request as ready for review January 23, 2025 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants