jonlives / knife-preflight Goto Github PK
View Code? Open in Web Editor NEWKnife plugin for checking what your cookbook changes will affect
Knife plugin for checking what your cookbook changes will affect
when I perform a preflight against my nodes, the preflight doesn't find the constraints (or even where the recipe is applied)
example
$ knife preflight network
server.blah.com - in environment 'hello', no version constraint for 'network' cookbook
$ knife node show server.blah.com
Node Name: server.blah.com
Environment: hello
FQDN:
IP: <some IP>
Run List: role[base]
Roles: base
Recipes: network, network::default...
$ knife role show base
chef_type: role
default_attributes:
description: blah blah blah
env_run_lists:
json_class: Chef::Role
name: base
override_attributes:
run_list:
recipe[[email protected]]
Chef run on the server:
# chef-client
Starting Chef Client, version 11.14.6
resolving cookbooks for run list: [ "[email protected]", ...]
...and should probably be fixed.
cookbook and cookbook::default should return the same results. They are effectively the same but its hard to know which a role uses
Chef.io server produces 500 error.
$ knife preflight sdldap
Searching for nodes containing sdldap OR sdldap::default in their expanded run_list or added via include_recipe...
ERROR: Server returned error 500 for https://api.chef.io/organizations/myorg/search/node?q=recipes%253Asdldap%2520OR%2520recipes%253Asdldap%255C%253A%255C%253Adefault%2520OR%2520last_seen_recipes%253Asdldap%2520OR%2520last_seen_recipes%253Asdldap%255C%253A%255C%253Adefault&start=0&rows=0, retrying 1/5 in 4s
Extended output:
$ knife preflight -VV sdldap
INFO: Using configuration from /Users/timurb/.chef/config.rb
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::JSONOutput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_request
DEBUG: Signing the request as tbatyrshin
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::APIVersions#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_request
DEBUG: Initiating GET to https://api.chef.io/organizations/myorg/search/environment?q=NOT%20cookbook_versions:sdldap&start=0
DEBUG: ---- HTTP Request Header Data: ----
DEBUG: Accept: application/json
DEBUG: Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
DEBUG: X-Ops-Server-API-Version: 1
DEBUG: X-OPS-SIGN: algorithm=sha1;version=1.1;
DEBUG: X-OPS-USERID: tbatyrshin
DEBUG: X-OPS-TIMESTAMP: 2017-07-27T10:18:16Z
DEBUG: X-OPS-CONTENT-HASH: 2jmj7l5rSw0yVb/vlWAYkK/YBwk=
DEBUG: X-OPS-AUTHORIZATION-1: L+6DjK1TaFr7H2R0htZR8CUfQAeo4s8t7asBjwiPXKmB5
.............................
DEBUG: HOST: api.chef.io:443
DEBUG: X-REMOTE-REQUEST-ID: d79eb9dc-8ded-4238-b183-8ed0e11ed73b
DEBUG: ---- End HTTP Request Header Data ----
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: content-encoding: gzip
DEBUG: content-type: application/json
DEBUG: date: Thu, 27 Jul 2017 10:18:17 GMT
DEBUG: server: openresty/1.11.2.1
DEBUG: x-ops-api-info: flavor=cs;version=12.0.0;oc_erchef=12.15.8+20170629175019
DEBUG: x-ops-server-api-version: {"min_version":"0","max_version":"1","request_version":"1","response_version":"1"}
DEBUG: transfer-encoding: chunked
DEBUG: connection: Close
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
DEBUG: HTTP server did not include a Content-Length header in response, cannot identify truncated downloads.
DEBUG: Chef::HTTP calling Chef::HTTP::APIVersions#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response
DEBUG: Decompressing gzip response
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONOutput#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response
Searching for nodes containing sdldap OR sdldap::default in their expanded run_list or added via include_recipe...
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::JSONOutput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_request
DEBUG: Signing the request as tbatyrshin
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::APIVersions#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_request
DEBUG: Initiating POST to https://api.chef.io/organizations/myorg/search/node?q=recipes%253Asdldap%2520OR%2520recipes%253Asdldap%255C%253A%255C%253Adefault%2520OR%2520last_seen_recipes%253Asdldap%2520OR%2520last_seen_recipes%253Asdldap%255C%253A%255C%253Adefault&start=0&rows=0
DEBUG: ---- HTTP Request Header Data: ----
DEBUG: Content-Type: application/json
DEBUG: Accept: application/json
DEBUG: Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
DEBUG: X-Ops-Server-API-Version: 1
DEBUG: X-OPS-SIGN: algorithm=sha1;version=1.1;
DEBUG: X-OPS-USERID: tbatyrshin
DEBUG: X-OPS-TIMESTAMP: 2017-07-27T10:18:21Z
DEBUG: X-OPS-CONTENT-HASH: 48u6iIP+dGxuNXg8lAS0vAx+6es=
DEBUG: X-OPS-AUTHORIZATION-1: 1pJFslQXlbuk06o5fwBKvSMCm5jr1jBa7Zkcmk/dMCwL
...........................................................
DEBUG: HOST: api.chef.io:443
DEBUG: X-REMOTE-REQUEST-ID: d79eb9dc-8ded-4238-b183-8ed0e11ed73b
DEBUG: Content-Length: 4
DEBUG: ---- End HTTP Request Header Data ----
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 500 Internal Server Error
DEBUG: content-type: application/json
DEBUG: date: Thu, 27 Jul 2017 10:18:23 GMT
DEBUG: server: openresty/1.11.2.1
DEBUG: x-ops-api-info: flavor=cs;version=12.0.0;oc_erchef=12.15.8+20170629175019
DEBUG: x-ops-server-api-version: {"min_version":"0","max_version":"1","request_version":"1","response_version":"1"}
DEBUG: content-length: 36
DEBUG: connection: Close
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: ---- HTTP Response Body ----
DEBUG: {"error":["internal service error"]}
DEBUG: ---- End HTTP Response Body -----
DEBUG: ---- HTTP Request Body ----
DEBUG: 1000
DEBUG: ---- End HTTP Request Body ----
ERROR: Server returned error 500 for https://api.chef.io/organizations/myorg/search/node?q=recipes%253Asdldap%2520OR%2520recipes%253Asdldap%255C%253A%255C%253Adefault%2520OR%2520last_seen_recipes%253Asdldap%2520OR%2520last_seen_recipes%253Asdldap%255C%253A%255C%253Adefault&start=0&rows=0, retrying 1/5 in 4s
I'm running ChefDK on MacOS:
$ chef --version
Chef Development Kit Version: 2.0.28
chef-client version: 13.2.20
delivery version: master (17c1b0fed9be4c70f69091a6d21a4cbf0df60a23)
berks version: 6.2.0
kitchen version: 1.16.0
inspec version: 1.31.1
Exception: Chef::Exceptions::ImmutableAttributeModification: Node attributes are read-only when you do not specify which precedence level to set. To set an attribute use code like `node.default["key"] = "value"'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.