chef bootstrap a node on google cloud

393 views Asked by At

Trying to bootstrap a node on google cloud engine, yet all my attempts ended with failure code

knife bootstrap ipaddress -x raid -i ~/.ssh/google_compute_engine --sudo 

results: **

trying wget...
130.211.139.224 Comparing checksum with sha256sum...
130.211.139.224 Installing Chef 12
130.211.139.224 installing with rpm...
130.211.139.224 warning: /tmp/install.sh.10183/chef-12.3.0-1.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY
130.211.139.224 Preparing...                          ################################# [100%]
130.211.139.224 Updating / installing...
130.211.139.224    1:chef-12.3.0-1.el6                ################################# [100%]
130.211.139.224 Thank you for installing Chef!
130.211.139.224 Starting first Chef Client run...
130.211.139.224 Starting Chef Client, version 12.3.0
130.211.139.224 Creating a new client identity for raid-couchbase1.c.melodic-lantern-854.internal using the validator key.
130.211.139.224 
130.211.139.224 ================================================================================
130.211.139.224 Chef encountered an error attempting to create the client "raid-couchbase1.c.melodic-lantern-854.internal"
130.211.139.224 ================================================================================
130.211.139.224 
130.211.139.224 Authentication Error:
130.211.139.224 ---------------------
130.211.139.224 Failed to authenticate to the chef server (http 401).
130.211.139.224 
130.211.139.224 Server Response:
130.211.139.224 ----------------
130.211.139.224 Invalid signature for user or client 'anan'
130.211.139.224 
130.211.139.224 Relevant Config Settings:
130.211.139.224 -------------------------
130.211.139.224 chef_server_url         "https://chef-server-e0jk.c.melodic-lantern-854.internal/organizations/anan"
130.211.139.224 validation_client_name  "anan"
130.211.139.224 validation_key          "/etc/chef/validation.pem"
130.211.139.224 
130.211.139.224 If these settings are correct, your validation_key may be invalid.
130.211.139.224 
130.211.139.224 [2015-06-09T13:54:49+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out

**

I reinstalled chefserver countless times and download the keys to the clinet but still no use

1

There are 1 answers

0
DWilches On

I was getting similar errors, what worked for me was to tell gcloud to configure ~/.ssh/config so I didn't need to specify the identity file in the knifecommand. Like this:

C:\Users\...\Google\Cloud SDK>gcloud compute config-ssh
You should now be able to use ssh/scp with your instances.
For example, try running:

  $ ssh instance-2.us-west1-c.myproject-145353

Then, I could bootstrap my node with this command:

knife bootstrap --ssh-user MyRemoteUser --sudo instance-2.us-west1-c.myproject-145353 --node-name node15-ubuntu --run-list 'recipe[learn_chef_apache2]'

Notice I didn't specify the IP nor identity file of the connection, because those from ~/.ssh/config are used.