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
- #fill_continuous_output(continuous_output) ⇒ Object
- #finalize ⇒ Object
- #find_options ⇒ Object
- #humanized_name ⇒ Object
- #humanized_output ⇒ Object
- #rescue_strategy ⇒ Object
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 |
#finalize ⇒ Object
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_options ⇒ Object
33 34 35 |
# File 'app/lib/actions/foreman_ansible/helpers/host_common.rb', line 33 def { :verbosity_level => Setting[:ansible_verbosity] } end |
#humanized_name ⇒ Object
17 18 19 |
# File 'app/lib/actions/foreman_ansible/helpers/host_common.rb', line 17 def humanized_name _('Play Ansible roles') end |
#humanized_output ⇒ Object
21 22 23 |
# File 'app/lib/actions/foreman_ansible/helpers/host_common.rb', line 21 def humanized_output continuous_output.humanize end |
#rescue_strategy ⇒ Object
13 14 15 |
# File 'app/lib/actions/foreman_ansible/helpers/host_common.rb', line 13 def rescue_strategy ::Dynflow::Action::Rescue::Fail end |