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
1
vote
2 answers

chef: knife deps - how to specify a cookbook version

RE: https://docs.chef.io/knife_deps.html With the knife deps --remote option, I can query our chef server. knife cookbook list -a will return all the cookbook versions. How can I use knife deps to query the dependencies of a particular version of a…
Kevin Buchs
  • 353
  • 1
  • 3
  • 20
1
vote
1 answer

Does chef knife ever need to directly access a node?

Does knife ever access nodes directly, for example, during bootstrapping? Or does bootstrapping (and other access) all go via the chef server? I'm wondering whether I can get away with configuring firewalls in AWS so that only the chef server can…
1
vote
0 answers

knife azure server list returns empty result

I'm trying to set up CHEF server and workstation on Ubuntu 16.04. I've followed several guides, and so far I'm able to get it to list the available images, but "knife azure server list" returns an empty result. AFAIK I've done all that's required. …
Bruce
  • 21
  • 4
1
vote
0 answers

Combining cat with knife ssh crashes bash

I'm trying to transfer a ssh key from one node to other using chef's knife ssh combined with the cat command on the key cat ~/.ssh/001.rsa | knife ssh -i ~/.ssh/authkey.rsa 'name:myserver' 'mkdir -p ~/.ssh && cat >> ~/.ssh/id_rsa' -a…
Lucas Mattos
  • 483
  • 1
  • 4
  • 5
1
vote
1 answer

knife ssh node name wild card matching

I have a chef environment "dev", We are switching our continuous integration build environment from jenkins to bamboo. So we have a bunch of nodes names "jenkins_slave_??" and "bamboo_slave_?? I want to execute yum update -y on all of the…
peter cooke
  • 223
  • 1
  • 8
1
vote
1 answer

Knife data bag from file - is not creating encrypted file

I'm trying to create an encrypted databag. I'm using something like this as source { "id": "rds-2", "web": "adeasdeasde" } and I want the encrypted file to go on to data_bag/aws/rds-2.json, so I'm running: knife data bag from file aws…
Pedro
  • 281
  • 2
  • 8
1
vote
1 answer

Knife EC2 in zero mode cannot gives TypeError when ssh comes up

I am using the following command to spin up a new EC2 instance: knife ec2 server create -I ami-f0b11187 --ssh-key "mykeyid" -f t2.micro --ssh-user ubuntu --identity-file ~/.ssh/mykey.pem -z --no-host-key-verify --server-connect-attribute…
Ian Bamforth
  • 289
  • 3
  • 16
1
vote
1 answer

ec2: permission denied when trying to start instance with knife

I am working on getting knife to bring up ec2 instances: I copied the policy from [What permissions in IAM do i need to start EC2 instances with chef knife? I 'attached' the policy to a minimal user, group and role I created in IAM I tried this…
1
vote
1 answer

Knife Vsphere Password Plain text

I'm using the knife-vsphere plugin for chef to interact with our vsphere hosts. As part of the config for the knife-vsphere plugin it seems that you have to enter a plain text password which I think seems wrong. When I set up the users within my…
daark
  • 113
  • 2
1
vote
2 answers

Issues using knife bootstrap on FreeBSD 10

I'm fairly certain this is unrelated to my cookbook, since the following occurs immediately after connecting: 0.0.0.0 Unmatched '. 0.0.0.0 distro=FreeBSD: Command not found. 0.0.0.0 distro: Undefined variable. 0.0.0.0 if: Expression Syntax. 0.0.0.0…
tony_perkis666
  • 243
  • 2
  • 12
1
vote
1 answer

Bootstrap Chef on Vagrant Box

I'm trying to bootstrap a Vagrant box using hosted chef server. knife bootstrap testbed001.me --sudo -x root -N "testbed001" However, the command throws an error: Bootstrapping Chef on testbed001.me testbed001.me…
Ben
  • 253
  • 1
  • 4
  • 13
1
vote
2 answers

Chef: Knife ssh connection error

I try to run a command on all my nodes but get the following error. The chef docs say it should work like this. me$ sudo knife ssh "name:*" "uptime" -x myuser WARNING: Failed to connect to -- Errno::ECONNREFUSED: Connection refused -…
j7nn7k
  • 131
  • 2
  • 9
1
vote
2 answers

chef knife ec2 server create: error when spinning up new ec2 servers

I'm trying to use knife ec2 server create to automatically launch ec2 instances for the first time, but I'm getting "ERROR: Excon::Errors::BadRequest: Expected(200) <=> Actual(400 Bad Request)". When using knife ec2 server list the list of existing…
Gui Ambros
  • 1,339
  • 2
  • 13
  • 17
1
vote
2 answers

node's FQDN is missing in chef

I am a newbie to the chef and knife, I am running couple of ec2 instances and have install chef-client and I can see all the instances in the node list of the chef, but couple of them are missing FQDN which is causing hell lot of problem, here is…
Jeevan Dongre
  • 741
  • 2
  • 17
  • 33
1
vote
1 answer

chef user action logging

I am using chef for managing all our cookbooks. The problem is not only me who uses chef, I wonder if whether there is a way to logging all actions that uses completes. In particular, I am interested when and who did knife cookbook upload and all…
com
  • 261
  • 2
  • 15