Class: ForemanAnsible::AnsibleProvider

Inherits:
RemoteExecutionProvider
  • Object
show all
Defined in:
app/models/foreman_ansible/ansible_provider.rb

Overview

Provider for RemoteExecution that allows to run Ansible playbooks. Read the source of other RemoteExecution providers for more.

Class Method Summary collapse

Class Method Details

.humanized_nameObject



17
18
19
# File 'app/models/foreman_ansible/ansible_provider.rb', line 17

def humanized_name
  'Ansible'
end

.proxy_command_options(template_invocation, host) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
# File 'app/models/foreman_ansible/ansible_provider.rb', line 21

def proxy_command_options(template_invocation, host)
  super(template_invocation, host).merge(
    'ansible_inventory' => ::ForemanAnsible::InventoryCreator.new(
      [host], template_invocation
    ).to_hash.to_json,
    :remote_execution_command => ansible_command?(
      template_invocation.template
    ),
    :name => host.name
  )
end

.proxy_operation_nameObject



37
38
39
# File 'app/models/foreman_ansible/ansible_provider.rb', line 37

def proxy_operation_name
  Setting::Ansible[:ansible_implementation]
end

.ssh_key_passphrase(host) ⇒ Object



13
14
15
# File 'app/models/foreman_ansible/ansible_provider.rb', line 13

def ssh_key_passphrase(host)
  host_setting(host, :remote_execution_ssh_key_passphrase)
end

.ssh_password(host) ⇒ Object



9
10
11
# File 'app/models/foreman_ansible/ansible_provider.rb', line 9

def ssh_password(host)
  host_setting(host, :remote_execution_ssh_password)
end

.supports_effective_user?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'app/models/foreman_ansible/ansible_provider.rb', line 33

def supports_effective_user?
  true
end