Class: Setting::RemoteExecution

Inherits:
Setting
  • Object
show all
Defined in:
app/models/setting/remote_execution.rb

Class Method Summary collapse

Class Method Details

.default_settingsObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'app/models/setting/remote_execution.rb', line 5

def self.default_settings
  [
    self.set('remote_execution_fallback_proxy',
      N_('Search the host for any proxy with Remote Execution, useful when the host has no subnet or the subnet does not have an execution proxy'),
      false,
      N_('Fallback to Any Proxy')),
    self.set('remote_execution_global_proxy',
      N_('Search for remote execution proxy outside of the proxies assigned to the host. ' +
      "The search will be limited to the host's organization and location."),
      true,
      N_('Enable Global Proxy')),
    self.set('remote_execution_ssh_user',
      N_('Default user to use for SSH.  You may override per host by setting a parameter called remote_execution_ssh_user.'),
      'root',
      N_('SSH User')),
    self.set('remote_execution_effective_user',
      N_('Default user to use for executing the script. If the user differs from the SSH user, su or sudo is used to switch the user.'),
      'root',
      N_('Effective User')),
    self.set('remote_execution_effective_user_method',
      N_('What command should be used to switch to the effective user. One of %s') % SSHExecutionProvider::EFFECTIVE_USER_METHODS.inspect,
      'sudo',
      N_('Effective User Method'),
      nil,
      { :collection => proc { Hash[SSHExecutionProvider::EFFECTIVE_USER_METHODS.map { |method| [method, method] }] } }),
    self.set('remote_execution_sudo_password', N_("Sudo password"), '', N_("Sudo password"), nil, {:encrypted => true}),
    self.set('remote_execution_sync_templates',
      N_('Whether we should sync templates from disk when running db:seed.'),
      true,
      N_('Sync Job Templates')),
    self.set('remote_execution_ssh_port',
      N_('Port to use for SSH communication. Default port 22. You may override per host by setting a parameter called remote_execution_ssh_port.'),
      '22',
      N_('SSH Port')),
    self.set('remote_execution_connect_by_ip',
      N_('Should the ip addresses on host interfaces be preferred over the fqdn? '\
      'It is useful when DNS not resolving the fqdns properly. You may override this per host by setting a parameter called remote_execution_connect_by_ip. '\
      'This setting only applies to IPv4. When the host has only an IPv6 address on the interface used for remote execution, hostname will be used even if this setting is set to true.'),
      false,
      N_('Connect by IP')),
    self.set('remote_execution_ssh_password',
      N_('Default password to use for SSH. You may override per host by setting a parameter called remote_execution_ssh_password'),
      nil,
      N_('Default SSH password'),
      nil,
      { :encrypted => true }),
    self.set('remote_execution_ssh_key_passphrase',
      N_('Default key passphrase to use for SSH. You may override per host by setting a parameter called remote_execution_ssh_key_passphrase'),
      nil,
      N_('Default SSH key passphrase'),
      nil,
      { :encrypted => true }),
    self.set('remote_execution_workers_pool_size',
      N_('Amount of workers in the pool to handle the execution of the remote execution jobs. Restart of the dynflowd/foreman-tasks service is required.'),
      5,
      N_('Workers pool size')),
    self.set('remote_execution_cleanup_working_dirs',
      N_('When enabled, working directories will be removed after task completion. You may override this per host by setting a parameter called remote_execution_cleanup_working_dirs.'),
      true,
      N_('Cleanup working directories')),
    self.set('remote_execution_cockpit_url',
      N_('Where to find the Cockpit instance for the Web Console button.  By default, no button is shown.'),
      nil,
      N_('Cockpit URL'),
      nil),
    self.set('remote_execution_form_job_template',
      N_('Choose a job template that is pre-selected in job invocation form'),
      'Run Command - SSH Default',
      _('Form Job Template'),
      nil,
      { :collection => proc { Hash[JobTemplate.unscoped.map { |template| [template.name, template.name] }] } }),
  ]
end