Sha256: f873f8ceb1cd18d2f6b57e7d4bcbe06d192d3276340d88f661071d2758ec6183
Contents?: true
Size: 1020 Bytes
Versions: 10
Compression:
Stored size: 1020 Bytes
Contents
module ForemanAnsible # Chained methods to extend the hosts menu with Ansible actions module HostsHelperExtensions extend ActiveSupport::Concern module Overrides def host_title_actions(*args) host = args.first if ansible_roles_present?(host) button = ansible_roles_button(host) title_actions(button_group(button)) end super(*args) end def multiple_actions super + [[_('Play Ansible roles'), multiple_play_roles_hosts_path, false]] end end included do prepend Overrides end def ansible_roles_present?(host) host.ansible_roles.present? || host.inherited_ansible_roles.present? end def ansible_roles_button(host) link_to( _('Run Ansible roles'), play_roles_host_path(:id => host.id), :id => :ansible_roles_button, :class => 'btn btn-default', :'data-no-turbolink' => true ) end end end
Version data entries
10 entries across 10 versions & 1 rubygems