Sha256: 36080f58fe2a71560de464615bd4ea811a5147141160a1283d58b7f008f4a15f

Contents?: true

Size: 630 Bytes

Versions: 14

Compression:

Stored size: 630 Bytes

Contents

module Actions
  module ForemanAnsible
    # Bulk action for running ansible roles
    class PlayHostsRoles < Actions::ActionWithSubPlans
      def plan(hosts)
        plan_self(:host_ids => hosts.map(&:id))
      end

      def create_sub_plans
        proxy_selector = ::ForemanAnsible::ProxySelector.new
        input[:host_ids].map do |host_id|
          host = Host.find(host_id)
          trigger(PlayHostRoles, host, proxy_selector)
        end
      end

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

      def humanized_name
        _('Bulk play Ansible roles')
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
foreman_ansible-1.5.2 app/lib/actions/foreman_ansible/play_hosts_roles.rb
foreman_ansible-1.5.1 app/lib/actions/foreman_ansible/play_hosts_roles.rb
foreman_ansible-1.5.0 app/lib/actions/foreman_ansible/play_hosts_roles.rb
foreman_ansible-1.4.6 app/lib/actions/foreman_ansible/play_hosts_roles.rb
foreman_ansible-1.4.5 app/lib/actions/foreman_ansible/play_hosts_roles.rb
foreman_ansible-1.4.3 app/lib/actions/foreman_ansible/play_hosts_roles.rb
foreman_ansible-1.4.2 app/lib/actions/foreman_ansible/play_hosts_roles.rb
foreman_ansible-1.4.1 app/lib/actions/foreman_ansible/play_hosts_roles.rb
foreman_ansible-1.4.0 app/lib/actions/foreman_ansible/play_hosts_roles.rb
foreman_ansible-1.3.1 app/lib/actions/foreman_ansible/play_hosts_roles.rb
foreman_ansible-1.3.0 app/lib/actions/foreman_ansible/play_hosts_roles.rb
foreman_ansible-1.2.1 app/lib/actions/foreman_ansible/play_hosts_roles.rb
foreman_ansible-1.2 app/lib/actions/foreman_ansible/play_hosts_roles.rb
foreman_ansible-1.1 app/lib/actions/foreman_ansible/play_hosts_roles.rb