Module: Ridley::BootstrapBinding
- Included in:
- UnixTemplateBinding, WindowsTemplateBinding
- Defined in:
- lib/ridley/mixin/bootstrap_binding.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#bootstrap_proxy ⇒ Object
readonly
Returns the value of attribute bootstrap_proxy.
-
#chef_version ⇒ Object
readonly
Returns the value of attribute chef_version.
-
#default_options ⇒ Object
readonly
Returns the value of attribute default_options.
-
#encrypted_data_bag_secret ⇒ Object
readonly
Returns the value of attribute encrypted_data_bag_secret.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#node_name ⇒ Object
readonly
Returns the value of attribute node_name.
-
#run_list ⇒ Object
readonly
Returns the value of attribute run_list.
-
#server_url ⇒ Object
readonly
Returns the value of attribute server_url.
-
#template_file ⇒ Object
readonly
Returns the value of attribute template_file.
-
#validator_client ⇒ Object
readonly
Returns the value of attribute validator_client.
-
#validator_path ⇒ Object
readonly
Returns the value of attribute validator_path.
Class Method Summary collapse
Instance Method Summary collapse
- #first_boot ⇒ String
- #template ⇒ Erubis::Eruby
- #templates_path ⇒ Pathname
-
#validation_key ⇒ String
The validation key to create a new client for the node.
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
46 47 48 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 46 def attributes @attributes end |
#bootstrap_proxy ⇒ Object (readonly)
Returns the value of attribute bootstrap_proxy.
38 39 40 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 38 def bootstrap_proxy @bootstrap_proxy end |
#chef_version ⇒ Object (readonly)
Returns the value of attribute chef_version.
39 40 41 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 39 def chef_version @chef_version end |
#default_options ⇒ Object (readonly)
Returns the value of attribute default_options.
40 41 42 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 40 def end |
#encrypted_data_bag_secret ⇒ Object (readonly)
Returns the value of attribute encrypted_data_bag_secret.
42 43 44 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 42 def encrypted_data_bag_secret @encrypted_data_bag_secret end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
48 49 50 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 48 def environment @environment end |
#node_name ⇒ Object (readonly)
Returns the value of attribute node_name.
45 46 47 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 45 def node_name @node_name end |
#run_list ⇒ Object (readonly)
Returns the value of attribute run_list.
47 48 49 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 47 def run_list @run_list end |
#server_url ⇒ Object (readonly)
Returns the value of attribute server_url.
43 44 45 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 43 def server_url @server_url end |
#template_file ⇒ Object (readonly)
Returns the value of attribute template_file.
37 38 39 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 37 def template_file @template_file end |
#validator_client ⇒ Object (readonly)
Returns the value of attribute validator_client.
44 45 46 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 44 def validator_client @validator_client end |
#validator_path ⇒ Object (readonly)
Returns the value of attribute validator_path.
41 42 43 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 41 def validator_path @validator_path end |
Class Method Details
.included(base) ⇒ Object
32 33 34 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 32 def included(base) base.extend(ClassMethods) end |
Instance Method Details
#first_boot ⇒ String
56 57 58 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 56 def first_boot JSON.fast_generate(attributes.merge(run_list: run_list)) end |
#template ⇒ Erubis::Eruby
72 73 74 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 72 def template Erubis::Eruby.new(IO.read(template_file).chomp) end |
#templates_path ⇒ Pathname
51 52 53 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 51 def templates_path Ridley.root.join('bootstrappers') end |
#validation_key ⇒ String
The validation key to create a new client for the node
65 66 67 68 69 |
# File 'lib/ridley/mixin/bootstrap_binding.rb', line 65 def validation_key IO.read(File.(validator_path)).chomp rescue Errno::ENOENT raise Errors::ValidatorNotFound, "Error bootstrapping: Validator not found at '#{validator_path}'" end |