module ForemanAcd
Module required to start the Foreman Rails engine
The ForemanAcd
module
Constants
- RUN_CONFIGURATOR_DELAY
- VERSION
Public Class Methods
acd_base_path()
click to toggle source
# File lib/foreman_acd.rb, line 10 def acd_base_path '/var/lib/foreman/foreman_acd/' end
ansible_playbook_path()
click to toggle source
# File lib/foreman_acd.rb, line 14 def ansible_playbook_path File.join(acd_base_path, 'ansible-playbooks') end
initiate_acd_app_configurator(app_instance)
click to toggle source
# File lib/foreman_acd.rb, line 23 def initiate_acd_app_configurator(app_instance) return unless app_instance.hosts_deployment_finished? ::Foreman::Logging.logger('foreman_acd').info("All hosts of app (#{app_instance.name}) were built. Schedule app configurator...") start_acd_app_configurator(app_instance) end
proxy_setting()
click to toggle source
# File lib/foreman_acd.rb, line 18 def proxy_setting HttpProxy.default_global_content_proxy&.full_url || Setting[:http_proxy] end
register_rex_feature()
click to toggle source
# File lib/foreman_acd/engine.rb, line 66 def self.register_rex_feature return unless ForemanAcd.with_remote_execution? RemoteExecutionFeature.register( :run_acd_ansible_playbook, N_('Run playbook for ACD'), { :description => N_('Run an Ansible playbook to configure ACD application'), :provided_inputs => %w[application_name playbook_name playbook_path inventory_path] } ) end
start_acd_app_configurator(app_instance)
click to toggle source
# File lib/foreman_acd.rb, line 30 def start_acd_app_configurator(app_instance) task = ForemanTasks.delay(::Actions::ForemanAcd::RunConfigurator, { :start_at => Time.zone.now + RUN_CONFIGURATOR_DELAY }, app_instance) app_instance.update(:initial_configure_task_id => task.id) end
with_katello?()
click to toggle source
# File lib/foreman_acd/engine.rb, line 56 def self.with_katello? defined?(::Katello) end
with_remote_execution?()
click to toggle source
# File lib/foreman_acd/engine.rb, line 60 def self.with_remote_execution? RemoteExecutionFeature rescue StandardError false end