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
1 answer

How to pass attributes from knife command (ssh)?

Is it possible to attributes from knife command (ssh), e.g. knife ssh ‘role:server’ ‘sudo chef-client’ <-- how to pass attributes to remote?
Ryan
  • 5,831
  • 24
  • 72
  • 91
1
vote
1 answer

How to get the public instance address from knife ec2 server create with chef-solo

I'd like to somehow get the public instance address or hostname from knife ec2 create ..., but I can't find any mechanism for doing so. Since I'm currently using chef-solo, I've written a simple script that runs knife ec2 create with a bootstrap…
1
vote
1 answer

Server specific usernames for each SSH connection in Chef with Knife

To set a default user for each ssh connection, I would normally adjust my .ssh/config file to Host *.server1.com User joe Host *.server2.com User mike I am now using Chef. The knife tool does not read from .ssh/config. So how can I set…
csi
  • 1,555
  • 7
  • 23
  • 42
1
vote
2 answers

Get node names that have a specific role

How can I get list of nodes, that have a specific role? It could be got with something like that: for node in `knife node list`; do [[ -n "`knife node show $node | grep $ROLE_NAME`" ]] && echo $node done Is there a way to doing it via knife…
1
vote
1 answer

What are the values for attributes in knife ssh? ( -a ipaddress etc )

Knife ssh has the -a option. I was lucky to find Knife SSH doesn't find my nodes to tell me that it's NOT called IP, as in knife search output, but ipaddress. I would love to know where to find the doc detailing this and a reason for this being…
Georg
  • 261
  • 3
  • 9
1
vote
1 answer

chef/knife environment configuration help

I have the following as my knife.rb: log_level :info log_location STDOUT node_name 'user' client_key '/home/user/.chef/user.pem' validation_client_name 'chef-validator' validation_key …
Mediocre Gopher
  • 803
  • 1
  • 13
  • 24
0
votes
1 answer

chef: The authenticity of host 'x.x.x.x' can't be established

I'm running knife bootstrap command I'm getting following error Connecting to x.x.x.x WARN: [SSH] PTY requested: stderr will be merged into stdout The authenticity of host 'x.x.x.x ()' can't be established. fingerprint is …
Jack
  • 181
  • 1
  • 1
  • 4
0
votes
1 answer

Unable to connect to chef-server

Cannot connect to the chef-server from a workstation. Tried command "knife node list" Network Error: Error connecting to https:///nodes - Failed to open TCP connection to (getaddrinfo: Name or service not…
0
votes
1 answer

Docker issues with Chef Container: "Not Found" error

I recently tried out the Chef Docker container at: https://hub.docker.com/r/chef/chef/ I downloaded it and ran the container using the following commands: docker pull "chef/chef:12.19.33" docker run -i -t --name test1 chef/chef:12.19.33 Inside…
curious_george
  • 174
  • 1
  • 8
0
votes
2 answers

Chef Private Key Could Not Be Loaded from /user.pem

I just finished the install chef-server tutorial at Chef's website, using an ec2 instance for my chef-server (t2.medium Ubuntu 16.04 AMI), and my laptop for my workstation, which also runs Ubuntu 16.04. It appears that I succeeded in setting up a…
user393947
0
votes
2 answers

How can I run chef-client remotely (windows to windows) without a password

I really hope I'm missing something here - because I'm starting to love Chef, but some pieces feel extremely stupid. I have a process (service) that runs under specific credentials. Those credentials (user / password) were typed in once upon…
Timothy Khouri
  • 177
  • 2
  • 8
0
votes
1 answer

Unable to connect to chef server

I have a Chef server running on AWS. I am able to connect to it via web browser and see the web ui from my machine which isn't the ec2. But when I bootstrap the node, also a ec2, it fails to connect to the server after 5 attempts. If I copy and the…
cberks
  • 21
  • 2
0
votes
1 answer

knife ignores client_key in ~/.chef/knife.rb

I am getting errors like WARN: Failed to read the private key /etc/chef/client.pem: # ERROR: Your private key could not be loaded from /etc/chef/client.pem Check your…
chicks
  • 3,793
  • 10
  • 27
  • 36
0
votes
1 answer

Upload specific Chef cookbook version with knife?

Is it possible to upload an exact version of a Chef cookbook via knife? All I've seen is that knife will upload the latest version it can find. Is it possible to upload a specific version? Downloading examples show: $ knife cookbook download…
Stefhen
  • 143
  • 2
  • 8
0
votes
1 answer

Fixed: Knife create instance failing - ERROR: uninitialized constant Chef::Mixin::Command

I'm wondering if any of you guys have a clue on what is the problem here. I'm using Chef Knife EC2 plugin to create a new instance. After completing the ssh connection step, it seems to break on chef-full.erb. Waiting for sshd access to become…
Pedro
  • 281
  • 2
  • 8