-
Notifications
You must be signed in to change notification settings - Fork 22
Configuration
patcon edited this page Apr 11, 2012
·
21 revisions
Spice has four configuration variables:
Spice.server_url # default: http://localhost:4000
Spice.chef_version # default: 0.10.8. Should be set to the version you have
Spice.client_name # default: nil. Must be set to a valid admin Chef client
Spice.key_file # default: nil. Must be set to a file path
To connect to a Chef server at https://chef.example.com:5000 with the "admin" API client, throw this somewhere your app can initialize:
Spice.server_url = "http://chef.example.com:5000"
Spice.client_name = "admin"
Spice.key_file = "/path/to/keyfile.pem"
Say you had a Chef server v0.10.8 running locally on port 4000 over HTTP, you only need to set your client_name
and key_file
path:
Spice.client_name = "admin"
Spice.key_file = "/path/to/keyfile.pem"
You can also use the Spice.setup block if you prefer this style:
Spice.setup do |s|
s.server_url = "http://chef.example.com:4000"
s.client_name = "admin"
s.key_file = "/path/to/keyfile.pem"
s.chef_version = "0.9.18"
end
If you want to reset your config to their default values:
Spice.reset