Sha256: ed60a345cb1473922218b9a711d4b30bbd0db1b1d30b3f5bc62406d43555e4f9

Contents?: true

Size: 1.34 KB

Versions: 51

Compression:

Stored size: 1.34 KB

Contents

module ForemanRemoteExecution
  module Concerns
    module Api::V2::RegistrationControllerExtensions
      module ApipieExtensions
        extend Apipie::DSL::Concern

        update_api(:global, :host) do
          param :remote_execution_interface, String, desc: N_("Identifier of the Host interface for Remote execution")
          param :setup_remote_execution_pull, :bool, desc: N_("Set 'host_registration_remote_execution_pull' parameter for the host. If it is set to true, pull provider client will be deployed on the host")
        end
      end

      extend ActiveSupport::Concern

      def host_setup_extension
        remote_execution_interface
        remote_execution_pull
        reset_host_known_keys! unless @host.new_record?
        super
      end

      def remote_execution_pull
        HostParameter.where(host: @host, name: 'host_registration_remote_execution_pull').destroy_all

        setup_host_param('host_registration_remote_execution_pull', ActiveRecord::Type::Boolean.new.deserialize(params['setup_remote_execution_pull']))
      end

      def remote_execution_interface
        return unless params['remote_execution_interface'].present?

        @host.set_execution_interface(params['remote_execution_interface'])
      end

      def reset_host_known_keys!
        @host.host_proxy_invocations.destroy_all
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
foreman_remote_execution-14.1.1 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-14.1.0 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-14.0.2 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-14.0.1 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-13.2.6 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-14.0.0 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-13.2.5 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-13.2.4 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-13.2.3 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-13.2.2 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-12.0.7 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-13.2.1 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-13.2.0 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-10.1.3 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-13.0.0 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-12.0.5 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-12.0.4 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-12.0.1 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-12.0.2 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb
foreman_remote_execution-11.1.3 app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb