Module: Actions::ForemanAnsible::Helpers::HostCommon

Defined in:
app/lib/actions/foreman_ansible/helpers/host_common.rb

Overview

Shared task methods between hostgroup and host roles actions

Instance Method Summary collapse

Instance Method Details

#fill_continuous_output(continuous_output) ⇒ Object



25
26
27
28
29
30
31
# File 'app/lib/actions/foreman_ansible/helpers/host_common.rb', line 25

def fill_continuous_output(continuous_output)
  delegated_output.fetch('result', []).each do |raw_output|
    continuous_output.add_raw_output(raw_output)
  end
rescue StandardError => e
  continuous_output.add_exception(_('Error loading data from proxy'), e)
end

#finalizeObject



8
9
10
11
# File 'app/lib/actions/foreman_ansible/helpers/host_common.rb', line 8

def finalize
  return unless delegated_output[:exit_status].to_s != '0'
  error! _('Playbook execution failed')
end

#find_optionsObject



33
34
35
# File 'app/lib/actions/foreman_ansible/helpers/host_common.rb', line 33

def find_options
  { :verbosity_level => Setting[:ansible_verbosity] }
end

#humanized_nameObject



17
18
19
# File 'app/lib/actions/foreman_ansible/helpers/host_common.rb', line 17

def humanized_name
  _('Play Ansible roles')
end

#humanized_outputObject



21
22
23
# File 'app/lib/actions/foreman_ansible/helpers/host_common.rb', line 21

def humanized_output
  continuous_output.humanize
end

#rescue_strategyObject



13
14
15
# File 'app/lib/actions/foreman_ansible/helpers/host_common.rb', line 13

def rescue_strategy
  ::Dynflow::Action::Rescue::Fail
end