-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #37942 - Adding Ansible Check Mode to Ansible Job Templates
- Loading branch information
1 parent
0bd8029
commit 9e70d02
Showing
6 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# frozen_string_literal: true | ||
|
||
attributes :ansible_callback_enabled | ||
attributes :ansible_callback_enabled, :ansible_check_mode |
1 change: 1 addition & 0 deletions
1
app/views/job_templates/_job_template_callback_tab_content.html.erb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<div class="tab-pane" id="ansible_callback_enabled"> | ||
<%= checkbox_f f, :ansible_callback_enabled, :label => _('Enable Ansible Callback'), :disabled => @template.locked? %> | ||
<%= checkbox_f f, :ansible_check_mode, :label => _('Enable Ansible Check Mode'), :disabled => @template.locked? %> | ||
</div> |
10 changes: 10 additions & 0 deletions
10
db/migrate/20241022000000_add_ansible_check_mode_to_templates.rb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddAnsibleCheckModeToTemplates < ActiveRecord::Migration[6.0] | ||
def change | ||
add_column :templates, :ansible_check_mode, :boolean, default: false | ||
RemoteExecutionFeature.where(label: 'ansible_run_host').each do |rex_feature| | ||
Template.where(id: rex_feature.job_template_id).update_all(ansible_check_mode: false) | ||
end | ||
end | ||
end |