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

Draft
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?

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.

2 participants