Class: Entitlement::NodeGroupEntry
- Inherits:
-
NumberedEntry
- Object
- Entry
- NumberedEntry
- Entitlement::NodeGroupEntry
- Defined in:
- lib/entitlement/node_group_entry.rb
Overview
This class allows you to specify the number of nodes to use the module on.
Instance Attribute Summary
Attributes inherited from Entry
Instance Method Summary collapse
-
#initialize(modules, from, to, node_group, filename_string, number, server = nil, license_id = 'none', warn_number = nil, &proc) ⇒ NodeGroupEntry
constructor
rubocop: disable Metrics/ParameterLists.
- #inspect ⇒ Object
-
#valid?(module_name, _resources = nil) ⇒ Boolean
rubocop: enable Metrics/ParameterLists.
Methods inherited from NumberedEntry
#invalid_puppetserver?, puppet_server, #puppetserver_in_hosts_file?, #registered_licenses, #registered_modules, #valid_node?
Methods included from EasyType::Helpers
#camelize, #convert_csv_data_to_hash, #get_puppet_file, included
Methods inherited from Entry
#days_left, #expiring?, #notify_if_expiring, #purgable?
Constructor Details
#initialize(modules, from, to, node_group, filename_string, number, server = nil, license_id = 'none', warn_number = nil, &proc) ⇒ NodeGroupEntry
rubocop: disable Metrics/ParameterLists
19 20 21 22 |
# File 'lib/entitlement/node_group_entry.rb', line 19 def initialize(modules, from, to, node_group, filename_string, number, server = nil, license_id = 'none', warn_number = nil, &proc) super( modules, from, to, filename_string, number, server, license_id, warn_number, &proc) @node_group = node_group end |
Instance Method Details
#inspect ⇒ Object
35 36 37 |
# File 'lib/entitlement/node_group_entry.rb', line 35 def inspect super end |
#valid?(module_name, _resources = nil) ⇒ Boolean
rubocop: enable Metrics/ParameterLists
25 26 27 28 29 30 31 32 33 |
# File 'lib/entitlement/node_group_entry.rb', line 25 def valid?(module_name, _resources = nil) begin @module_name = module_name.split('#').first rescue @module_name = module_name end Puppet.debug "Found a node group entitlement with id #{@license_id} allowing usage on #{@number} nodes,served from #{@registered_server}...." super(module_name) ? valid_node?(current_node) : false end |