Class: MintPress::Infrastructure::ChefBootstrapper

Inherits:
Bootstrapper
  • Object
show all
Defined in:
src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb

Overview

This resource will bootstrap a newly built machine using chef - it is usually hooked to the host class and utilized with the host builder providers

Direct Known Subclasses

UsingChefBootstrapper

Properties (Read/Write)

  • #chef_config_profile ⇒ String
    Which chef configuration profile to use

    Property Attributes
    
    
    13
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 13
    
    property :chef_config_profile, type: String
  • #run_list ⇒ Array of ⇒ String
    Chef run list to apply to created hosts

    Property Attributes
    
    
    16
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 16
    
    property :run_list, type: String, array: true
  • #pre_run_list ⇒ Array of ⇒ String
    Chef run list to run _once_ on newly created hosts

    Property Attributes
    
    
    18
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 18
    
    property :pre_run_list, type: String, array: true
  • #node_name ⇒ String (Default Value: Proc.new { host.name })
    Name of the chef node - defaults to the hostname if unspecified

    Property Attributes
    • defaultProc.new { host.name }
    
    
    20
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 20
    
    property :node_name, type: String, default: Proc.new { host.name }
  • #prefer_cinc ⇒ [TrueClass, FalseClass] (Default Value: true)

    Property Attributes
    • defaulttrue
    
    
    22
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 22
    
    property :prefer_cinc, type: [TrueClass, FalseClass], default: true
  • #knife_config_file ⇒ String
    Knife configuration file to use

    Property Attributes
    
    
    25
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 25
    
    property :knife_config_file, type: String
  • #chef_server_url ⇒ String (Default Value: Proc.new { get_chef_config(:chef_server_url) })
    External chef server to talk to - note

    Property Attributes
    • defaultProc.new { get_chef_config(:chef_server_url) }
    • cached_proctrue
    
    
    28
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 28
    
    property :chef_server_url, type: String, default: Proc.new { get_chef_config(:chef_server_url) }, cached_proc: true
  • #chef_client_name ⇒ String (Default Value: Proc.new { get_chef_config(:node_name) })
    Node name for configless setup

    Property Attributes
    • defaultProc.new { get_chef_config(:node_name) }
    • cached_proctrue
    
    
    30
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 30
    
    property :chef_client_name, type: String, default: Proc.new { get_chef_config(:node_name) }, cached_proc: true
  • #chef_client_key ⇒ String (Default Value: Proc.new { get_chef_config(:client_key) })
    Client key for configless setup

    Property Attributes
    • defaultProc.new { get_chef_config(:client_key) }
    • cached_proctrue
    
    
    32
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 32
    
    property :chef_client_key, type: String, default: Proc.new { get_chef_config(:client_key) }, cached_proc: true
  • #chef_environment ⇒ String
    Chef environment for the node

    Property Attributes
    • requiredtrue
    
    
    34
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 34
    
    property :chef_environment, type: String, required: true
  • #chef_version ⇒ String (Default Value: Proc.new { if self.prefer_cinc "17" else "14" end })
    Chef version to install

    Property Attributes
    • defaultProc.new { if self.prefer_cinc "17" else "14" end }
    
    
    36
    37
    38
    39
    40
    41
    42
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 36
    
    property :chef_version, type: String, default: Proc.new {
      if self.prefer_cinc
        "17"
      else
        "14"
      end
    }
  • #chef_log_location ⇒ [Symbol, String] (Default Value: :syslog)
    Node attributes to apply to the node object (merged with Chef::Mixin::DeepMerge.hash_only_merge!(n.normal, node_attributes) for conflict handling (ie node_attributes taking precedence)) Chef client log_location, STDOUT/:STDOUT, STDERR/:STDERR, win_evt/:win_evt, syslog/:syslog are handled specially to match the chef client config.

    Property Attributes
    • default:syslog
    
    
    45
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 45
    
    property :chef_log_location, type: [Symbol, String], default: :syslog
  • #chef_log_level ⇒ [Symbol, String] (Default Value: :auto)
    Chef client log_level

    Property Attributes
    • default:auto
    
    
    47
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 47
    
    property :chef_log_level, type: [Symbol, String], default: :auto
  • #node_attributes ⇒ Hash (Default Value: {})

    Property Attributes
    • default{}
    
    
    49
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 49
    
    property :node_attributes, type: Hash, default: {}
  • #policy_name ⇒ String
    Policy

    Property Attributes
    
    
    51
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 51
    
    property :policy_name, type: String
  • #policy_group ⇒ String
    Policy

    Property Attributes
    
    
    53
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 53
    
    property :policy_group, type: String
  • #ignore_invalid_omnibus_ssl ⇒ [TrueClass, FalseClass] (Default Value: false)
    Should we ignore an invalid cert from omnibus? This is required if you are using organization-signed certificates on your on-prem mintpress server, but is not recommended on the general internet. It is disabled by default - you obviously should enable this if you are using self signed certificates

    Property Attributes
    • defaultfalse
    
    
    57
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 57
    
    property :ignore_invalid_omnibus_ssl, type: [TrueClass, FalseClass], default: false
  • #omnibus_url ⇒ String (Default Value: Proc.new { if self.prefer_cinc and self.chef_version.to_i >= 17 'https://omnitruck.cinc.sh/install.sh' else 'https://omnitruck.chef.io/install.sh' end })
    The URL for the chef client installer - defaults to the omnibus URL of https://omnitruck.chef.io/install.sh

    Property Attributes
    • defaultProc.new { if self.prefer_cinc and self.chef_version.to_i >= 17 'https://omnitruck.cinc.sh/install.sh' else 'https://omnitruck.chef.io/install.sh' end }
    
    
    60
    61
    62
    63
    64
    65
    66
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 60
    
    property :omnibus_url, type: String, default: Proc.new {
      if self.prefer_cinc and self.chef_version.to_i >= 17
        'https://omnitruck.cinc.sh/install.sh'
      else
        'https://omnitruck.chef.io/install.sh'
      end
    }
  • #chef_client_installer ⇒ String
    Pointer to a chef server rpm to install

    Property Attributes
    
    
    69
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper/chef-bootstrapper.rb', line 69
    
    property :chef_client_installer, type: String
  • #host ⇒ MintPress::Infrastructure::Host
    Our parent host. This is usually set automatically when using a BootstrapProvider

    Property Attributes
    • canonicaltrue
    
    
    31
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/bootstrapper.rb', line 31
    
    property :host, type: MintPress::Infrastructure::Host, canonical: true

