Module: ChefProvisioner::Config
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#client_key ⇒ Object
readonly
Returns the value of attribute client_key.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
10 11 12 |
# File 'lib/chef-provisioner/config.rb', line 10 def client @client end |
#client_key ⇒ Object (readonly)
Returns the value of attribute client_key.
10 11 12 |
# File 'lib/chef-provisioner/config.rb', line 10 def client_key @client_key end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
10 11 12 |
# File 'lib/chef-provisioner/config.rb', line 10 def server @server end |
Instance Method Details
#setup(server: nil, client_key: nil, client_key_path: nil, client: nil, listen: nil) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/chef-provisioner/config.rb', line 12 def setup(server: nil, client_key: nil, client_key_path: nil, client: nil, listen: nil) @server = server || "http://#{listen || my_ip}:#{get_free_port}" @client_key = client_key || client_key_path || setup_chef_client_file @client = client || 'testing-client' ChefProvisioner::Chef.configure(endpoint: @server, key_path: @client_key, client: @client) end |