Questions tagged [knife]

Knife is a command line tool used to interface with Chef.

Knife is a command-line tool that provides an interface between a local chef-repo and the server. It helps the administrator to manages

  • Nodes
  • Cookbooks and recipes
  • Roles
  • Stores of JSON data (data bags), including encrypted data
  • Environments
  • Cloud resources, including provisioning
  • The installation of the chef-client on management workstations
  • Searching of indexed data on the Chef server

The knife quick references can be found in this image.

85 questions
3
votes
1 answer

Knife command to check last node check-ins?

Is there a knife incantation that allows me to check the Last Check-In time of given (or all) nodes in my environment. (As opposed to the http:///status page in Open-Source Chef.)
gWaldo
  • 11,957
  • 8
  • 42
  • 69
2
votes
1 answer

Chef Knife command - PowerShell "query session" failing with return code 1, although command is executed successfully

I am facing a peculiar problem in executing chef knife commands for PowerShell remotely. Command is executed successfully, however the return code is 1 with an error. > %CPath% && knife winrm '%IP_Val%' --winrm-shell Powershell 'query session' -x…
goe
  • 141
  • 4
2
votes
0 answers

How to specify chef-client settings on bootstrap?

I'm trying to bootstrap nodes via knife. Executing: knife bootstrap user@server-1 -P XXX --sudo -N java-server-1 I found a bunch of properties in client.rb on the node side that I would like to specify on bootstrap. Is it possible to do it with…
Silk0vsky
  • 155
  • 1
  • 1
  • 5
2
votes
2 answers

Does a Chef server need to be public?

I have a Chef server running on our local network and tested it with other machines on the same network and everything worked fine. I started up a ec2 instance, and try to bootstrap and it works until it tries to connect to the Chef server. My…
cberks
  • 21
  • 2
2
votes
2 answers

Knife not parsing JSON variable in PowerShell

I am trying to create an amazon EC2 instance using "knife ec2 server create" and passing in JSON to override the default settings by using the -j option where $json is properly formed JSON text and I get the same error if I quote the variable or…
Neil Simon
  • 21
  • 1
2
votes
1 answer

How to trigger chef-client on all nodes from my workstation

I have 5 nodes and all of them have one setup cook-book in common. Now I would like to add another task in this common cookbook that would configure SQL server for me on all the nodes. Is there a way/command to manually trigger this change across…
divyanshm
  • 121
  • 1
  • 4
2
votes
1 answer

Post Azure VM creation bootstrap process - Azure user-data mechanism during VM creation?

After creating an Azure Windows VM, how does bootstrapping (winrm or ssh) completed? I'm using knife azure and using either winrm or ssh, the VM is created but fails to bootstrap. Do I have to start with an image / VHD that already has winrm or…
DonBecker
  • 250
  • 2
  • 10
2
votes
1 answer

Can I use Chef-Solo to provision a server created with knife-eucalyptus

I am able to create a new server using knife-eucalyptus like so: knife euca server create The server gets created but provisioning fails with the following message: "ERROR: Errno::ENOENT: No such file or directory - /etc/chef/validation.pem" This…
StFS
  • 273
  • 2
  • 9
2
votes
1 answer

Chef command to create new ec2 instance with second ebs volume attached and mounted instead of the default ephemeral volume?

We currently use this command to create a new ec2 instance with chef: knife ec2 server create --node-name=prod-apache-1 --availability-zone us-east-1c --image ami-3d4ff254 --distro ubuntu12.04-gems --groups "default" --ssh-key foo --identity-file…
runamok
  • 163
  • 10
2
votes
2 answers

Chef-client kills processes

I use the knife ec2 plugin to bootstrap a new instance (Ubuntu 12.04) and install a software on it. Everything works great but after chef-client ends, some processes of the new software are killed. The weird thing is that this only appears with…
2
votes
1 answer

Where is the history for the knife executing on the open-source chef server?

For example, after I run a knife command of 'knife cookbook upload cookbook_name' from a chef workstation or somewhere, where can I find the history or log about who sent the knife command and when, and what the command is? I need to monitor all the…
albert
  • 21
  • 2
2
votes
1 answer

How to use an SSH Gateway with Chef's Knife Bootstrap

I'm just getting started with Chef and have a few nodes in a private network that I need to first ssh into a gateway node to gain access to. For the moment i'm using purely password based authentication on both the gateway and the destination…
tarnfeld
  • 471
  • 2
  • 7
  • 13
2
votes
1 answer

Can you upload chef cookbooks directly from a hosted Git repository?

I'm learning Chef. My cookbooks are on Github. It seems the workflow goes: Install cookbooks locally (download them from Github with knife site install) Upload cookbooks to server (knife cookbook upload) Deploy to client from server (knife ssh ...…
Steve Bennett
  • 5,750
  • 12
  • 47
  • 59
2
votes
3 answers

creating cookbooks and roles with out chef-server

I want to run: knife role create blah I use chef-solo and don't need knife to connect to a server. I just would like to run these commands for helping me prepopulate the files quickly. Everytime I run of these commands it attempts to connect to a…
Josh Nankin
  • 722
  • 12
  • 27
1
vote
1 answer

Show when a Chef cookbook version changed on a node using knife

The infrastructure that I am working on uses Chef environments to manage the cookbook versions that are converged to nodes. While I can use knife to check what cookbook versions are available, and what cookbook versions are deployed in nodes or…
Garreth McDaid
  • 3,449
  • 1
  • 27
  • 42