Class: ForemanOpenscap::ClientConfig::Puppet

Inherits:
Base
  • Object
show all
Defined in:
app/services/foreman_openscap/client_config/puppet.rb

Instance Method Summary collapse

Methods inherited from Base

#all_collection_method, #ds_policies_param_default_value, #find_config_item, #managed_overrides?

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/services/foreman_openscap/client_config/puppet.rb', line 12

def available?
  Foreman::Plugin.installed?("foreman_puppet")
end

#collection_methodObject



27
28
29
# File 'app/services/foreman_openscap/client_config/puppet.rb', line 27

def collection_method
  :puppetclasses
end

#constantsObject



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/services/foreman_openscap/client_config/puppet.rb', line 31

def constants
  OpenStruct.new(
    :server_param => 'server',
    :port_param => 'port',
    :policies_param => 'policies',
    :puppetclass_name => 'foreman_scap_client',
    :config_item_class_name => 'ForemanPuppet::Puppetclass',
    :override_method_name => 'class_params',
    :msg_name => _('Puppet class'),
    :lookup_key_plural_name => _('Smart Class Parameters'),
    :policies_param_default_value => ds_policies_param_default_value
  )
end

#inline_helpObject



16
17
18
19
20
21
22
23
24
25
# File 'app/services/foreman_openscap/client_config/puppet.rb', line 16

def inline_help
  t1 = _("Requires %s Puppet class. This will assign the class to the hosts or selected hostgroups.") % puppetclass_name
  t2 = _("Every puppet run ensures the foreman_scap_client is configured according to the policy.")

  {
    :text => "#{t1}<br>#{t2}",
    :replace_text => 'Puppet class',
    :route_helper_method => :hash_for_puppetclasses_path
  }
end

#typeObject



8
9
10
# File 'app/services/foreman_openscap/client_config/puppet.rb', line 8

def type
  :puppet
end