Class: ChefDK::ProvisioningData::Context
- Inherits:
-
Object
- Object
- ChefDK::ProvisioningData::Context
- Defined in:
- lib/chef-dk/command/provision.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#enable_policyfile ⇒ Object
Returns the value of attribute enable_policyfile.
-
#extra_chef_config ⇒ Object
Returns the value of attribute extra_chef_config.
-
#node_name ⇒ Object
Returns the value of attribute node_name.
-
#policy_group ⇒ Object
Returns the value of attribute policy_group.
-
#policy_name ⇒ Object
Returns the value of attribute policy_name.
Instance Method Summary collapse
- #chef_config ⇒ Object
- #convergence_options ⇒ Object
-
#initialize ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize ⇒ Context
Returns a new instance of Context.
51 52 53 |
# File 'lib/chef-dk/command/provision.rb', line 51 def initialize @extra_chef_config = "" end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
39 40 41 |
# File 'lib/chef-dk/command/provision.rb', line 39 def action @action end |
#enable_policyfile ⇒ Object
Returns the value of attribute enable_policyfile.
43 44 45 |
# File 'lib/chef-dk/command/provision.rb', line 43 def enable_policyfile @enable_policyfile end |
#extra_chef_config ⇒ Object
Returns the value of attribute extra_chef_config.
49 50 51 |
# File 'lib/chef-dk/command/provision.rb', line 49 def extra_chef_config @extra_chef_config end |
#node_name ⇒ Object
Returns the value of attribute node_name.
41 42 43 |
# File 'lib/chef-dk/command/provision.rb', line 41 def node_name @node_name end |
#policy_group ⇒ Object
Returns the value of attribute policy_group.
45 46 47 |
# File 'lib/chef-dk/command/provision.rb', line 45 def policy_group @policy_group end |
#policy_name ⇒ Object
Returns the value of attribute policy_name.
47 48 49 |
# File 'lib/chef-dk/command/provision.rb', line 47 def policy_name @policy_name end |
Instance Method Details
#chef_config ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/chef-dk/command/provision.rb', line 62 def chef_config config=<<-CONFIG # SSL Settings: ssl_verify_mode #{Chef::Config.ssl_verify_mode.inspect} CONFIG if enable_policyfile policyfile_config=<<-CONFIG # Policyfile Settings: use_policyfile true policy_document_native_api true policy_group "#{policy_group}" policy_name "#{policy_name}" CONFIG config << policyfile_config end config << extra_chef_config.to_s config end |
#convergence_options ⇒ Object
55 56 57 58 59 60 |
# File 'lib/chef-dk/command/provision.rb', line 55 def { chef_server: Chef::Config.chef_server_url, chef_config: chef_config } end |