Module: HammerCLIForeman::Hosts::CommonUpdateHelp

Included in:
HammerCLIForeman::Host::CreateCommand, HammerCLIForeman::Host::UpdateCommand
Defined in:
lib/hammer_cli_foreman/hosts/common_update_help.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
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
# File 'lib/hammer_cli_foreman/hosts/common_update_help.rb', line 4

def self.included(base)
  base.extend_help do |h|
    h.section _('Available keys for %{option}') % { :option => '--interface' } do |h|
      h.list([
        'mac',
        'ip',
        ['type',      _('Possible values: %s') % 'interface, bmc, bond, bridge'],
        'name',
        'subnet_id',
        'domain_id',
        'identifier',
        ['managed',   'true/false'],
        ['primary',   _('%{value}, each managed hosts needs to have one primary interface.') % {:value => 'true/false'}],
        ['provision', 'true/false'],
        ['virtual',   'true/false']
      ])
      h.section _('For %{condition}') % { :condition => 'virtual=true' } do |h|
        h.list([
          ['tag',         _('VLAN tag, this attribute has precedence over the subnet VLAN ID. Only for virtual interfaces.')],
          ['attached_to', _('Identifier of the interface to which this interface belongs, e.g. eth1.')]
        ])
      end
      h.section _('For %{condition}') % { :condition => 'type=bond' } do |h|
        h.list([
          ['mode',             _('Possible values: %s') % 'balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb, balance-alb'],
          ['attached_devices', _('Identifiers of slave interfaces, e.g. [eth1,eth2]')],
          'bond_options'
        ])
      end
      h.section _('For %{condition}') % { :condition => 'type=bmc' } do |h|
        h.list([
          ['provider', _('always IPMI')],
          'username',
          'password'
        ])
      end
    end

    h.section _('Provider specific options') do |h|
      HammerCLIForeman::Host.cr_help_extensions.each do |name, help|
        h.section name do |h|
          help.call(h)
        end
      end
    end
  end
end