Class: AnsibleRolesController
Overview
UI controller for ansible roles
Constant Summary
ForemanAnsible::AnsibleRolesDataPreparations::ROLE_ACTION_NAMES, ForemanAnsible::AnsibleRolesDataPreparations::VARIABLE_ACTION_NAMES
Instance Method Summary
collapse
#excluded_roles, #get_old_roles_variables, #get_roles_variables, #prepare_ansible_import_rows, #prepare_api_row, #prepare_ui_row, #role_action_name, #role_match_excluded_roles, #variable_action_name, #variables_to_s
#find_proxy
Instance Method Details
#confirm_import ⇒ Object
34
35
36
37
38
39
40
|
# File 'app/controllers/ansible_roles_controller.rb', line 34
def confirm_import
job = SyncRolesAndVariables.perform_later(params['changed'].to_unsafe_h, @proxy)
task = ForemanTasks::Task.find_by(external_id: job.provider_job_id)
render json: {
task: task
}, status: :ok
end
|
#destroy ⇒ Object
15
16
17
18
19
20
21
|
# File 'app/controllers/ansible_roles_controller.rb', line 15
def destroy
if @ansible_role.destroy
process_success
else
process_error
end
end
|
#import ⇒ Object
23
24
25
26
27
28
29
30
31
32
|
# File 'app/controllers/ansible_roles_controller.rb', line 23
def import
changed = @importer.import!
@rows = prepare_ansible_import_rows(changed, @variables_importer)
if @rows.empty?
success no_changed_roles_message
redirect_to ansible_roles_path
else
render
end
end
|
#index ⇒ Object
8
9
10
11
12
13
|
# File 'app/controllers/ansible_roles_controller.rb', line 8
def index
@ansible_roles = resource_base.search_for(params[:search],
:order => params[:order]).
paginate(:page => params[:page],
:per_page => params[:per_page])
end
|