Sha256: 948e14f92d1feb16bb830c17400d7920fb319b5e0dc01fff3b21b952feb8d17c

Contents?: true

Size: 1.82 KB

Versions: 43

Compression:

Stored size: 1.82 KB

Contents

# frozen_string_literal: true

require 'foreman_remote_execution'

module ForemanAnsible
  # Dependencies related with the remote execution plugin
  class Engine < ::Rails::Engine
    config.to_prepare do
      RemoteExecutionProvider.register(
        :Ansible,
        ForemanAnsible::AnsibleProvider
      )

      ForemanAnsible::Engine.register_rex_feature
    end

    def self.register_rex_feature
      RemoteExecutionFeature.register(
        :ansible_run_host,
        N_('Run Ansible roles'),
        :description => N_('Runs an Ansible playbook which contains all'\
                           ' the roles defined for a host'),
        :host_action_button => true
      )
      RemoteExecutionFeature.register(
        :ansible_run_insights_plan,
        N_('Ansible: Run Insights maintenance plan'),
        :description => N_('Runs a given maintenance plan from Red Hat '\
                           'Access Insights given an ID.'),
        :provided_inputs => %w[organization_id plan_id],
        :notification_builder => ForemanAnsible::InsightsNotificationBuilder
      )
      RemoteExecutionFeature.register(
        :ansible_run_playbook,
        N_('Run playbook'),
        :description => N_('Run an Ansible playbook against given hosts'),
        :provided_inputs => %w[playbook]
      )
      RemoteExecutionFeature.register(
        :ansible_enable_web_console,
        N_('Enable web console'),
        :description => N_('Run an Ansible playbook to enable web console on given hosts'),
        :host_action_button => true
      )
      RemoteExecutionFeature.register(
        :ansible_run_capsule_upgrade,
        N_('Upgrade Capsules on given hosts'),
        :description => N_('Upgrade Capsules on given Capsule server hosts'),
        :proxy_selector_override => ::RemoteExecutionProxySelector::INTERNAL_PROXY
      )
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
foreman_ansible-13.0.7 lib/foreman_ansible/remote_execution.rb
foreman_ansible-13.0.5 lib/foreman_ansible/remote_execution.rb
foreman_ansible-14.0.0 lib/foreman_ansible/remote_execution.rb
foreman_ansible-13.0.4 lib/foreman_ansible/remote_execution.rb
foreman_ansible-13.0.3 lib/foreman_ansible/remote_execution.rb
foreman_ansible-13.0.2 lib/foreman_ansible/remote_execution.rb
foreman_ansible-13.0.1 lib/foreman_ansible/remote_execution.rb
foreman_ansible-13.0.0 lib/foreman_ansible/remote_execution.rb
foreman_ansible-12.0.7 lib/foreman_ansible/remote_execution.rb
foreman_ansible-10.4.4 lib/foreman_ansible/remote_execution.rb
foreman_ansible-7.1.8 lib/foreman_ansible/remote_execution.rb
foreman_ansible-12.0.6 lib/foreman_ansible/remote_execution.rb
foreman_ansible-12.0.5 lib/foreman_ansible/remote_execution.rb
foreman_ansible-10.4.3 lib/foreman_ansible/remote_execution.rb
foreman_ansible-12.0.4 lib/foreman_ansible/remote_execution.rb
foreman_ansible-10.4.2 lib/foreman_ansible/remote_execution.rb
foreman_ansible-12.0.3 lib/foreman_ansible/remote_execution.rb
foreman_ansible-12.0.2 lib/foreman_ansible/remote_execution.rb
foreman_ansible-12.0.1 lib/foreman_ansible/remote_execution.rb
foreman_ansible-12.0.0 lib/foreman_ansible/remote_execution.rb