Class: ForemanOpenscap::ClientConfig::Base

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

Direct Known Subclasses

Ansible, Manual, Puppet

Instance Method Summary collapse

Instance Method Details

#all_collection_methodObject



36
37
38
# File 'app/services/foreman_openscap/client_config/base.rb', line 36

def all_collection_method
  "all_#{collection_method}".to_sym
end

#available?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


24
25
26
# File 'app/services/foreman_openscap/client_config/base.rb', line 24

def available?
  raise NotImplementedError
end

#collection_methodObject



32
33
34
# File 'app/services/foreman_openscap/client_config/base.rb', line 32

def collection_method
  constants.config_item_class_name&.pluralize&.underscore
end

#constantsObject

Raises:

  • (NotImplementedError)


28
29
30
# File 'app/services/foreman_openscap/client_config/base.rb', line 28

def constants
  raise NotImplementedError
end

#ds_policies_param_default_valueObject



47
48
49
# File 'app/services/foreman_openscap/client_config/base.rb', line 47

def ds_policies_param_default_value
  '<%= @host.policies_enc %>'
end

#find_config_item(scope = config_item_class_name.constantize) ⇒ Object



40
41
42
43
44
45
# File 'app/services/foreman_openscap/client_config/base.rb', line 40

def find_config_item(scope = config_item_class_name.constantize)
  return unless scope
  return scope.find_by :name => config_item_name if scope.respond_to?(:find_by)
  # all_puppetclasses, all_ansible_roles methods return Array, not ActiveRecord::Relation
  scope.find { |item| item.name == config_item_name }
end

#inline_helpObject



12
13
14
15
16
17
18
# File 'app/services/foreman_openscap/client_config/base.rb', line 12

def inline_help
  {
    :text => '',
    :replace_text => '',
    :route_helper_method => nil
  }
end

#managed_overrides?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'app/services/foreman_openscap/client_config/base.rb', line 20

def managed_overrides?
  true
end

#typeObject

Raises:

  • (NotImplementedError)


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

def type
  raise NotImplementedError
end