Class: AnsibleRolesController

Inherits:
ApplicationController
  • Object
show all
Includes:
Foreman::Controller::AutoCompleteSearch
Defined in:
app/controllers/ansible_roles_controller.rb

Overview

UI controller for ansible roles

Instance Method Summary collapse

Instance Method Details

#confirm_importObject



35
36
37
38
39
# File 'app/controllers/ansible_roles_controller.rb', line 35

def confirm_import
  @importer.finish_import(params[:changed].to_unsafe_h)
  success _('Import of roles successfully finished.')
  redirect_to ansible_roles_path
end

#destroyObject



17
18
19
20
21
22
23
# File 'app/controllers/ansible_roles_controller.rb', line 17

def destroy
  if @ansible_role.destroy
    process_success
  else
    process_error
  end
end

#importObject



25
26
27
28
29
30
31
32
33
# File 'app/controllers/ansible_roles_controller.rb', line 25

def import
  changed = @importer.import!
  if changed.values.all?(&:empty?)
    success no_changed_roles_message
    redirect_to ansible_roles_path
  else
    render :locals => { :changed => changed }
  end
end

#indexObject



10
11
12
13
14
15
# File 'app/controllers/ansible_roles_controller.rb', line 10

def index
  @ansible_roles = resource_base.search_for(params[:search],
                                            :order => params[:order]).
                   paginate(:page => params[:page],
                            :per_page => params[:per_page])
end