Properties (Read Only)

Constant Summary collapse

CHEF_LOG_LOCATION_MAPPING =
{
  :syslog => ':syslog',
  'syslog' => ':syslog',
  :win_evt => ':win_evt',
  'win_evt' => ':win_evt',
  :STDOUT => 'STDOUT',
  'STDOUT' => 'STDOUT',
  :STDERR => 'STDERR',
  'STDERR' => 'STDERR'
}.freeze

Constants included from MintLogger

MintLogger::DEBUG, MintLogger::ERROR, MintLogger::FATAL, MintLogger::INFO, MintLogger::UNKNOWN, MintLogger::VERBOSE, MintLogger::WARN

Instance Attribute Summary

Attributes included from Mixins::Properties

#autopush_set_cache, #dynamic_create, #harvest_on_access, #harvest_undefined_only, #harvested, #tree_root

Instance Method Summary collapse

Methods inherited from Bootstrapper

#background_bootstrap, #background_force_bootstrap, #background_unbootstrap

Methods included from Mixins::Backgroundable

#backgroundable, #wait_for_background_tasks

Methods included from Mixins::GenericProvider

included, #register_provider, #register_sub_provider

Methods included from MintLogger::Utils::Common

#boolean_val, #has_value?, #no_value?, #nvl, #path_as_symbol, #ruby_level_to_send

Methods included from Mixins::Properties

#[], #[]=, #add_validate_report_result, #armour_set_property, #array_contains?, #array_is_a?, #check_autopush, #check_stack_overflow, #clone_property_object, #cloner_handle_single_property, #coerce_single, #contains_as_string?, #display_validate_report_result, #double_initialize?, #dump_to_hash, #find_parent, #find_parent_by_identity, #generate_accessor_functions, #get_canonical_renamed, #get_from_opts, #get_my_name, #get_property, #get_property_item, #has?, included, #initialize_validate_report, #inspect, #is_cloned_object?, #is_mintpress_object?, #is_probably_canonical?, #is_set?, #local_debug, #local_info, #local_verbose, #mintpress_property_definitions, #place_object_by_identity, #process_properties, #prop_set?, #property, #property_definitions, #property_details, #property_is_simple_object?, #push_root!, #require_property, #require_update, #retrieve_docstring, #sanitize, #set_map_dirty, #set_property, #set_property_item, #show_short_array, #strip_defaults!, #synchronize, #uncloned_property_definitions, #update_map, #validate, #validate_generic, #validate_properties, #validate_property, #validate_required, #version_allowed?, #weakref

Constructor Details

#initialize(opts = {}) ⇒ ChefBootstrapper

Returns a new instance of ChefBootstrapper.

Instance Method Details

#bootstrapObject

#force_bootstrapObject

#get_chef_config(item) ⇒ Object

#unbootstrapObject

#version_match?Boolean

Returns:

  • (Boolean)