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.
-
#opts ⇒ Object
Returns the value of attribute opts.
-
#policy_group ⇒ Object
Returns the value of attribute policy_group.
-
#policy_name ⇒ Object
Returns the value of attribute policy_name.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
- #chef_config ⇒ Object
- #convergence_options ⇒ Object
-
#initialize ⇒ Context
constructor
A new instance of Context.
- #set_user_opts(hash) ⇒ Object
Constructor Details
#initialize ⇒ Context
Returns a new instance of Context.
57 58 59 60 |
# File 'lib/chef-dk/command/provision.rb', line 57 def initialize @extra_chef_config = "" @opts = nil end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
41 42 43 |
# File 'lib/chef-dk/command/provision.rb', line 41 def action @action end |
#enable_policyfile ⇒ Object
Returns the value of attribute enable_policyfile.
47 48 49 |
# File 'lib/chef-dk/command/provision.rb', line 47 def enable_policyfile @enable_policyfile end |
#extra_chef_config ⇒ Object
Returns the value of attribute extra_chef_config.
53 54 55 |
# File 'lib/chef-dk/command/provision.rb', line 53 def extra_chef_config @extra_chef_config end |
#node_name ⇒ Object
Returns the value of attribute node_name.
43 44 45 |
# File 'lib/chef-dk/command/provision.rb', line 43 def node_name @node_name end |
#opts ⇒ Object
Returns the value of attribute opts.
55 56 57 |
# File 'lib/chef-dk/command/provision.rb', line 55 def opts @opts end |
#policy_group ⇒ Object
Returns the value of attribute policy_group.
49 50 51 |
# File 'lib/chef-dk/command/provision.rb', line 49 def policy_group @policy_group end |
#policy_name ⇒ Object
Returns the value of attribute policy_name.
51 52 53 |
# File 'lib/chef-dk/command/provision.rb', line 51 def policy_name @policy_name end |
#target ⇒ Object
Returns the value of attribute target.
45 46 47 |
# File 'lib/chef-dk/command/provision.rb', line 45 def target @target end |
Instance Method Details
#chef_config ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/chef-dk/command/provision.rb', line 73 def chef_config config = "# SSL Settings:\nssl_verify_mode \#{Chef::Config.ssl_verify_mode.inspect}\n\n" if enable_policyfile policyfile_config = "# Policyfile Settings:\nuse_policyfile true\npolicy_document_native_api true\n\npolicy_group \"\#{policy_group}\"\npolicy_name \"\#{policy_name}\"\n\n" config << policyfile_config end config << extra_chef_config.to_s config end |
#convergence_options ⇒ Object
66 67 68 69 70 71 |
# File 'lib/chef-dk/command/provision.rb', line 66 def { chef_server: Chef::Config.chef_server_url, chef_config: chef_config, } end |
#set_user_opts(hash) ⇒ Object
62 63 64 |
# File 'lib/chef-dk/command/provision.rb', line 62 def set_user_opts(hash) @opts = OpenStruct.new(hash) end |