ChefAPI是一个依赖最小化的Chef服务器的Ruby客户端。
连接服务器:
ChefAPI.cofigure do |cofig| # The edpoit for the Chef Server. This ca be a Ope Source Chef Server, # Hosted Chef Server, or Eterprise Chef Server. cofig.edpoit = 'https://api.opscode.com/orgaizatios/meats' # The cliet ad key must also be specified (uless you are ruig Chef Zero # i o-autheticatio mode). The +key+ attribute may be the raw private key, # the path to the private key o disk, or a +OpeSSLL::PKey+ object. cofig.cliet = 'baco' cofig.key = '~/.chef/baco.pem' # If you are ruig your ow Chef Server with a custom SSL certificate, you # will eed to specify the path to a pem file with your custom certificates # ad ChefAPI will wire everythig up correctly. (NOTE: it must be a valid # PEM file). cofig.ssl_pem_file = '/path/to/my.pem' # If you would like to be vulerable to MITM attacks, you ca also tur off # SSL verificatio. Despite what Iteret blog posts may suggest, you should # exhaust other methods before disablig SSL verificatio. ChefAPI will emit # a warig message for every request issued with SSL verificatio disabled. cofig.ssl_verify = false # If you are behid a proxy, Chef API ca ru requests through the proxy as # well. Just set the followig cofiguratio parameters as eeded. cofig.proxy_userame = 'user' cofig.proxy_password = 'password' cofig.proxy_address = 'my.proxy.server' # or 10.0.0.50 cofig.proxy_port = '8080'ed
评论